summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChung-yih Wang <cywang@google.com>2010-12-03 01:49:47 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-12-03 01:49:47 -0800
commit1970f8a3a2d03b0d0797ee9faebb2b4499c58beb (patch)
tree2f4b9a4dac5dd3926b4630eba7dec089b1c154ad
parent8a66efdc845a5fdf0750d0fd6a2a92ecbcf77fce (diff)
parent1d12db9c16f57894aee41d004b4e21d684cc269d (diff)
downloadLegacyCamera-1970f8a3a2d03b0d0797ee9faebb2b4499c58beb.zip
LegacyCamera-1970f8a3a2d03b0d0797ee9faebb2b4499c58beb.tar.gz
LegacyCamera-1970f8a3a2d03b0d0797ee9faebb2b4499c58beb.tar.bz2
Merge "Highlight the selected setting in popup windows."
-rw-r--r--res/drawable-hdpi/dialog_bottom_holo_dark.9.pngbin0 -> 5037 bytes
-rw-r--r--res/drawable-hdpi/dialog_top_holo_dark.9.pngbin0 -> 7211 bytes
-rw-r--r--res/drawable-hdpi/setting_picker_pressed.9.pngbin0 -> 152 bytes
-rw-r--r--res/drawable-mdpi/dialog_bottom_holo_dark.9.pngbin0 -> 3303 bytes
-rw-r--r--res/drawable-mdpi/dialog_top_holo_dark.9.pngbin0 -> 4633 bytes
-rw-r--r--res/drawable-mdpi/setting_picker_pressed.9.pngbin0 -> 152 bytes
-rw-r--r--res/drawable/setting_picker.xml21
-rw-r--r--res/layout-xlarge/basic_setting_popup.xml2
-rw-r--r--res/layout-xlarge/other_setting_popup.xml2
-rw-r--r--res/values/styles.xml2
-rw-r--r--src/com/android/camera/ui/AbstractSettingPopup.java19
-rw-r--r--src/com/android/camera/ui/BasicSettingPopup.java6
12 files changed, 30 insertions, 22 deletions
diff --git a/res/drawable-hdpi/dialog_bottom_holo_dark.9.png b/res/drawable-hdpi/dialog_bottom_holo_dark.9.png
new file mode 100644
index 0000000..7e0e30c
--- /dev/null
+++ b/res/drawable-hdpi/dialog_bottom_holo_dark.9.png
Binary files differ
diff --git a/res/drawable-hdpi/dialog_top_holo_dark.9.png b/res/drawable-hdpi/dialog_top_holo_dark.9.png
new file mode 100644
index 0000000..644a3d1
--- /dev/null
+++ b/res/drawable-hdpi/dialog_top_holo_dark.9.png
Binary files differ
diff --git a/res/drawable-hdpi/setting_picker_pressed.9.png b/res/drawable-hdpi/setting_picker_pressed.9.png
new file mode 100644
index 0000000..806fe28
--- /dev/null
+++ b/res/drawable-hdpi/setting_picker_pressed.9.png
Binary files differ
diff --git a/res/drawable-mdpi/dialog_bottom_holo_dark.9.png b/res/drawable-mdpi/dialog_bottom_holo_dark.9.png
new file mode 100644
index 0000000..1ada4d3
--- /dev/null
+++ b/res/drawable-mdpi/dialog_bottom_holo_dark.9.png
Binary files differ
diff --git a/res/drawable-mdpi/dialog_top_holo_dark.9.png b/res/drawable-mdpi/dialog_top_holo_dark.9.png
new file mode 100644
index 0000000..3cd7eb8
--- /dev/null
+++ b/res/drawable-mdpi/dialog_top_holo_dark.9.png
Binary files differ
diff --git a/res/drawable-mdpi/setting_picker_pressed.9.png b/res/drawable-mdpi/setting_picker_pressed.9.png
new file mode 100644
index 0000000..806fe28
--- /dev/null
+++ b/res/drawable-mdpi/setting_picker_pressed.9.png
Binary files differ
diff --git a/res/drawable/setting_picker.xml b/res/drawable/setting_picker.xml
new file mode 100644
index 0000000..60ece1d
--- /dev/null
+++ b/res/drawable/setting_picker.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 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.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_pressed="true"
+ android:drawable="@drawable/setting_picker_pressed" />
+ <item android:drawable="@android:color/transparent" />
+</selector>
diff --git a/res/layout-xlarge/basic_setting_popup.xml b/res/layout-xlarge/basic_setting_popup.xml
index 6c3c1d7..c1708b9 100644
--- a/res/layout-xlarge/basic_setting_popup.xml
+++ b/res/layout-xlarge/basic_setting_popup.xml
@@ -28,6 +28,7 @@
<FrameLayout android:id="@+id/topPanel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:background="@drawable/dialog_top_holo_dark"
android:minHeight="48dip">
<TextView android:id="@+id/title"
android:layout_width="wrap_content"
@@ -41,5 +42,6 @@
<LinearLayout android:id="@+id/contentPanel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:background="@drawable/dialog_bottom_holo_dark"
android:orientation="vertical" />
</com.android.camera.ui.BasicSettingPopup>
diff --git a/res/layout-xlarge/other_setting_popup.xml b/res/layout-xlarge/other_setting_popup.xml
index ad55344..3927e3d 100644
--- a/res/layout-xlarge/other_setting_popup.xml
+++ b/res/layout-xlarge/other_setting_popup.xml
@@ -30,6 +30,7 @@
<FrameLayout android:id="@+id/topPanel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:background="@drawable/dialog_top_holo_dark"
android:minHeight="48dip">
<TextView android:id="@+id/title"
android:text="@string/pref_camera_settings_category"
@@ -45,6 +46,7 @@
<LinearLayout android:id="@+id/contentPanel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:background="@drawable/dialog_bottom_holo_dark"
android:orientation="vertical">
<com.android.camera.ui.InLineSettingPicker camera:prefKey="pref_camera_recordlocation_key"
style="@style/SettingRow" />
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 0fa707b..0d0634f 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -80,10 +80,12 @@
</style>
<style name="SettingRow">
<item name="android:layout_marginLeft">16dp</item>
+ <item name="android:layout_marginRight">16dp</item>
<item name="android:gravity">center_vertical</item>
<item name="android:orientation">horizontal</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">55dp</item>
+ <item name="android:background">@drawable/setting_picker</item>
</style>
<style name="OnScreenGpsIndicator">
<item name="android:layout_height">wrap_content</item>
diff --git a/src/com/android/camera/ui/AbstractSettingPopup.java b/src/com/android/camera/ui/AbstractSettingPopup.java
index 314dcab..f82e98b 100644
--- a/src/com/android/camera/ui/AbstractSettingPopup.java
+++ b/src/com/android/camera/ui/AbstractSettingPopup.java
@@ -42,25 +42,6 @@ abstract public class AbstractSettingPopup extends LinearLayout {
super.onFinishInflate();
mTitle = (TextView) findViewById(R.id.title);
- View topPanel = findViewById(R.id.topPanel);
mContentPanel = (ViewGroup) findViewById(R.id.contentPanel);
-
- // Use system holo background for now.
- // TODO: We need to add alpha to the background.
- Context context = getContext();
- Theme dialogTheme = context.getResources().newTheme();
- dialogTheme.applyStyle(android.R.style.Theme_Holo, true);
- TypedArray ta = dialogTheme.obtainStyledAttributes(new int[] {
- android.R.attr.alertDialogStyle });
- int resourceId = ta.getResourceId(0, 0);
- TypedArray ta2 = context.obtainStyledAttributes(resourceId, new int[] {
- android.R.attr.topDark,
- android.R.attr.bottomDark});
-
- topPanel.setBackgroundDrawable(ta2.getDrawable(0));
- mContentPanel.setBackgroundDrawable(ta2.getDrawable(1));
-
- ta.recycle();
- ta2.recycle();
}
}
diff --git a/src/com/android/camera/ui/BasicSettingPopup.java b/src/com/android/camera/ui/BasicSettingPopup.java
index f0636a1..2f84caa 100644
--- a/src/com/android/camera/ui/BasicSettingPopup.java
+++ b/src/com/android/camera/ui/BasicSettingPopup.java
@@ -76,7 +76,7 @@ public class BasicSettingPopup extends AbstractSettingPopup implements
TextView text = (TextView) row.findViewById(R.id.text);
text.setText(entries[i].toString());
text.setClickable(false);
- if (index == i) text.setPressed(true);
+ row.setPressed(index == i);
// Initialize the icon.
if (iconIds != null) {
@@ -113,8 +113,8 @@ public class BasicSettingPopup extends AbstractSettingPopup implements
int oldIndex = mPreference.findIndexOfValue(mPreference.getValue());
if (oldIndex != i) {
View oldRow = group.getChildAt(oldIndex);
- oldRow.findViewById(R.id.text).setPressed(false);
- child.findViewById(R.id.text).setPressed(true);
+ oldRow.setPressed(false);
+ child.setPressed(true);
mPreference.setValueIndex(i);
if (mListener != null) {
mListener.onSettingChanged();