OSDN Git Service

Fix up QS edit UI
authorJason Monk <jmonk@google.com>
Fri, 17 Mar 2017 14:04:31 +0000 (10:04 -0400)
committerJason Monk <jmonk@google.com>
Fri, 17 Mar 2017 14:15:15 +0000 (10:15 -0400)
Turns out QS Edit mode didn't like the changes to dual target tiles.
Clean this up a bit.

Test: visual
Change-Id: I158fe8dba6729de102cfc592314ec483a969417d

packages/SystemUI/res/layout/qs_tile_label.xml
packages/SystemUI/src/com/android/systemui/qs/customize/CustomizeTileView.java
packages/SystemUI/src/com/android/systemui/qs/customize/TileQueryHelper.java

index e714cd6..9d1fb8f 100644 (file)
@@ -17,7 +17,8 @@
 <RelativeLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="48dp"
+    android:layout_height="wrap_content"
+    android:minHeight="48dp"
     android:paddingTop="8dp">
     <LinearLayout
         android:id="@+id/label_group"
             android:visibility="gone" />
     </LinearLayout>
 
+    <TextView
+        android:id="@+id/app_label"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignStart="@id/label_group"
+        android:layout_alignEnd="@id/label_group"
+        android:layout_below="@id/label_group"
+        android:clickable="false"
+        android:maxLines="1"
+        android:padding="0dp"
+        android:visibility="gone"
+        android:gravity="center"
+        android:textAppearance="@style/TextAppearance.QS.TileLabel"
+        android:textColor="?android:attr/textColorPrimary"/>
+
     <View
         android:id="@+id/underline"
         android:layout_width="30dp"
index 0629d66..b080642 100644 (file)
@@ -35,19 +35,13 @@ public class CustomizeTileView extends QSTileView {
     protected void createLabel() {
         super.createLabel();
         mLabelMinLines = mLabel.getMinLines();
-        View view = LayoutInflater.from(mContext).inflate(R.layout.qs_tile_label, null);
-        mAppLabel = (TextView) view.findViewById(R.id.tile_label);
+        mAppLabel = findViewById(R.id.app_label);
         mAppLabel.setAlpha(.6f);
-        mAppLabel.setSingleLine(true);
-        addView(view);
     }
 
     public void setShowAppLabel(boolean showAppLabel) {
         mAppLabel.setVisibility(showAppLabel ? View.VISIBLE : View.GONE);
         mLabel.setSingleLine(showAppLabel);
-        if (!showAppLabel) {
-            mLabel.setMinLines(mLabelMinLines);
-        }
     }
 
     public void setAppLabel(CharSequence label) {
index 547bef7..2ac592f 100644 (file)
@@ -165,6 +165,7 @@ public class TileQueryHelper {
         }
         TileInfo info = new TileInfo();
         info.state = state;
+        info.state.dualTarget = false; // No dual targets in edit.
         info.state.expandedAccessibilityClassName =
                 Button.class.getName();
         info.spec = spec;