OSDN Git Service

base: deuglify single hand hint ui
authorJoey Rizzoli <joey@lineageos.org>
Sun, 19 Feb 2017 09:04:41 +0000 (10:04 +0100)
committerJoey Rizzoli <joey@lineageos.org>
Fri, 3 Mar 2017 13:26:23 +0000 (14:26 +0100)
Change-Id: Icda09687d298214577c1d647312c900cfc29facc
Signed-off-by: Joey Rizzoli <joey@lineageos.org>
core/res/res/drawable-xxhdpi/singlehandmode_click_hint.png [deleted file]
core/res/res/drawable-xxhdpi/singlehandmode_info.png [deleted file]
core/res/res/drawable-xxhdpi/singlehandmode_info_pressed.png [deleted file]
core/res/res/drawable-xxhdpi/singlehandmode_slide_hint.9.png [deleted file]
core/res/res/drawable/singlehandmode_click_hint.xml [new file with mode: 0644]
core/res/res/drawable/singlehandmode_hintinfo.xml
core/res/res/layout/single_hand_window.xml
core/res/res/values/cm_strings.xml
core/res/res/values/cm_symbols.xml
services/core/java/com/android/server/wm/SingleHandWindow.java

diff --git a/core/res/res/drawable-xxhdpi/singlehandmode_click_hint.png b/core/res/res/drawable-xxhdpi/singlehandmode_click_hint.png
deleted file mode 100644 (file)
index d8d6135..0000000
Binary files a/core/res/res/drawable-xxhdpi/singlehandmode_click_hint.png and /dev/null differ
diff --git a/core/res/res/drawable-xxhdpi/singlehandmode_info.png b/core/res/res/drawable-xxhdpi/singlehandmode_info.png
deleted file mode 100644 (file)
index bcbfe32..0000000
Binary files a/core/res/res/drawable-xxhdpi/singlehandmode_info.png and /dev/null differ
diff --git a/core/res/res/drawable-xxhdpi/singlehandmode_info_pressed.png b/core/res/res/drawable-xxhdpi/singlehandmode_info_pressed.png
deleted file mode 100644 (file)
index 9bebe5a..0000000
Binary files a/core/res/res/drawable-xxhdpi/singlehandmode_info_pressed.png and /dev/null differ
diff --git a/core/res/res/drawable-xxhdpi/singlehandmode_slide_hint.9.png b/core/res/res/drawable-xxhdpi/singlehandmode_slide_hint.9.png
deleted file mode 100644 (file)
index 06ff14d..0000000
Binary files a/core/res/res/drawable-xxhdpi/singlehandmode_slide_hint.9.png and /dev/null differ
diff --git a/core/res/res/drawable/singlehandmode_click_hint.xml b/core/res/res/drawable/singlehandmode_click_hint.xml
new file mode 100644 (file)
index 0000000..a9e94a9
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+
+    <clip-path
+        android:pathData="M0 0h24v24H0V0z" />
+    <path
+        android:fillColor="@android:color/white"
+        android:pathData="M9 11.24V7.5C9 6.12 10.12 5 11.5 5S14 6.12 14 7.5v3.74c1.21-.81 2-2.18 2-3.74C16
+5.01 13.99 3 11.5 3S7 5.01 7 7.5c0 1.56 .79 2.93 2 3.74zm9.84
+4.63l-4.54-2.26c-.17-.07-.35-.11-.54-.11H13v-6c0-.83-.67-1.5-1.5-1.5S10 6.67 10
+7.5v10.74l-3.43-.72c-.08-.01-.15-.03-.24-.03-.31 0-.59 .13 -.79 .33 l-.79 .8
+4.94 4.94c.27 .27 .65 .44 1.06 .44 h6.79c.75 0 1.33-.55
+1.44-1.28l.75-5.27c.01-.07 .02 -.14 .02 -.2 0-.62-.38-1.16-.91-1.38z" />
+</vector>
\ No newline at end of file
index a2e9b9f..b936e62 100644 (file)
@@ -1,8 +1,14 @@
 <?xml version="1.0" encoding="utf-8"?>
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
 
-<selector
-    xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:state_focused="true" android:drawable="@android:drawable/singlehandmode_info_pressed" />
-    <item android:state_focused="false" android:state_pressed="false" android:drawable="@android:drawable/singlehandmode_info" />
-    <item android:state_focused="false" android:state_pressed="true" android:drawable="@android:drawable/singlehandmode_info_pressed" />
-</selector>
+    <path
+        android:pathData="M0 0h24v24H0z" />
+    <path
+        android:fillColor="@android:color/white"
+        android:pathData="M11 17h2v-6h-2v6zm1-15C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12
+2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zM11 9h2V7h-2v2z" />
+</vector>
\ No newline at end of file
index 452926f..1c5de4a 100644 (file)
 -->
 
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent">
-  <RelativeLayout android:layout_width="match_parent"
-                  android:layout_height="0px"
-                  android:background="#FF000000"
-                  android:id="@+id/relative_top">
-    <FrameLayout android:id="@+id/hint_section"
-        android:layout_width="60dp"
-        android:layout_height="70dp"
-        android:clickable="true">
-       <ImageView
-              android:id="@+id/hint_info"
-              android:visibility="invisible"
-              android:layout_width="32dp"
-              android:layout_height="32dp"
-              android:layout_marginTop="16dip"
-              android:layout_marginStart="10dip"
-              android:focusable="true"
-              android:clickable="true"
-              android:background="@android:drawable/singlehandmode_hintinfo" />
-    </FrameLayout>
-    <TextView android:id="@+id/single_hand_window_title"
-              android:layout_width="match_parent"
-              android:layout_height="wrap_content"
-              android:layout_marginTop="32dip"
-              android:layout_marginStart="18dip"
-              android:layout_marginEnd="18dip"
-              android:textSize="14dp"
-              android:textColor="#d9ffffff"
-              android:text="@android:string/singlehandmode_click_hint_message"
-              android:visibility="invisible"
-              android:gravity="center" />
-    <ImageView
-              android:id="@+id/click_hint"
-              android:layout_below="@id/single_hand_window_title"
-              android:visibility="invisible"
-              android:layout_width="wrap_content"
-              android:layout_height="wrap_content"
-              android:layout_marginTop="2dip"
-              android:layout_centerHorizontal="true"
-              android:src="@android:drawable/singlehandmode_click_hint" />
-  </RelativeLayout>
-  <RelativeLayout android:layout_width="0px"
-                  android:layout_height="0px"
-                  android:background="#FF000000"
-                  android:id="@+id/relative_bottom" />
-  <LinearLayout android:id="@+id/slide_hint_area"
-                android:visibility="invisible"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_alignParentBottom="true"
-                android:orientation="vertical">
-    <TextView android:id="@+id/singlehandmode_slide_hint_text"
-              android:layout_width="240dip"
-              android:layout_height="wrap_content"
-              android:visibility="invisible"
-              android:textSize="14dp"
-              android:textColor="#d9ffffff"
-              android:text="@android:string/singlehandmode_slide_hint_message"
-              android:layout_gravity="center_horizontal"
-              android:gravity="center" />
-    <ImageView
-              android:id="@+id/slide_hint"
-              android:visibility="invisible"
-              android:layout_width="0px"
-              android:layout_height="0px"
-              android:layout_marginTop="12dip"
-              android:background="@android:drawable/singlehandmode_slide_hint" />
- </LinearLayout>
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <RelativeLayout
+        android:id="@+id/relative_top"
+        android:layout_width="match_parent"
+        android:layout_height="0px"
+        android:background="@android:color/black">
+
+        <FrameLayout
+            android:id="@+id/hint_section"
+            android:layout_width="60dp"
+            android:layout_height="70dp"
+            android:clickable="true">
+
+            <ImageView
+                android:id="@+id/hint_info"
+                android:layout_width="24dp"
+                android:layout_height="24dp"
+                android:layout_marginStart="8dp"
+                android:layout_marginTop="16dp"
+                android:background="@android:drawable/singlehandmode_hintinfo"
+                android:clickable="true"
+                android:focusable="true"
+                android:visibility="invisible" />
+        </FrameLayout>
+
+        <TextView
+            android:id="@+id/single_hand_window_title"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginEnd="18dp"
+            android:layout_marginStart="18dp"
+            android:layout_marginTop="32dp"
+            android:gravity="center"
+            android:text="@android:string/singlehandmode_click_hint_message"
+            android:textColor="@android:color/white"
+            android:textSize="14sp"
+            android:visibility="invisible" />
+
+        <ImageView
+            android:id="@+id/click_hint"
+            android:layout_width="32dp"
+            android:layout_height="32dp"
+            android:layout_below="@id/single_hand_window_title"
+            android:layout_centerHorizontal="true"
+            android:layout_marginTop="2dp"
+            android:src="@android:drawable/singlehandmode_click_hint"
+            android:visibility="invisible" />
+    </RelativeLayout>
+
+    <RelativeLayout
+        android:id="@+id/relative_bottom"
+        android:layout_width="0px"
+        android:layout_height="0px"
+        android:background="@color/black" />
+
+    <LinearLayout
+        android:id="@+id/slide_hint_area"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignParentBottom="true"
+        android:orientation="vertical"
+        android:visibility="invisible"/>
 </RelativeLayout>
index 61521a7..03c2641 100644 (file)
 
     <!-- Single hand mode -->
     <string name="singlehandmode_click_hint_message">Touch outside the screen to exit single hand mode</string>
-    <string name="singlehandmode_slide_hint_message">Slide your finger across the navigation bar to toggle single hand mode</string>
 </resources>
index f187867..70e9888 100644 (file)
     <java-symbol type="id" name="click_hint" />
     <java-symbol type="id" name="hint_section" />
     <java-symbol type="id" name="relative_bottom" />
-    <java-symbol type="id" name="singlehandmode_slide_hint_text" />
-    <java-symbol type="id" name="slide_hint" />
     <java-symbol type="id" name="slide_hint_area" />
     <java-symbol type="layout" name="single_hand_window" />
     <java-symbol type="string" name="singlehandmode_click_hint_message" />
-    <java-symbol type="string" name="singlehandmode_slide_hint_message" />
 </resources>
index e7f1a6e..96e031b 100644 (file)
@@ -46,6 +46,7 @@ import android.renderscript.ScriptIntrinsicBlur;
 import android.os.Handler;
 import android.graphics.PixelFormat;
 import android.widget.RelativeLayout;
+import android.view.KeyCharacterMap;
 import android.view.ViewGroup;
 import android.provider.Settings;
 import android.widget.ImageView;
@@ -106,7 +107,6 @@ final class SingleHandWindow {
     private boolean mPointDownOuter = false;
     private ImageView mImageView;
     private TextView overlay_display_window = null;
-    private TextView singlehandmode_slide_hint = null;
     private boolean mAttachedToWindow=false;
     private boolean mIsNeedRelayout=false;
     private boolean mIsBlurTopWindow = false;
@@ -238,9 +238,6 @@ final class SingleHandWindow {
         if (null != overlay_display_window) {
             overlay_display_window.setText(mContext.getResources().getString(com.android.internal.R.string.singlehandmode_click_hint_message));
         }
-        if (null != singlehandmode_slide_hint) {
-            singlehandmode_slide_hint.setText(mContext.getResources().getString(com.android.internal.R.string.singlehandmode_slide_hint_message));
-        }
     }
 
     void updateConfiguration() {
@@ -455,34 +452,6 @@ final class SingleHandWindow {
 
         show(imageView, visible);
 
-        /* put slide_hint in correct place */
-        LinearLayout viewSlideHint = (LinearLayout)mWindowContent.findViewById(com.android.internal.R.id.slide_hint_area);
-        if (null != viewSlideHint) {
-            if (visible) {
-                ViewGroup.LayoutParams layoutParams = viewSlideHint.getLayoutParams();
-                if (mLeft)
-                    ((android.widget.RelativeLayout.LayoutParams)layoutParams).addRule(RelativeLayout.ALIGN_PARENT_LEFT);
-                else
-                    ((android.widget.RelativeLayout.LayoutParams)layoutParams).addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
-                viewSlideHint.setLayoutParams(layoutParams);
-                viewSlideHint.setVisibility(View.VISIBLE);
-            } else {
-                viewSlideHint.setVisibility(View.INVISIBLE);
-            }
-        }
-
-        /* show/hide slide hint */
-        singlehandmode_slide_hint = (TextView)mWindowContent.findViewById(com.android.internal.R.id.singlehandmode_slide_hint_text);
-        show(singlehandmode_slide_hint, visible);
-        imageView = (ImageView) mWindowContent.findViewById(com.android.internal.R.id.slide_hint);
-        if (null != imageView) {
-            LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) imageView.getLayoutParams();
-            params.width = (int)(mDefaultDisplayInfo.logicalWidth * INITIAL_SCALE);
-            params.height = (int)(mContext.getResources().getDimensionPixelSize(com.android.internal.R.dimen.navigation_bar_height) * INITIAL_SCALE);
-            imageView.setLayoutParams(params);
-        }
-        show(imageView, visible);
-
         /* update title, InputFlinger filter click_event depending on title */
         if (visible) {
             mWindowParams.setTitle("SingleMode_windowbg_hint");