[FAB] Improve the shortcut dialog ux after change accessibility button mode
Problem: The "Customize accessibility button" link only exists when the user selects the FAB location, which may confuse and disorient the user Solution: It is hard to back to floating menu mode if we turns to navigation bar from "Customize accessibility button" setting. Added the link in the "navigation bar mode" can help on this problem. Fix: 183342563 Test: manual test Change-Id: Ife572b0962f3a57c34af56cd930a487c9d813c0c
This commit is contained in:
@@ -26,6 +26,7 @@ import android.content.res.TypedArray;
|
|||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.text.Spannable;
|
import android.text.Spannable;
|
||||||
import android.text.SpannableString;
|
import android.text.SpannableString;
|
||||||
|
import android.text.SpannableStringBuilder;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.text.method.LinkMovementMethod;
|
import android.text.method.LinkMovementMethod;
|
||||||
import android.text.style.ImageSpan;
|
import android.text.style.ImageSpan;
|
||||||
@@ -320,8 +321,13 @@ public class AccessibilityEditDialogUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static CharSequence retrieveSummary(Context context, int lineHeight) {
|
private static CharSequence retrieveSummary(Context context, int lineHeight) {
|
||||||
return AccessibilityUtil.isFloatingMenuEnabled(context)
|
final SpannableStringBuilder sb = new SpannableStringBuilder();
|
||||||
? getSummaryStringWithLink(context) : getSummaryStringWithIcon(context, lineHeight);
|
if (!AccessibilityUtil.isFloatingMenuEnabled(context)) {
|
||||||
|
sb.append(getSummaryStringWithIcon(context, lineHeight));
|
||||||
|
sb.append("\n\n");
|
||||||
|
}
|
||||||
|
sb.append(getCustomizeAccessibilityButtonLink(context));
|
||||||
|
return sb;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int retrieveSoftwareShortcutImageResId(Context context) {
|
private static int retrieveSoftwareShortcutImageResId(Context context) {
|
||||||
@@ -330,7 +336,7 @@ public class AccessibilityEditDialogUtils {
|
|||||||
: R.drawable.accessibility_shortcut_type_software;
|
: R.drawable.accessibility_shortcut_type_software;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static CharSequence getSummaryStringWithLink(Context context) {
|
private static CharSequence getCustomizeAccessibilityButtonLink(Context context) {
|
||||||
final View.OnClickListener linkListener = v -> new SubSettingLauncher(context)
|
final View.OnClickListener linkListener = v -> new SubSettingLauncher(context)
|
||||||
.setDestination(AccessibilityButtonFragment.class.getName())
|
.setDestination(AccessibilityButtonFragment.class.getName())
|
||||||
.setSourceMetricsCategory(
|
.setSourceMetricsCategory(
|
||||||
|
Reference in New Issue
Block a user