OSDN Git Service

Fixes talkback accessibility on learn more link.
authorUdam Saini <udam@google.com>
Thu, 18 Feb 2016 21:51:01 +0000 (13:51 -0800)
committerUdam Saini <udam@google.com>
Thu, 18 Feb 2016 23:45:24 +0000 (15:45 -0800)
Uses the LinkTextView, which handles partial url talkback
in textviews for accessibility. Also cleans up some string
spacing and changed an instance of Tap &amp; hold to
Touch and hold for clarity.

bug:27171497
bug:26562712
Change-Id: I059a782a952ac962537c374959ee740962d6016f

res/layout/suw_item_link_description.xml [new file with mode: 0644]
res/values/strings.xml
res/xml/fingerprint_enroll_introduction_items.xml
src/com/android/settings/fingerprint/FingerprintEnrollIntroduction.java

diff --git a/res/layout/suw_item_link_description.xml b/res/layout/suw_item_link_description.xml
new file mode 100644 (file)
index 0000000..5396de1
--- /dev/null
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Copyright (C) 2016 The Android Open Source Project
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    style="@style/SuwItemContainer"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="horizontal"
+    android:paddingTop="@dimen/suw_description_margin_top"
+    android:paddingBottom="@dimen/suw_description_margin_bottom_lists">
+
+    <FrameLayout
+        android:id="@+id/suw_items_icon_container"
+        android:layout_width="@dimen/suw_items_icon_container_width"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center_vertical"
+        android:gravity="start">
+
+        <ImageView
+            android:id="@+id/suw_items_icon"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            tools:ignore="ContentDescription" />
+
+    </FrameLayout>
+
+    <LinearLayout
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_weight="1"
+        android:orientation="vertical">
+
+        <com.android.settings.widget.LinkTextView
+            android:id="@+id/suw_items_title"
+            style="@style/SuwItemTitle"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:gravity="start"
+            android:lineSpacingExtra="@dimen/suw_description_line_spacing_extra"
+            android:textAlignment="viewStart"
+            android:textAppearance="@style/TextAppearance.SuwDescription"
+            tools:ignore="UnusedAttribute" />
+
+        <com.android.settings.widget.LinkTextView
+            android:id="@+id/suw_items_summary"
+            style="@style/SuwItemSummary"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:gravity="start"
+            android:textAlignment="viewStart"
+            android:visibility="gone"
+            tools:ignore="UnusedAttribute" />
+
+    </LinearLayout>
+
+</LinearLayout>
index 9644171..7d27752 100644 (file)
     <!-- Introduction title shown in fingerprint enrollment to introduce the fingerprint feature[CHAR LIMIT=29] -->
     <string name="security_settings_fingerprint_enroll_introduction_title">Unlock with fingerprint</string>
     <!-- Introduction detail message shown in fingerprint enrollment dialog [CHAR LIMIT=NONE]-->
-    <string name="security_settings_fingerprint_enroll_introduction_message">Just touch the fingerprint sensor to unlock your phone, authorize purchases, or sign in to apps. \n\n Be careful whose fingerprints you add - any fingerprints added will be able to do these things.</string>
-    <!-- Introduction detail message shown in fingerprint enrollment dialog to warn the user [CHAR LIMIT=NONE]-->
-    <string name="security_settings_fingerprint_enroll_introduction_message_warning">Note: Your fingerprint may be less secure than a strong pattern or PIN. <annotation id="url">Learn more</annotation></string>
+    <string name="security_settings_fingerprint_enroll_introduction_message">Just touch the fingerprint sensor to unlock your phone, authorize purchases, or sign in to apps. Be careful whose fingerprints you add. Even one added print can do any of these things.\n\nNote: Your fingerprint may be less secure than a strong pattern or PIN. <annotation id="url">Learn more</annotation></string>
     <!-- Button text to cancel enrollment from the introduction [CHAR LIMIT=22] -->
     <string name="security_settings_fingerprint_enroll_introduction_cancel">Cancel</string>
     <!-- Button text to continue to the next screen from the introduction [CHAR LIMIT=22] -->
     <!-- Summary for the preference screen to enable the global geture that turns on accessibility (off state). [CHAR LIMIT=35] -->
     <string name="accessibility_global_gesture_preference_summary_off">Off</string>
     <!--  Description for the preference screen to enable the global geture taht turns on accessibility. [CHAR LIMIT=none] -->
-    <string name="accessibility_global_gesture_preference_description">When this feature is turned on, you can quickly activate accessibility features in two steps:\n\nStep 1: Press and hold the power button until you hear a sound or feel a vibration.\n\nStep 2: Tap &amp; hold two fingers until you hear audio confirmation.\n\nIf the device has multiple users, using this shortcut on the lock screen temporarily enables accessibility until the device is unlocked.</string>
+    <string name="accessibility_global_gesture_preference_description">When this feature is turned on, you can quickly activate accessibility features in two steps:\n\nStep 1: Press and hold the power button until you hear a sound or feel a vibration.\n\nStep 2: Touch and hold two fingers until you hear audio confirmation.\n\nIf the device has multiple users, using this shortcut on the lock screen temporarily enables accessibility until the device is unlocked.</string>
     <!-- Title for the accessibility preference to high contrast text. [CHAR LIMIT=35] -->
     <string name="accessibility_toggle_high_text_contrast_preference_title">High contrast text</string>
     <!-- Title for the accessibility preference to auto update screen magnification. [CHAR LIMIT=35] -->
index 3368843..4cb18a6 100644 (file)
 
     <Item
         android:enabled="false"
-        android:layout="@layout/suw_items_description"
-        android:title="@string/security_settings_fingerprint_enroll_introduction_message" />
-
-    <Item
-        android:enabled="false"
-        android:id="@+id/fingerprint_introduction_message_warning"
-        android:layout="@layout/suw_items_description" />
+        android:id="@+id/fingerprint_introduction_message"
+        android:layout="@layout/suw_item_link_description"/>
 
     <Item
         android:id="@+id/next_button"
index bedeb30..2fe255e 100644 (file)
@@ -66,9 +66,9 @@ public class FingerprintEnrollIntroduction extends FingerprintEnrollBase
                 (SetupWizardItemsLayout) findViewById(R.id.setup_wizard_layout);
         layout.getListView().setOnItemClickListener(this);
         final ItemAdapter adapter = (ItemAdapter) layout.getAdapter();
-        Item item = (Item) adapter.findItemById(R.id.fingerprint_introduction_message_warning);
+        Item item = (Item) adapter.findItemById(R.id.fingerprint_introduction_message);
         item.setTitle(LearnMoreSpan.linkify(
-                getText(R.string.security_settings_fingerprint_enroll_introduction_message_warning),
+                getText(R.string.security_settings_fingerprint_enroll_introduction_message),
                 getString(R.string.help_url_fingerprint)));
         updatePasswordQuality();
     }