diff options
| author | 2014-10-28 16:42:24 -0700 | |
|---|---|---|
| committer | 2014-10-28 16:42:24 -0700 | |
| commit | 85085343b378f00a34448b69e582226fa584b005 (patch) | |
| tree | 33ace4b3d63d0202dd371faa50adb5c6b96b90e0 | |
| parent | 31b76b66b1678eb6483676aa2ef587e10b98d02a (diff) | |
Add content description to Toolbar collapse button
BUG: 17722111
Change-Id: If6caa8bc61b0d178648952c419591380f4edf4ba
| -rw-r--r-- | api/current.txt | 1 | ||||
| -rw-r--r-- | core/java/android/widget/Toolbar.java | 3 | ||||
| -rw-r--r-- | core/res/res/layout/alert_dialog_material.xml | 3 | ||||
| -rw-r--r-- | core/res/res/values/attrs.xml | 3 | ||||
| -rw-r--r-- | core/res/res/values/public.xml | 7 | ||||
| -rw-r--r-- | core/res/res/values/strings.xml | 3 | ||||
| -rw-r--r-- | core/res/res/values/styles.xml | 1 |
7 files changed, 20 insertions, 1 deletions
diff --git a/api/current.txt b/api/current.txt index aa8057de7e95..7349c0aac728 100644 --- a/api/current.txt +++ b/api/current.txt @@ -402,6 +402,7 @@ package android { field public static final int closeIcon = 16843905; // 0x1010481 field public static final int codes = 16843330; // 0x1010242 field public static final int collapseColumns = 16843083; // 0x101014b + field public static final int collapseContentDescription = 16844034; // 0x1010502 field public static final int color = 16843173; // 0x10101a5 field public static final int colorAccent = 16843829; // 0x1010435 field public static final int colorActivatedHighlight = 16843664; // 0x1010390 diff --git a/core/java/android/widget/Toolbar.java b/core/java/android/widget/Toolbar.java index d8e39e3788c6..d4d186c94e23 100644 --- a/core/java/android/widget/Toolbar.java +++ b/core/java/android/widget/Toolbar.java @@ -104,6 +104,7 @@ public class Toolbar extends ViewGroup { private ImageView mLogoView; private Drawable mCollapseIcon; + private CharSequence mCollapseDescription; private ImageButton mCollapseButtonView; View mExpandedActionView; @@ -238,6 +239,7 @@ public class Toolbar extends ViewGroup { } mCollapseIcon = a.getDrawable(R.styleable.Toolbar_collapseIcon); + mCollapseDescription = a.getText(R.styleable.Toolbar_collapseContentDescription); final CharSequence title = a.getText(R.styleable.Toolbar_title); if (!TextUtils.isEmpty(title)) { @@ -998,6 +1000,7 @@ public class Toolbar extends ViewGroup { if (mCollapseButtonView == null) { mCollapseButtonView = new ImageButton(getContext(), null, 0, mNavButtonStyle); mCollapseButtonView.setImageDrawable(mCollapseIcon); + mCollapseButtonView.setContentDescription(mCollapseDescription); final LayoutParams lp = generateDefaultLayoutParams(); lp.gravity = Gravity.START | (mButtonGravity & Gravity.VERTICAL_GRAVITY_MASK); lp.mViewType = LayoutParams.EXPANDED; diff --git a/core/res/res/layout/alert_dialog_material.xml b/core/res/res/layout/alert_dialog_material.xml index c96182853a16..89a47af15fe0 100644 --- a/core/res/res/layout/alert_dialog_material.xml +++ b/core/res/res/layout/alert_dialog_material.xml @@ -99,7 +99,8 @@ android:paddingStart="12dp" android:paddingEnd="12dp" android:paddingTop="8dp" - android:paddingBottom="8dp"> + android:paddingBottom="8dp" + android:gravity="bottom"> <Button android:id="@+id/button3" style="?attr/buttonBarNeutralButtonStyle" android:layout_width="wrap_content" diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index 7b4df49390e0..c4131b3c784a 100644 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -7460,7 +7460,10 @@ <!-- Push object to the bottom of its container, not changing its size. --> <flag name="bottom" value="0x50" /> </attr> + <!-- Icon drawable to use for the collapse button. --> <attr name="collapseIcon" format="reference" /> + <!-- Text to set as the content description for the collapse button. --> + <attr name="collapseContentDescription" format="string" /> <!-- Reference to a theme that should be used to inflate popups shown by widgets in the toolbar. --> <attr name="popupTheme" format="reference" /> diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index 45208ab6b4d5..c0b7fd0ea4e8 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -2589,6 +2589,13 @@ <!-- @hide --> <public-padding type="attr" name="private_resource_pad" end="0x01010500" /> + + <!-- =============================================================== + Resources added in version 22 of the platform + =============================================================== --> + <eat-comment /> + <public type="attr" name="resizeClip"/> + <public type="attr" name="collapseContentDescription"/> </resources> diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index 89f6a9a11f05..1501497af4a7 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -4902,4 +4902,7 @@ <!-- Zen mode condition: no exit criteria. [CHAR LIMIT=NONE] --> <string name="zen_mode_forever">Indefinitely</string> + + <!-- Content description for the Toolbar icon used to collapse an expanded action mode. [CHAR LIMIT=NONE] --> + <string name="toolbar_collapse_description">Collapse</string> </resources> diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml index ba15e9cc28c0..dd871399b6fc 100644 --- a/core/res/res/values/styles.xml +++ b/core/res/res/values/styles.xml @@ -1218,6 +1218,7 @@ please see styles_device_defaults.xml. <item name="buttonGravity">top</item> <item name="navigationButtonStyle">@style/Widget.Toolbar.Button.Navigation</item> <item name="collapseIcon">?attr/homeAsUpIndicator</item> + <item name="collapseContentDescription">@string/toolbar_collapse_description</item> <item name="contentInsetStart">16dp</item> <item name="touchscreenBlocksFocus">true</item> </style> |