Merge "QS: Add content description to page indicator" into nyc-dev
am: 4db7675
* commit '4db7675d8509039dd9cf5dc7231c5bca6330dcd3':
QS: Add content description to page indicator
Change-Id: Ibee90a16133577b59c90880b8f591c39bf6f0882
This commit is contained in:
@@ -33,7 +33,9 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
android:gravity="center" />
|
android:gravity="center"
|
||||||
|
android:importantForAccessibility="yes"
|
||||||
|
android:focusable="true" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@android:id/edit"
|
android:id="@android:id/edit"
|
||||||
|
|||||||
@@ -1595,4 +1595,7 @@
|
|||||||
<!-- accessibility label for button to expand quick settings [CHAR LIMIT=NONE] -->
|
<!-- accessibility label for button to expand quick settings [CHAR LIMIT=NONE] -->
|
||||||
<string name="accessibility_quick_settings_expand">Expand quick settings.</string>
|
<string name="accessibility_quick_settings_expand">Expand quick settings.</string>
|
||||||
|
|
||||||
|
<!-- accessibility label for paging indicator in quick settings [CHAR LIMITi=NONE] -->
|
||||||
|
<string name="accessibility_quick_settings_page">Page <xliff:g name="current_page" example="1">%1$d</xliff:g> of <xliff:g name="num_pages" example="2">%2$d</xliff:g></string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ public class PageIndicator extends ViewGroup {
|
|||||||
|
|
||||||
public void setLocation(float location) {
|
public void setLocation(float location) {
|
||||||
int index = (int) location;
|
int index = (int) location;
|
||||||
|
setContentDescription(getContext().getString(R.string.accessibility_quick_settings_page,
|
||||||
|
(index + 1), getChildCount()));
|
||||||
int position = index << 1 | ((location != index) ? 1 : 0);
|
int position = index << 1 | ((location != index) ? 1 : 0);
|
||||||
if (DEBUG) Log.d(TAG, "setLocation " + location + " " + index + " " + position);
|
if (DEBUG) Log.d(TAG, "setLocation " + location + " " + index + " " + position);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user