OSDN Git Service

Adopt lockscreen shortcut hint from AOSP
authorSebastian Haderecker <sebastian.haderecker@gmail.com>
Thu, 13 Apr 2017 19:18:21 +0000 (21:18 +0200)
committerMichael Bestas <mkbestas@lineageos.org>
Fri, 16 Jun 2017 14:12:59 +0000 (14:12 +0000)
In AOSP for icons like Camera, Phone or voice assist it says "Swipe from icon for..."
When adding custom lockscreen shortcuts it currently says "Swipe left/right for..."
It would be better if we have some consistency here.

This patch adopts the AOSP hint for all custom lockscreen shortcuts.

Change-Id: I68222750f07daa64fb0ac42eb903317cfad2bc1c
Signed-off-by: Sebastian Haderecker <sebastian.haderecker@gmail.com>
packages/SystemUI/res/values/cm_strings.xml
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java

index 4f8ec97..d28dde0 100644 (file)
     <!-- Screen pinning dialog description (for devices without navbar) -->
     <string name="screen_pinning_description_no_navbar">This keeps it in view until you unpin. Touch and hold the Back button to unpin.</string>
 
-    <!-- Strings for lockscreen shortcut hints -->
-    <string name="left_shortcut_hint">Swipe right for %1$s</string>
-    <string name="right_shortcut_hint">Swipe left for %1$s</string>
-
+    <!-- String for lockscreen shortcut hints -->
+    <string name="shortcut_hint">Swipe from icon for %1$s</string>
     <string name="lockscreen_message">Tap an icon on the left or right to reassign a lock screen shortcut.</string>
     <string name="lockscreen_default_target">Default</string>
     <string name="select_application">Select application</string>
index b06802c..266c693 100644 (file)
@@ -859,17 +859,9 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
 
     private String getIndexHint(LockscreenShortcutsHelper.Shortcuts shortcut) {
         if (mShortcutHelper.isTargetCustom(shortcut)) {
-            boolean isRtl = getLayoutDirection() == LAYOUT_DIRECTION_RTL;
             String label = mShortcutHelper.getFriendlyNameForUri(shortcut);
             int resId = 0;
-            switch (shortcut) {
-                case LEFT_SHORTCUT:
-                    resId = isRtl ? R.string.right_shortcut_hint : R.string.left_shortcut_hint;
-                    break;
-                case RIGHT_SHORTCUT:
-                    resId = isRtl ? R.string.left_shortcut_hint : R.string.right_shortcut_hint;
-                    break;
-            }
+            resId = R.string.shortcut_hint;
             return mContext.getString(resId, label);
         } else {
             return null;