OSDN Git Service

Moved the waiting for fingerprint string to the hint
authorSelim Cinek <cinek@google.com>
Thu, 23 Mar 2017 21:20:32 +0000 (14:20 -0700)
committerSelim Cinek <cinek@google.com>
Thu, 23 Mar 2017 21:20:32 +0000 (14:20 -0700)
We don't want to bake in the button into the text, so we're
switching the description to the hint text.

Test: manual
Change-Id: Ib0e4a86a11390ce5d3bcb0de9bc31861ad9ee84d
Fixes: 36557742

packages/SystemUI/res/layout/keyguard_bottom_area.xml
packages/SystemUI/res/values/strings.xml
packages/SystemUI/src/com/android/systemui/statusbar/phone/LockIcon.java

index fc1271c..e3063c5 100644 (file)
@@ -85,6 +85,7 @@
         android:layout_height="@dimen/keyguard_affordance_height"
         android:layout_gravity="bottom|center_horizontal"
         android:src="@drawable/ic_lock_24dp"
+        android:contentDescription="@string/accessibility_unlock_button"
         android:scaleType="center" />
 
 </com.android.systemui.statusbar.phone.KeyguardBottomAreaView>
index c9e7e57..03f5981 100644 (file)
     <string name="accessibility_voice_assist_button">Voice Assist</string>
     <!-- Content description of the unlock button for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
     <string name="accessibility_unlock_button">Unlock</string>
-    <!-- Content description of the unlock button when fingerpint is on (not shown on the screen). [CHAR LIMIT=NONE] -->
-    <string name="accessibility_unlock_button_fingerprint">Unlock button, waiting for fingerprint</string>
+    <!-- Content description hint of the unlock button when fingerprint is on (not shown on the screen). [CHAR LIMIT=NONE] -->
+    <string name="accessibility_waiting_for_fingerprint">Waiting for fingerprint</string>
     <!-- Accessibility action of the unlock button when fingerpint is on (not shown on the screen). [CHAR LIMIT=NONE] -->
     <string name="accessibility_unlock_without_fingerprint">Unlock without using your fingerprint</string>
     <!-- Click action label for accessibility for the unlock button. [CHAR LIMIT=NONE] -->
index ef42b2f..bccc5d5 100644 (file)
@@ -179,10 +179,6 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
             setRestingAlpha(
                     anyFingerprintIcon ? 1f : KeyguardAffordanceHelper.SWIPE_RESTING_ALPHA_AMOUNT);
             setImageDrawable(icon);
-            String contentDescription = getResources().getString(anyFingerprintIcon
-                    ? R.string.accessibility_unlock_button_fingerprint
-                    : R.string.accessibility_unlock_button);
-            setContentDescription(contentDescription);
             mHasFingerPrintIcon = anyFingerprintIcon;
             if (animation != null && isAnim) {
                 animation.forceAnimationOnUI();
@@ -225,13 +221,13 @@ public class LockIcon extends KeyguardAffordanceView implements OnUserInfoChange
     public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
         super.onInitializeAccessibilityNodeInfo(info);
         if (mHasFingerPrintIcon) {
-            // Avoid that the button description is also spoken
-            info.setClassName(LockIcon.class.getName());
             AccessibilityNodeInfo.AccessibilityAction unlock
                     = new AccessibilityNodeInfo.AccessibilityAction(
                     AccessibilityNodeInfo.ACTION_CLICK,
                     getContext().getString(R.string.accessibility_unlock_without_fingerprint));
             info.addAction(unlock);
+            info.setHintText(getContext().getString(
+                    R.string.accessibility_waiting_for_fingerprint));
         }
     }