OSDN Git Service

Content description for FloatingToobar overflow.
authorPhil Weaver <pweaver@google.com>
Mon, 16 May 2016 16:41:14 +0000 (09:41 -0700)
committerPhil Weaver <pweaver@google.com>
Mon, 16 May 2016 16:41:14 +0000 (09:41 -0700)
Was missing a content description. The same button is used for
both opening and closing the toolbar, so it needs to be updated
dynamically.

Bug: 28750935
Change-Id: I7f75701ae6af45e5621c36b81003b658479e8b31

core/java/com/android/internal/widget/FloatingToolbar.java
core/res/res/values/symbols.xml

index 8cc8509..594581a 100644 (file)
@@ -899,6 +899,8 @@ public final class FloatingToolbar {
                 mOverflowPanel.setAlpha(1);
                 mOverflowPanel.setVisibility(View.VISIBLE);
                 mOverflowButton.setImageDrawable(mArrow);
+                mOverflowButton.setContentDescription(mContext.getString(
+                        R.string.floating_toolbar_close_overflow_description));
 
                 // Update x-coordinates depending on RTL state.
                 if (isRTL()) {
@@ -940,6 +942,8 @@ public final class FloatingToolbar {
                 mOverflowPanel.setAlpha(0);
                 mOverflowPanel.setVisibility(View.INVISIBLE);
                 mOverflowButton.setImageDrawable(mOverflow);
+                mOverflowButton.setContentDescription(mContext.getString(
+                        R.string.floating_toolbar_open_overflow_description));
 
                 if (hasOverflow()) {
                     // Update x-coordinates depending on RTL state.
index 29818df..ed45a20 100644 (file)
   <java-symbol type="layout" name="floating_popup_overflow_list_item" />
   <java-symbol type="layout" name="floating_popup_overflow_image_list_item" />
   <java-symbol type="layout" name="floating_popup_overflow_button" />
+  <java-symbol type="string" name="floating_toolbar_open_overflow_description" />
+  <java-symbol type="string" name="floating_toolbar_close_overflow_description" />
   <java-symbol type="dimen" name="floating_toolbar_height" />
   <java-symbol type="dimen" name="floating_toolbar_menu_button_side_padding" />
   <java-symbol type="dimen" name="floating_toolbar_overflow_side_padding" />