Show the illustration with the given button mode
Currently we support two modes of software shortcut. We should change the illustration depending on the mode. Bug: 185193333 Test: manually test Change-Id: I54f800ead984c22cebec1de4ac15c022b0bcbb3d
This commit is contained in:
@@ -25,13 +25,21 @@
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="24dp">
|
android:padding="24dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/image"
|
||||||
|
android:layout_width="@dimen/accessibility_imageview_size"
|
||||||
|
android:layout_height="@dimen/accessibility_imageview_size"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginBottom="@dimen/accessibility_textview_layout_margin_bottom"
|
||||||
|
android:scaleType="fitCenter"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/accessibility_magnification_switch_shortcut_message"
|
android:text="@string/accessibility_magnification_switch_shortcut_message"
|
||||||
android:textAppearance="?android:attr/textAppearanceListItemSecondary"
|
android:textAppearance="?android:attr/textAppearanceListItemSecondary"
|
||||||
android:textColor="?android:attr/textColorSecondary"
|
android:textColor="?android:attr/textColorSecondary"
|
||||||
android:layout_marginBottom="24dp"/>
|
android:layout_marginBottom="@dimen/accessibility_textview_layout_margin_bottom"/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@@ -292,6 +292,8 @@
|
|||||||
<dimen name="accessibility_layout_margin_start_end">16dp</dimen>
|
<dimen name="accessibility_layout_margin_start_end">16dp</dimen>
|
||||||
<dimen name="accessibility_button_preference_padding_top_bottom">18dp</dimen>
|
<dimen name="accessibility_button_preference_padding_top_bottom">18dp</dimen>
|
||||||
<dimen name="accessibility_imageview_size">176dp</dimen>
|
<dimen name="accessibility_imageview_size">176dp</dimen>
|
||||||
|
<!-- The margin between two Textviews-->
|
||||||
|
<dimen name="accessibility_textview_layout_margin_bottom">24dp</dimen>
|
||||||
|
|
||||||
<!-- Restricted icon in switch bar -->
|
<!-- Restricted icon in switch bar -->
|
||||||
<dimen name="restricted_icon_margin_end">16dp</dimen>
|
<dimen name="restricted_icon_margin_end">16dp</dimen>
|
||||||
|
@@ -168,6 +168,7 @@ public class AccessibilityEditDialogUtils {
|
|||||||
View.SCROLL_INDICATOR_TOP | View.SCROLL_INDICATOR_BOTTOM,
|
View.SCROLL_INDICATOR_TOP | View.SCROLL_INDICATOR_BOTTOM,
|
||||||
View.SCROLL_INDICATOR_TOP | View.SCROLL_INDICATOR_BOTTOM);
|
View.SCROLL_INDICATOR_TOP | View.SCROLL_INDICATOR_BOTTOM);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void setEditShortcutButtonsListener(AlertDialog dialog,
|
private static void setEditShortcutButtonsListener(AlertDialog dialog,
|
||||||
View.OnClickListener listener) {
|
View.OnClickListener listener) {
|
||||||
final View contentView = dialog.findViewById(R.id.container_layout);
|
final View contentView = dialog.findViewById(R.id.container_layout);
|
||||||
@@ -215,6 +216,8 @@ public class AccessibilityEditDialogUtils {
|
|||||||
case DialogType.EDIT_MAGNIFICATION_SWITCH_SHORTCUT:
|
case DialogType.EDIT_MAGNIFICATION_SWITCH_SHORTCUT:
|
||||||
contentView = inflater.inflate(
|
contentView = inflater.inflate(
|
||||||
R.layout.accessibility_edit_magnification_shortcut, null);
|
R.layout.accessibility_edit_magnification_shortcut, null);
|
||||||
|
final ImageView image = contentView.findViewById(R.id.image);
|
||||||
|
image.setImageResource(retrieveSoftwareShortcutImageResId(context));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new IllegalArgumentException();
|
throw new IllegalArgumentException();
|
||||||
@@ -247,7 +250,7 @@ public class AccessibilityEditDialogUtils {
|
|||||||
final int lineHeight = summary.getLineHeight();
|
final int lineHeight = summary.getLineHeight();
|
||||||
|
|
||||||
setupShortcutWidget(dialogView, title, retrieveSummary(context, lineHeight),
|
setupShortcutWidget(dialogView, title, retrieveSummary(context, lineHeight),
|
||||||
retrieveImageResId(context));
|
retrieveSoftwareShortcutImageResId(context));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void initHardwareShortcut(Context context, View view) {
|
private static void initHardwareShortcut(Context context, View view) {
|
||||||
@@ -286,7 +289,7 @@ public class AccessibilityEditDialogUtils {
|
|||||||
? getSummaryStringWithLink(context) : getSummaryStringWithIcon(context, lineHeight);
|
? getSummaryStringWithLink(context) : getSummaryStringWithIcon(context, lineHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int retrieveImageResId(Context context) {
|
private static int retrieveSoftwareShortcutImageResId(Context context) {
|
||||||
return AccessibilityUtil.isFloatingMenuEnabled(context)
|
return AccessibilityUtil.isFloatingMenuEnabled(context)
|
||||||
? R.drawable.accessibility_shortcut_type_software_floating
|
? R.drawable.accessibility_shortcut_type_software_floating
|
||||||
: R.drawable.accessibility_shortcut_type_software;
|
: R.drawable.accessibility_shortcut_type_software;
|
||||||
|
Reference in New Issue
Block a user