OSDN Git Service

Make new color for on screen settings.
authorCheng-Ru Lin <owenlin@google.com>
Thu, 1 Oct 2009 06:02:04 +0000 (14:02 +0800)
committerCheng-Ru Lin <owenlin@google.com>
Thu, 1 Oct 2009 07:56:59 +0000 (15:56 +0800)
And also solve the divider disapear problem.

Change-Id: I2f61ee39eb3e179f7a227e56a5dd677e6f415a2d

res/layout/on_screen_menu.xml
res/layout/on_screen_menu_header.xml
src/com/android/camera/OnScreenSettings.java

index 0aa4d48..3ae6b7a 100644 (file)
         android:layout_width="fill_parent"
         android:layout_height="wrap_content">
     <FrameLayout android:layout_width="fill_parent"
+            android:background="@android:color/black"
             android:layout_height="fill_parent"
             android:layout_toLeftOf="@+id/btn_gripper">
         <ListView android:id="@+id/menu_view"
-                android:cacheColorHint="#00000000"
                 android:layout_width="fill_parent"
                 android:layout_height="fill_parent" />
         <ListView android:id="@+id/sub_menu"
                 android:visibility="invisible"
-                android:cacheColorHint="#00000000"
                 android:layout_width="fill_parent"
                 android:layout_height="fill_parent" />
     </FrameLayout>
index d960419..f16f30e 100644 (file)
@@ -15,7 +15,7 @@
 -->
 <TextView xmlns:android="http://schemas.android.com/apk/res/android"
         android:id="@+id/title"
-        android:background="#88111111"
+        android:background="#222"
         android:paddingLeft="5dp"
         android:paddingRight="5dp"
         android:layout_width="fill_parent"
index a152748..ffd309d 100644 (file)
@@ -309,6 +309,11 @@ public class OnScreenSettings {
                         ? ((ListPreference) preference).getEntry()
                         : override);
                 summary.setEnabled(override == null);
+
+                // A little trick here, making the view focusable will eat
+                // both touch/key events on the view and thus make it looks
+                // like disabled.
+                convertView.setFocusable(override != null);
             }
             return convertView;
         }
@@ -321,9 +326,7 @@ public class OnScreenSettings {
         @Override
         public boolean isEnabled(int position) {
             Preference preference = mPreferences.get(position);
-            if (preference instanceof PreferenceGroup) return false;
-
-            return mOverride.get(preference.getKey()) == null;
+            return !(preference instanceof PreferenceGroup);
         }
 
         public int getCount() {