OSDN Git Service

Fix second level menu
authorMichael Kolb <kolby@google.com>
Wed, 8 May 2013 18:14:35 +0000 (11:14 -0700)
committerMichael Kolb <kolby@google.com>
Wed, 8 May 2013 21:17:25 +0000 (14:17 -0700)
  Bug: 8857098

Added Countdown timer and picture size items

Change-Id: I73f3a5b22ab708e216729ed77fbd60041d40147d

45 files changed:
res/drawable-hdpi/ic_exposure_holo_light_large.png [deleted file]
res/drawable-hdpi/ic_exposure_holo_light_xlarge.png [deleted file]
res/drawable-hdpi/ic_flash_auto_holo_light_large.png [deleted file]
res/drawable-hdpi/ic_flash_auto_holo_light_xlarge.png [deleted file]
res/drawable-hdpi/ic_flash_off_holo_light_large.png [deleted file]
res/drawable-hdpi/ic_flash_off_holo_light_xlarge.png [deleted file]
res/drawable-hdpi/ic_flash_on_holo_light_large.png [deleted file]
res/drawable-hdpi/ic_flash_on_holo_light_xlarge.png [deleted file]
res/drawable-hdpi/ic_imagesize.png [new file with mode: 0644]
res/drawable-hdpi/ic_indicator_sce_hdr.png
res/drawable-hdpi/ic_indicator_sce_off.png
res/drawable-hdpi/ic_indicator_sce_on.png
res/drawable-hdpi/ic_settings_holo_light_large.png [deleted file]
res/drawable-hdpi/ic_settings_holo_light_xlarge.png [deleted file]
res/drawable-hdpi/ic_timer.png [new file with mode: 0644]
res/drawable-mdpi/ic_exposure_holo_light_xlarge.png [deleted file]
res/drawable-mdpi/ic_flash_auto_holo_light_xlarge.png [deleted file]
res/drawable-mdpi/ic_flash_off_holo_light_xlarge.png [deleted file]
res/drawable-mdpi/ic_flash_on_holo_light_xlarge.png [deleted file]
res/drawable-mdpi/ic_imagesize.png [new file with mode: 0644]
res/drawable-mdpi/ic_indicator_sce_hdr.png
res/drawable-mdpi/ic_indicator_sce_off.png
res/drawable-mdpi/ic_indicator_sce_on.png
res/drawable-mdpi/ic_settings_holo_light_xlarge.png [deleted file]
res/drawable-mdpi/ic_timer.png [new file with mode: 0644]
res/drawable-xhdpi/ic_exposure_holo_light_xlarge.png [deleted file]
res/drawable-xhdpi/ic_flash_auto_holo_light_xlarge.png [deleted file]
res/drawable-xhdpi/ic_flash_off_holo_light_xlarge.png [deleted file]
res/drawable-xhdpi/ic_flash_on_holo_light_xlarge.png [deleted file]
res/drawable-xhdpi/ic_imagesize.png [new file with mode: 0644]
res/drawable-xhdpi/ic_indicator_sce_hdr.png
res/drawable-xhdpi/ic_indicator_sce_off.png
res/drawable-xhdpi/ic_indicator_sce_on.png
res/drawable-xhdpi/ic_settings_holo_light_xlarge.png [deleted file]
res/drawable-xhdpi/ic_timer.png [new file with mode: 0644]
res/layout/countdown_setting_popup.xml [new file with mode: 0644]
res/layout/timer_setting_popup.xml [deleted file]
res/values-large-hdpi/drawable.xml
res/values-sw600dp-hdpi/drawable.xml
res/values-sw640dp/drawable.xml
res/values-xlarge/drawable.xml
src/com/android/camera/CountDownTimerPreference.java
src/com/android/camera/PhotoMenu.java
src/com/android/camera/PhotoUI.java
src/com/android/camera/ui/CountdownTimerPopup.java [moved from src/com/android/camera/ui/TimerSettingPopup.java with 58% similarity]

diff --git a/res/drawable-hdpi/ic_exposure_holo_light_large.png b/res/drawable-hdpi/ic_exposure_holo_light_large.png
deleted file mode 100644 (file)
index ee45cfc..0000000
Binary files a/res/drawable-hdpi/ic_exposure_holo_light_large.png and /dev/null differ
diff --git a/res/drawable-hdpi/ic_exposure_holo_light_xlarge.png b/res/drawable-hdpi/ic_exposure_holo_light_xlarge.png
deleted file mode 100644 (file)
index ee45cfc..0000000
Binary files a/res/drawable-hdpi/ic_exposure_holo_light_xlarge.png and /dev/null differ
diff --git a/res/drawable-hdpi/ic_flash_auto_holo_light_large.png b/res/drawable-hdpi/ic_flash_auto_holo_light_large.png
deleted file mode 100644 (file)
index 00caf1b..0000000
Binary files a/res/drawable-hdpi/ic_flash_auto_holo_light_large.png and /dev/null differ
diff --git a/res/drawable-hdpi/ic_flash_auto_holo_light_xlarge.png b/res/drawable-hdpi/ic_flash_auto_holo_light_xlarge.png
deleted file mode 100644 (file)
index 00caf1b..0000000
Binary files a/res/drawable-hdpi/ic_flash_auto_holo_light_xlarge.png and /dev/null differ
diff --git a/res/drawable-hdpi/ic_flash_off_holo_light_large.png b/res/drawable-hdpi/ic_flash_off_holo_light_large.png
deleted file mode 100644 (file)
index 353df48..0000000
Binary files a/res/drawable-hdpi/ic_flash_off_holo_light_large.png and /dev/null differ
diff --git a/res/drawable-hdpi/ic_flash_off_holo_light_xlarge.png b/res/drawable-hdpi/ic_flash_off_holo_light_xlarge.png
deleted file mode 100644 (file)
index 353df48..0000000
Binary files a/res/drawable-hdpi/ic_flash_off_holo_light_xlarge.png and /dev/null differ
diff --git a/res/drawable-hdpi/ic_flash_on_holo_light_large.png b/res/drawable-hdpi/ic_flash_on_holo_light_large.png
deleted file mode 100644 (file)
index b508318..0000000
Binary files a/res/drawable-hdpi/ic_flash_on_holo_light_large.png and /dev/null differ
diff --git a/res/drawable-hdpi/ic_flash_on_holo_light_xlarge.png b/res/drawable-hdpi/ic_flash_on_holo_light_xlarge.png
deleted file mode 100644 (file)
index b508318..0000000
Binary files a/res/drawable-hdpi/ic_flash_on_holo_light_xlarge.png and /dev/null differ
diff --git a/res/drawable-hdpi/ic_imagesize.png b/res/drawable-hdpi/ic_imagesize.png
new file mode 100644 (file)
index 0000000..126208b
Binary files /dev/null and b/res/drawable-hdpi/ic_imagesize.png differ
index de09fe1..0b8fdfa 100644 (file)
Binary files a/res/drawable-hdpi/ic_indicator_sce_hdr.png and b/res/drawable-hdpi/ic_indicator_sce_hdr.png differ
index 076d823..09bd2c8 100644 (file)
Binary files a/res/drawable-hdpi/ic_indicator_sce_off.png and b/res/drawable-hdpi/ic_indicator_sce_off.png differ
index 9ce466b..ef0f56f 100644 (file)
Binary files a/res/drawable-hdpi/ic_indicator_sce_on.png and b/res/drawable-hdpi/ic_indicator_sce_on.png differ
diff --git a/res/drawable-hdpi/ic_settings_holo_light_large.png b/res/drawable-hdpi/ic_settings_holo_light_large.png
deleted file mode 100644 (file)
index 13c9991..0000000
Binary files a/res/drawable-hdpi/ic_settings_holo_light_large.png and /dev/null differ
diff --git a/res/drawable-hdpi/ic_settings_holo_light_xlarge.png b/res/drawable-hdpi/ic_settings_holo_light_xlarge.png
deleted file mode 100644 (file)
index 13c9991..0000000
Binary files a/res/drawable-hdpi/ic_settings_holo_light_xlarge.png and /dev/null differ
diff --git a/res/drawable-hdpi/ic_timer.png b/res/drawable-hdpi/ic_timer.png
new file mode 100644 (file)
index 0000000..a3cec8d
Binary files /dev/null and b/res/drawable-hdpi/ic_timer.png differ
diff --git a/res/drawable-mdpi/ic_exposure_holo_light_xlarge.png b/res/drawable-mdpi/ic_exposure_holo_light_xlarge.png
deleted file mode 100644 (file)
index 4f4cc74..0000000
Binary files a/res/drawable-mdpi/ic_exposure_holo_light_xlarge.png and /dev/null differ
diff --git a/res/drawable-mdpi/ic_flash_auto_holo_light_xlarge.png b/res/drawable-mdpi/ic_flash_auto_holo_light_xlarge.png
deleted file mode 100644 (file)
index 7dacd20..0000000
Binary files a/res/drawable-mdpi/ic_flash_auto_holo_light_xlarge.png and /dev/null differ
diff --git a/res/drawable-mdpi/ic_flash_off_holo_light_xlarge.png b/res/drawable-mdpi/ic_flash_off_holo_light_xlarge.png
deleted file mode 100644 (file)
index 30b51a5..0000000
Binary files a/res/drawable-mdpi/ic_flash_off_holo_light_xlarge.png and /dev/null differ
diff --git a/res/drawable-mdpi/ic_flash_on_holo_light_xlarge.png b/res/drawable-mdpi/ic_flash_on_holo_light_xlarge.png
deleted file mode 100644 (file)
index 7bc6963..0000000
Binary files a/res/drawable-mdpi/ic_flash_on_holo_light_xlarge.png and /dev/null differ
diff --git a/res/drawable-mdpi/ic_imagesize.png b/res/drawable-mdpi/ic_imagesize.png
new file mode 100644 (file)
index 0000000..d3f8b62
Binary files /dev/null and b/res/drawable-mdpi/ic_imagesize.png differ
index 0651941..7907f64 100644 (file)
Binary files a/res/drawable-mdpi/ic_indicator_sce_hdr.png and b/res/drawable-mdpi/ic_indicator_sce_hdr.png differ
index 52ad713..4bfd91a 100644 (file)
Binary files a/res/drawable-mdpi/ic_indicator_sce_off.png and b/res/drawable-mdpi/ic_indicator_sce_off.png differ
index 510c39f..6ea6d77 100644 (file)
Binary files a/res/drawable-mdpi/ic_indicator_sce_on.png and b/res/drawable-mdpi/ic_indicator_sce_on.png differ
diff --git a/res/drawable-mdpi/ic_settings_holo_light_xlarge.png b/res/drawable-mdpi/ic_settings_holo_light_xlarge.png
deleted file mode 100644 (file)
index 2b89fef..0000000
Binary files a/res/drawable-mdpi/ic_settings_holo_light_xlarge.png and /dev/null differ
diff --git a/res/drawable-mdpi/ic_timer.png b/res/drawable-mdpi/ic_timer.png
new file mode 100644 (file)
index 0000000..b55555f
Binary files /dev/null and b/res/drawable-mdpi/ic_timer.png differ
diff --git a/res/drawable-xhdpi/ic_exposure_holo_light_xlarge.png b/res/drawable-xhdpi/ic_exposure_holo_light_xlarge.png
deleted file mode 100644 (file)
index ed73752..0000000
Binary files a/res/drawable-xhdpi/ic_exposure_holo_light_xlarge.png and /dev/null differ
diff --git a/res/drawable-xhdpi/ic_flash_auto_holo_light_xlarge.png b/res/drawable-xhdpi/ic_flash_auto_holo_light_xlarge.png
deleted file mode 100644 (file)
index 915f4a5..0000000
Binary files a/res/drawable-xhdpi/ic_flash_auto_holo_light_xlarge.png and /dev/null differ
diff --git a/res/drawable-xhdpi/ic_flash_off_holo_light_xlarge.png b/res/drawable-xhdpi/ic_flash_off_holo_light_xlarge.png
deleted file mode 100644 (file)
index f34e5a9..0000000
Binary files a/res/drawable-xhdpi/ic_flash_off_holo_light_xlarge.png and /dev/null differ
diff --git a/res/drawable-xhdpi/ic_flash_on_holo_light_xlarge.png b/res/drawable-xhdpi/ic_flash_on_holo_light_xlarge.png
deleted file mode 100644 (file)
index b1dbbc0..0000000
Binary files a/res/drawable-xhdpi/ic_flash_on_holo_light_xlarge.png and /dev/null differ
diff --git a/res/drawable-xhdpi/ic_imagesize.png b/res/drawable-xhdpi/ic_imagesize.png
new file mode 100644 (file)
index 0000000..54fd008
Binary files /dev/null and b/res/drawable-xhdpi/ic_imagesize.png differ
index b60abb3..318c8fa 100644 (file)
Binary files a/res/drawable-xhdpi/ic_indicator_sce_hdr.png and b/res/drawable-xhdpi/ic_indicator_sce_hdr.png differ
index aad8cf8..429d6ec 100644 (file)
Binary files a/res/drawable-xhdpi/ic_indicator_sce_off.png and b/res/drawable-xhdpi/ic_indicator_sce_off.png differ
index 39cfa4b..8b2440c 100644 (file)
Binary files a/res/drawable-xhdpi/ic_indicator_sce_on.png and b/res/drawable-xhdpi/ic_indicator_sce_on.png differ
diff --git a/res/drawable-xhdpi/ic_settings_holo_light_xlarge.png b/res/drawable-xhdpi/ic_settings_holo_light_xlarge.png
deleted file mode 100644 (file)
index 9fa8f72..0000000
Binary files a/res/drawable-xhdpi/ic_settings_holo_light_xlarge.png and /dev/null differ
diff --git a/res/drawable-xhdpi/ic_timer.png b/res/drawable-xhdpi/ic_timer.png
new file mode 100644 (file)
index 0000000..1764fdd
Binary files /dev/null and b/res/drawable-xhdpi/ic_timer.png differ
diff --git a/res/layout/countdown_setting_popup.xml b/res/layout/countdown_setting_popup.xml
new file mode 100644 (file)
index 0000000..22acd92
--- /dev/null
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (c) 2013, 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.
+-->
+
+<com.android.camera.ui.CountdownTimerPopup xmlns:android="http://schemas.android.com/apk/res/android"
+        style="@style/SettingPopupWindow">
+
+    <LinearLayout android:orientation="vertical"
+            android:background="@color/popup_background"
+            android:layout_height="wrap_content"
+            android:layout_width="@dimen/big_setting_popup_window_width">
+
+    <TextView
+            android:id="@+id/title"
+            style="@style/PopupTitleText"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:ellipsize="end"
+            android:gravity="center_vertical|center_horizontal"
+            android:minHeight="@dimen/popup_title_frame_min_height" />
+
+    <View style="@style/PopupTitleSeparator" />
+
+    <LinearLayout
+            android:id="@+id/time_duration_picker"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center_horizontal"
+            android:orientation="vertical" >
+
+            <TextView
+                android:id="@+id/set_time_interval_title"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:gravity="center"
+                android:paddingTop="5dip"
+                android:text="@string/set_duration"
+                android:textAppearance="?android:attr/textAppearanceMedium" />
+            <!-- A number picker to set timer -->
+
+            <NumberPicker
+                android:id="@+id/duration"
+                android:layout_width="160dp"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center_horizontal"
+                android:layout_marginLeft="16dip"
+                android:layout_marginRight="16dip"
+                android:focusable="false" />
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical" >
+
+            <View
+                android:background="#40ffffff"
+                android:layout_width="match_parent"
+                android:layout_height="1dip" />
+            <LinearLayout
+                android:id="@+id/timer_sound"
+                style="@style/SettingRow" >
+
+                <TextView android:id="@+id/beep_title"
+                    style="@style/SettingItemTitle"
+                    android:text="@string/pref_camera_timer_sound_title" />
+
+                <CheckBox android:id="@+id/sound_check_box"
+                    android:layout_gravity="center_vertical|right"
+                    android:layout_width="wrap_content"
+                    android:layout_height="match_parent" />
+            </LinearLayout>
+
+            <View
+                android:background="#40ffffff"
+                android:layout_width="match_parent"
+                android:layout_height="1dip" />
+
+            <Button
+                android:id="@+id/timer_set_button"
+                style="?android:attr/buttonBarButtonStyle"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center_horizontal"
+                android:text="@string/time_lapse_interval_set"
+                android:textAppearance="?android:attr/textAppearanceMedium" />
+        </LinearLayout>
+    </LinearLayout>
+</com.android.camera.ui.CountdownTimerPopup>
diff --git a/res/layout/timer_setting_popup.xml b/res/layout/timer_setting_popup.xml
deleted file mode 100644 (file)
index d6e8000..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (c) 2013, 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.
--->
-
-<com.android.camera.ui.TimerSettingPopup xmlns:android="http://schemas.android.com/apk/res/android"
-        style="@style/SettingPopupWindow">
-
-    <LinearLayout android:orientation="vertical"
-            android:background="@color/popup_background"
-            android:layout_height="wrap_content"
-            android:layout_width="@dimen/big_setting_popup_window_width">
-
-        <LinearLayout android:orientation="horizontal"
-                android:layout_height="wrap_content"
-                android:layout_width="match_parent">
-            <TextView
-                    android:id="@+id/title"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:ellipsize="end"
-                    android:layout_weight="1"
-                    android:minHeight="@dimen/popup_title_frame_min_height"
-                    android:gravity="center_vertical"
-                    style="@style/PopupTitleText" />
-            <Switch
-                    android:id="@+id/timer_setting_switch"
-                    android:layout_width="wrap_content"
-                    android:layout_height="match_parent"
-                    android:layout_weight="0"
-                    android:layout_marginRight="8dp"
-                    android:layout_gravity="right|center_vertical" />
-        </LinearLayout>
-
-        <View style="@style/PopupTitleSeparator" />
-
-        <TextView
-                android:id="@+id/set_timer_help_text"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:paddingTop="16dip"
-                android:paddingLeft="16dip"
-                android:paddingRight="16dip"
-                android:paddingBottom="16dip"
-                android:textAppearance="?android:attr/textAppearanceMedium"
-                android:text="@string/set_timer_help"/>
-
-        <LinearLayout
-                android:id="@+id/time_duration_picker"
-                android:orientation="vertical"
-                android:layout_gravity="center_horizontal"
-                android:layout_height="wrap_content"
-                android:layout_width="match_parent">
-            <TextView
-                    android:id="@+id/set_time_interval_title"
-                    android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:paddingTop="5dip"
-                    android:gravity="center"
-                    android:textAppearance="?android:attr/textAppearanceMedium"
-                    android:text="@string/set_duration"/>
-            <!-- A number picker to set timer -->
-            <NumberPicker
-                    android:id="@+id/duration"
-                    android:layout_width="160dp"
-                    android:layout_height="wrap_content"
-                    android:layout_marginLeft="16dip"
-                    android:layout_marginRight="16dip"
-                    android:layout_gravity="center_horizontal"
-                    android:focusable="false" />
-        </LinearLayout>
-
-        <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:orientation="vertical"
-                android:divider="?android:attr/dividerHorizontal"
-                android:showDividers="beginning"
-                android:dividerPadding="0dip">
-            <Button android:id="@+id/timer_set_button"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:layout_gravity="center_horizontal"
-                    android:textAppearance="?android:attr/textAppearanceMedium"
-                    style="?android:attr/buttonBarButtonStyle"
-                    android:text="@string/time_lapse_interval_set" />
-        </LinearLayout>
-    </LinearLayout>
-
-</com.android.camera.ui.TimerSettingPopup>
index 119ab1d..b810347 100644 (file)
     <item name="btn_video_shutter_recording_holo" type="drawable">@drawable/btn_video_shutter_recording_holo_large</item>
     <item name="btn_video_shutter_recording_pressed_holo" type="drawable">@drawable/btn_video_shutter_recording_pressed_holo_large</item>
     <item name="ic_effects_holo_light" type="drawable">@drawable/ic_effects_holo_light_large</item>
-    <item name="ic_exposure_holo_light" type="drawable">@drawable/ic_exposure_holo_light_large</item>
-    <item name="ic_flash_auto_holo_light" type="drawable">@drawable/ic_flash_auto_holo_light_large</item>
-    <item name="ic_flash_off_holo_light" type="drawable">@drawable/ic_flash_off_holo_light_large</item>
-    <item name="ic_flash_on_holo_light" type="drawable">@drawable/ic_flash_on_holo_light_large</item>
     <item name="ic_pan_border_fast" type="drawable">@drawable/ic_pan_border_fast_large</item>
     <item name="ic_pan_left_indicator_fast" type="drawable">@drawable/ic_pan_left_indicator_fast_large</item>
     <item name="ic_pan_left_indicator" type="drawable">@drawable/ic_pan_left_indicator_large</item>
@@ -28,7 +24,6 @@
     <item name="ic_pan_right_indicator_fast" type="drawable">@drawable/ic_pan_right_indicator_fast_large</item>
     <item name="ic_pan_right_indicator" type="drawable">@drawable/ic_pan_right_indicator_large</item>
     <item name="ic_scn_holo_light" type="drawable">@drawable/ic_scn_holo_light_large</item>
-    <item name="ic_settings_holo_light" type="drawable">@drawable/ic_settings_holo_light_large</item>
     <item name="ic_snapshot_border" type="drawable">@drawable/ic_snapshot_border_large</item>
     <item name="ic_switch_photo_facing_holo_light" type="drawable">@drawable/ic_switch_photo_facing_holo_light_large</item>
     <item name="ic_switch_video_facing_holo_light" type="drawable">@drawable/ic_switch_video_facing_holo_light_large</item>
index 119ab1d..b810347 100644 (file)
     <item name="btn_video_shutter_recording_holo" type="drawable">@drawable/btn_video_shutter_recording_holo_large</item>
     <item name="btn_video_shutter_recording_pressed_holo" type="drawable">@drawable/btn_video_shutter_recording_pressed_holo_large</item>
     <item name="ic_effects_holo_light" type="drawable">@drawable/ic_effects_holo_light_large</item>
-    <item name="ic_exposure_holo_light" type="drawable">@drawable/ic_exposure_holo_light_large</item>
-    <item name="ic_flash_auto_holo_light" type="drawable">@drawable/ic_flash_auto_holo_light_large</item>
-    <item name="ic_flash_off_holo_light" type="drawable">@drawable/ic_flash_off_holo_light_large</item>
-    <item name="ic_flash_on_holo_light" type="drawable">@drawable/ic_flash_on_holo_light_large</item>
     <item name="ic_pan_border_fast" type="drawable">@drawable/ic_pan_border_fast_large</item>
     <item name="ic_pan_left_indicator_fast" type="drawable">@drawable/ic_pan_left_indicator_fast_large</item>
     <item name="ic_pan_left_indicator" type="drawable">@drawable/ic_pan_left_indicator_large</item>
@@ -28,7 +24,6 @@
     <item name="ic_pan_right_indicator_fast" type="drawable">@drawable/ic_pan_right_indicator_fast_large</item>
     <item name="ic_pan_right_indicator" type="drawable">@drawable/ic_pan_right_indicator_large</item>
     <item name="ic_scn_holo_light" type="drawable">@drawable/ic_scn_holo_light_large</item>
-    <item name="ic_settings_holo_light" type="drawable">@drawable/ic_settings_holo_light_large</item>
     <item name="ic_snapshot_border" type="drawable">@drawable/ic_snapshot_border_large</item>
     <item name="ic_switch_photo_facing_holo_light" type="drawable">@drawable/ic_switch_photo_facing_holo_light_large</item>
     <item name="ic_switch_video_facing_holo_light" type="drawable">@drawable/ic_switch_video_facing_holo_light_large</item>
index 77d453c..6a6e711 100644 (file)
     <item name="btn_video_shutter_recording_holo" type="drawable">@drawable/btn_video_shutter_recording_holo_xlarge</item>
     <item name="btn_video_shutter_recording_pressed_holo" type="drawable">@drawable/btn_video_shutter_recording_pressed_holo_xlarge</item>
     <item name="ic_effects_holo_light" type="drawable">@drawable/ic_effects_holo_light_xlarge</item>
-    <item name="ic_exposure_holo_light" type="drawable">@drawable/ic_exposure_holo_light_xlarge</item>
-    <item name="ic_flash_auto_holo_light" type="drawable">@drawable/ic_flash_auto_holo_light_xlarge</item>
-    <item name="ic_flash_off_holo_light" type="drawable">@drawable/ic_flash_off_holo_light_xlarge</item>
-    <item name="ic_flash_on_holo_light" type="drawable">@drawable/ic_flash_on_holo_light_xlarge</item>
     <item name="ic_pan_border_fast" type="drawable">@drawable/ic_pan_border_fast_xlarge</item>
     <item name="ic_pan_left_indicator_fast" type="drawable">@drawable/ic_pan_left_indicator_fast_xlarge</item>
     <item name="ic_pan_left_indicator" type="drawable">@drawable/ic_pan_left_indicator_xlarge</item>
@@ -28,7 +24,6 @@
     <item name="ic_pan_right_indicator_fast" type="drawable">@drawable/ic_pan_right_indicator_fast_xlarge</item>
     <item name="ic_pan_right_indicator" type="drawable">@drawable/ic_pan_right_indicator_xlarge</item>
     <item name="ic_scn_holo_light" type="drawable">@drawable/ic_scn_holo_light_xlarge</item>
-    <item name="ic_settings_holo_light" type="drawable">@drawable/ic_settings_holo_light_xlarge</item>
     <item name="ic_snapshot_border" type="drawable">@drawable/ic_snapshot_border_xlarge</item>
     <item name="ic_switch_photo_facing_holo_light" type="drawable">@drawable/ic_switch_photo_facing_holo_light_xlarge</item>
     <item name="ic_switch_video_facing_holo_light" type="drawable">@drawable/ic_switch_video_facing_holo_light_xlarge</item>
index 48436c0..648f1d7 100644 (file)
 -->
 <resources>
     <item name="ic_effects_holo_light" type="drawable">@drawable/ic_effects_holo_light_xlarge</item>
-    <item name="ic_exposure_holo_light" type="drawable">@drawable/ic_exposure_holo_light_xlarge</item>
-    <item name="ic_flash_auto_holo_light" type="drawable">@drawable/ic_flash_auto_holo_light_xlarge</item>
-    <item name="ic_flash_off_holo_light" type="drawable">@drawable/ic_flash_off_holo_light_xlarge</item>
-    <item name="ic_flash_on_holo_light" type="drawable">@drawable/ic_flash_on_holo_light_xlarge</item>
     <item name="ic_pan_border_fast" type="drawable">@drawable/ic_pan_border_fast_xlarge</item>
     <item name="ic_pan_left_indicator_fast" type="drawable">@drawable/ic_pan_left_indicator_fast_xlarge</item>
     <item name="ic_pan_left_indicator" type="drawable">@drawable/ic_pan_left_indicator_xlarge</item>
@@ -26,7 +22,6 @@
     <item name="ic_pan_right_indicator_fast" type="drawable">@drawable/ic_pan_right_indicator_fast_xlarge</item>
     <item name="ic_pan_right_indicator" type="drawable">@drawable/ic_pan_right_indicator_xlarge</item>
     <item name="ic_scn_holo_light" type="drawable">@drawable/ic_scn_holo_light_xlarge</item>
-    <item name="ic_settings_holo_light" type="drawable">@drawable/ic_settings_holo_light_xlarge</item>
     <item name="ic_snapshot_border" type="drawable">@drawable/ic_snapshot_border_xlarge</item>
     <item name="ic_switch_photo_facing_holo_light" type="drawable">@drawable/ic_switch_photo_facing_holo_light_xlarge</item>
     <item name="ic_switch_video_facing_holo_light" type="drawable">@drawable/ic_switch_video_facing_holo_light_xlarge</item>
index 0bbf6bc..9c66dda 100644 (file)
@@ -21,25 +21,20 @@ import android.util.AttributeSet;
 
 import com.android.gallery3d.R;
 
-import java.util.List;
-
-/* CountDownTimerPreference generates entries (i.e. what users see in the UI),
- * and entry values (the actual value recorded in preference) in
- * initCountDownTimeChoices(Context context), rather than reading the entries
- * from a predefined list. When the entry values are a continuous list of numbers,
- * (e.g. 0-60), it is more efficient to auto generate the list than to predefine it.*/
 public class CountDownTimerPreference extends ListPreference {
-    private final static int MAX_DURATION = 60;
+    private static final int[] DURATIONS = {
+        0, 1, 2, 3, 4, 5, 10, 15, 20, 30, 60
+    };
     public CountDownTimerPreference(Context context, AttributeSet attrs) {
         super(context, attrs);
         initCountDownDurationChoices(context);
     }
 
     private void initCountDownDurationChoices(Context context) {
-        CharSequence[] entryValues = new CharSequence[MAX_DURATION + 1];
-        CharSequence[] entries = new CharSequence[MAX_DURATION + 1];
-        for (int i = 0; i <= MAX_DURATION; i++) {
-            entryValues[i] = Integer.toString(i);
+        CharSequence[] entryValues = new CharSequence[DURATIONS.length];
+        CharSequence[] entries = new CharSequence[DURATIONS.length];
+        for (int i = 0; i < DURATIONS.length; i++) {
+            entryValues[i] = Integer.toString(DURATIONS[i]);
             if (i == 0) {
                 entries[0] = context.getString(R.string.setting_off); // Off
             } else {
index f29ed4a..d0f21ed 100644 (file)
 
 package com.android.camera;
 
-import android.content.Context;
 import android.content.res.Resources;
 import android.hardware.Camera.Parameters;
-import android.view.LayoutInflater;
 
 import com.android.camera.ui.AbstractSettingPopup;
+import com.android.camera.ui.CountdownTimerPopup;
 import com.android.camera.ui.ListPrefSettingPopup;
-import com.android.camera.ui.MoreSettingPopup;
 import com.android.camera.ui.PieItem;
 import com.android.camera.ui.PieItem.OnClickListener;
 import com.android.camera.ui.PieRenderer;
-import com.android.camera.ui.TimerSettingPopup;
 import com.android.gallery3d.R;
 
+import java.util.Locale;
+
 public class PhotoMenu extends PieController
-        implements MoreSettingPopup.Listener,
-        TimerSettingPopup.Listener,
+        implements CountdownTimerPopup.Listener,
         ListPrefSettingPopup.Listener {
     private static String TAG = "CAM_photomenu";
 
     private final String mSettingOff;
 
     private PhotoUI mUI;
-    private String[] mOtherKeys;
-    // First level popup
-    private MoreSettingPopup mPopup;
-    // Second level popup
-    private AbstractSettingPopup mSecondPopup;
+    private AbstractSettingPopup mPopup;
     private CameraActivity mActivity;
 
     public PhotoMenu(CameraActivity activity, PhotoUI ui, PieRenderer pie) {
@@ -56,9 +50,9 @@ public class PhotoMenu extends PieController
     public void initialize(PreferenceGroup group) {
         super.initialize(group);
         mPopup = null;
-        mSecondPopup = null;
         PieItem item = null;
         final Resources res = mActivity.getResources();
+        Locale locale = res.getConfiguration().locale;
         // the order is from left to right in the menu
 
         // hdr
@@ -108,22 +102,42 @@ public class PhotoMenu extends PieController
         if (group.findPreference(CameraSettings.KEY_RECORD_LOCATION) != null) {
             item = makeSwitchItem(CameraSettings.KEY_RECORD_LOCATION, true);
             more.addItem(item);
+            if (mActivity.isSecureCamera()) {
+                // Prevent location preference from getting changed in secure camera mode
+                item.setEnabled(false);
+            }
         }
-        // settings popup
-        mOtherKeys = new String[] {
-                CameraSettings.KEY_PICTURE_SIZE,
-                CameraSettings.KEY_FOCUS_MODE,
-                CameraSettings.KEY_TIMER,
-                CameraSettings.KEY_TIMER_SOUND_EFFECTS,
-                };
-        item = makeItem(R.drawable.ic_settings_holo_light);
-        item.setLabel(res.getString(R.string.camera_menu_settings_label));
+        // countdown timer
+        final ListPreference ctpref = group.findPreference(CameraSettings.KEY_TIMER);
+        final ListPreference beeppref = group.findPreference(CameraSettings.KEY_TIMER_SOUND_EFFECTS);
+        item = makeItem(R.drawable.ic_timer);
+        item.setLabel(res.getString(R.string.pref_camera_timer_title).toUpperCase(locale));
         item.setOnClickListener(new OnClickListener() {
             @Override
             public void onClick(PieItem item) {
-                if (mPopup == null) {
-                    initializePopup();
-                }
+                CountdownTimerPopup timerPopup = (CountdownTimerPopup) mActivity.getLayoutInflater().inflate(
+                        R.layout.countdown_setting_popup, null, false);
+                timerPopup.initialize(ctpref, beeppref);
+                timerPopup.setSettingChangedListener(PhotoMenu.this);
+                mUI.dismissPopup();
+                mPopup = timerPopup;
+                mUI.showPopup(mPopup);
+            }
+        });
+        more.addItem(item);
+        // image size
+        item = makeItem(R.drawable.ic_imagesize);
+        final ListPreference sizePref = group.findPreference(CameraSettings.KEY_PICTURE_SIZE);
+        item.setLabel(res.getString(R.string.pref_camera_picturesize_title).toUpperCase(locale));
+        item.setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(PieItem item) {
+                ListPrefSettingPopup popup = (ListPrefSettingPopup) mActivity.getLayoutInflater().inflate(
+                        R.layout.list_pref_setting_popup, null, false);
+                popup.initialize(sizePref);
+                popup.setSettingChangedListener(PhotoMenu.this);
+                mUI.dismissPopup();
+                mPopup = popup;
                 mUI.showPopup(mPopup);
             }
         });
@@ -145,50 +159,18 @@ public class PhotoMenu extends PieController
     }
 
     @Override
-    public void reloadPreferences() {
-        super.reloadPreferences();
-        if (mPopup != null) {
-            mPopup.reloadPreference();
-        }
-    }
-
-    @Override
-    // Hit when an item in the second-level popup gets selected
+    // Hit when an item in a popup gets selected
     public void onListPrefChanged(ListPreference pref) {
-        if (mPopup != null && mSecondPopup != null) {
-                mUI.dismissPopup(true);
-                mPopup.reloadPreference();
+        if (mPopup != null) {
+            mUI.dismissPopup();
         }
         onSettingChanged(pref);
     }
 
-    @Override
-    public void overrideSettings(final String ... keyvalues) {
-        super.overrideSettings(keyvalues);
-        if (mPopup == null) initializePopup();
-        mPopup.overrideSettings(keyvalues);
-    }
-
-    protected void initializePopup() {
-        LayoutInflater inflater = (LayoutInflater) mActivity.getSystemService(
-                Context.LAYOUT_INFLATER_SERVICE);
-
-        MoreSettingPopup popup = (MoreSettingPopup) inflater.inflate(
-                R.layout.more_setting_popup, null, false);
-        popup.setSettingChangedListener(this);
-        popup.initialize(mPreferenceGroup, mOtherKeys);
-        if (mActivity.isSecureCamera()) {
-            // Prevent location preference from getting changed in secure camera mode
-            popup.setPreferenceEnabled(CameraSettings.KEY_RECORD_LOCATION, false);
-        }
-        mPopup = popup;
-    }
-
-    public void popupDismissed(boolean topPopupOnly) {
-        // if the 2nd level popup gets dismissed
-        if (mSecondPopup != null) {
-            mSecondPopup = null;
-            if (topPopupOnly) mUI.showPopup(mPopup);
+    public void popupDismissed() {
+        // the popup gets dismissed
+        if (mPopup != null) {
+            mPopup = null;
         }
     }
 
@@ -217,29 +199,4 @@ public class PhotoMenu extends PieController
         super.onSettingChanged(pref);
     }
 
-    @Override
-    // Hit when an item in the first-level popup gets selected, then bring up
-    // the second-level popup
-    public void onPreferenceClicked(ListPreference pref) {
-        if (mSecondPopup != null) return;
-
-        LayoutInflater inflater = (LayoutInflater) mActivity.getSystemService(
-                Context.LAYOUT_INFLATER_SERVICE);
-        if (CameraSettings.KEY_TIMER.equals(pref.getKey())) {
-            TimerSettingPopup timerPopup = (TimerSettingPopup) inflater.inflate(
-                    R.layout.timer_setting_popup, null, false);
-            timerPopup.initialize(pref);
-            timerPopup.setSettingChangedListener(this);
-            mUI.dismissPopup(true);
-            mSecondPopup = timerPopup;
-        } else {
-            ListPrefSettingPopup basic = (ListPrefSettingPopup) inflater.inflate(
-                    R.layout.list_pref_setting_popup, null, false);
-            basic.initialize(pref);
-            basic.setSettingChangedListener(this);
-            mUI.dismissPopup(true);
-            mSecondPopup = basic;
-        }
-        mUI.showPopup(mSecondPopup);
-    }
 }
index 5475b98..5a7b5bf 100644 (file)
@@ -357,7 +357,7 @@ public class PhotoUI implements PieListener,
             mFaceView.setBlockDraw(!full);
         }
         if (mPopup != null) {
-            dismissPopup(false, full);
+            dismissPopup(full);
         }
         if (mGestures != null) {
             mGestures.setEnabled(full);
@@ -389,7 +389,7 @@ public class PhotoUI implements PieListener,
     public boolean removeTopLevelPopup() {
         // Remove the top level popup or dialog box and return true if there's any
         if (mPopup != null) {
-            dismissPopup(true);
+            dismissPopup();
             return true;
         }
         return false;
@@ -408,11 +408,11 @@ public class PhotoUI implements PieListener,
         mGestures.addTouchReceiver(mPopup);
     }
 
-    public void dismissPopup(boolean topPopupOnly) {
-        dismissPopup(topPopupOnly, true);
+    public void dismissPopup() {
+        dismissPopup(true);
     }
 
-    private void dismissPopup(boolean topOnly, boolean fullScreen) {
+    private void dismissPopup(boolean fullScreen) {
         if (fullScreen) {
             mActivity.showUI();
             mBlocker.setVisibility(View.VISIBLE);
@@ -423,7 +423,7 @@ public class PhotoUI implements PieListener,
             ((FrameLayout) mRootView).removeView(mPopup);
             mPopup = null;
         }
-        mMenu.popupDismissed(topOnly);
+        mMenu.popupDismissed();
     }
 
     public void onShowSwitcherPopup() {
@@ -445,7 +445,7 @@ public class PhotoUI implements PieListener,
         // Remove all the popups/dialog boxes
         boolean ret = false;
         if (mPopup != null) {
-            dismissPopup(false);
+            dismissPopup();
             ret = true;
         }
         return ret;
@@ -508,7 +508,7 @@ public class PhotoUI implements PieListener,
 
     @Override
     public void onPieOpened(int centerX, int centerY) {
-        dismissPopup(false);
+        dismissPopup();
         mActivity.cancelActivityTouchHandling();
         mActivity.setSwipingEnabled(false);
         if (mFaceView != null) {
 
 package com.android.camera.ui;
 
-import java.util.Locale;
-
 import android.content.Context;
-import android.content.res.Resources;
 import android.util.AttributeSet;
 import android.util.Log;
 import android.view.View;
 import android.widget.Button;
-import android.widget.CompoundButton;
+import android.widget.CheckBox;
 import android.widget.NumberPicker;
-import android.widget.Switch;
-import android.widget.TextView;
+import android.widget.NumberPicker.OnValueChangeListener;
 
 import com.android.camera.ListPreference;
 import com.android.gallery3d.R;
 
+import java.util.Locale;
+
 /**
- * This is a popup window that allows users to turn on/off time lapse feature,
- * and to select a time interval for taking a time lapse video.
+ * This is a popup window that allows users to specify a countdown timer
  */
 
-public class TimerSettingPopup extends AbstractSettingPopup {
+public class CountdownTimerPopup extends AbstractSettingPopup {
     private static final String TAG = "TimerSettingPopup";
     private NumberPicker mNumberSpinner;
-    private Switch mTimerSwitch;
     private String[] mDurations;
-    private ListPreference mPreference;
+    private ListPreference mTimer;
+    private ListPreference mBeep;
     private Listener mListener;
     private Button mConfirmButton;
-    private TextView mHelpText;
-    private View mTimePicker;
+    private View mPickerTitle;
+    private CheckBox mTimerSound;
+    private View mSoundTitle;
 
     static public interface Listener {
         public void onListPrefChanged(ListPreference pref);
@@ -56,65 +54,62 @@ public class TimerSettingPopup extends AbstractSettingPopup {
         mListener = listener;
     }
 
-    public TimerSettingPopup(Context context, AttributeSet attrs) {
+    public CountdownTimerPopup(Context context, AttributeSet attrs) {
         super(context, attrs);
     }
 
-    public void initialize(ListPreference preference) {
-        mPreference = preference;
-
+    public void initialize(ListPreference timer, ListPreference beep) {
+        mTimer = timer;
+        mBeep = beep;
         // Set title.
-        mTitle.setText(mPreference.getTitle());
+        mTitle.setText(mTimer.getTitle());
 
         // Duration
-        CharSequence[] entries = mPreference.getEntryValues();
-        mDurations = new String[entries.length - 1];
+        CharSequence[] entries = mTimer.getEntryValues();
+        mDurations = new String[entries.length];
         Locale locale = getResources().getConfiguration().locale;
+        mDurations[0] = getResources().getString(R.string.setting_off); // Off
         for (int i = 1; i < entries.length; i++)
-            mDurations[i-1] = String.format(locale, "%d",
-                    Integer.parseInt(entries[i].toString()));
+            mDurations[i] =  String.format(locale, "%d", Integer.parseInt(entries[i].toString()));
         int durationCount = mDurations.length;
         mNumberSpinner = (NumberPicker) findViewById(R.id.duration);
         mNumberSpinner.setMinValue(0);
         mNumberSpinner.setMaxValue(durationCount - 1);
         mNumberSpinner.setDisplayedValues(mDurations);
         mNumberSpinner.setWrapSelectorWheel(false);
-
-        mTimerSwitch = (Switch) findViewById(R.id.timer_setting_switch);
-        mHelpText = (TextView) findViewById(R.id.set_timer_help_text);
+        mNumberSpinner.setOnValueChangedListener(new OnValueChangeListener() {
+            @Override
+            public void onValueChange(NumberPicker picker, int oldValue, int newValue) {
+                setTimeSelectionEnabled(newValue != 0);
+            }
+        });
         mConfirmButton = (Button) findViewById(R.id.timer_set_button);
-        mTimePicker = findViewById(R.id.time_duration_picker);
+        mPickerTitle = findViewById(R.id.set_time_interval_title);
 
         // Disable focus on the spinners to prevent keyboard from coming up
         mNumberSpinner.setDescendantFocusability(NumberPicker.FOCUS_BLOCK_DESCENDANTS);
 
-        mTimerSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
-            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
-                setTimeSelectionEnabled(isChecked);
-            }
-        });
         mConfirmButton.setOnClickListener(new View.OnClickListener() {
             public void onClick(View v) {
                 updateInputState();
             }
         });
+        mTimerSound = (CheckBox) findViewById(R.id.sound_check_box);
+        mSoundTitle = findViewById(R.id.beep_title);
     }
 
     private void restoreSetting() {
-        int index = mPreference.findIndexOfValue(mPreference.getValue());
+        int index = mTimer.findIndexOfValue(mTimer.getValue());
         if (index == -1) {
             Log.e(TAG, "Invalid preference value.");
-            mPreference.print();
+            mTimer.print();
             throw new IllegalArgumentException();
-        } else if (index == 0) {
-            // default choice: time lapse off
-            mTimerSwitch.setChecked(false);
-            setTimeSelectionEnabled(false);
         } else {
-            mTimerSwitch.setChecked(true);
-            setTimeSelectionEnabled(true);
-            mNumberSpinner.setValue(index - 1);
+            setTimeSelectionEnabled(index != 0);
+            mNumberSpinner.setValue(index);
         }
+        boolean checked = mBeep.findIndexOfValue(mBeep.getValue()) != 0;
+        mTimerSound.setChecked(checked);
     }
 
     @Override
@@ -130,8 +125,9 @@ public class TimerSettingPopup extends AbstractSettingPopup {
     }
 
     protected void setTimeSelectionEnabled(boolean enabled) {
-        mHelpText.setVisibility(enabled ? GONE : VISIBLE);
-        mTimePicker.setVisibility(enabled ? VISIBLE : GONE);
+        mPickerTitle.setVisibility(enabled ? VISIBLE : INVISIBLE);
+        mTimerSound.setEnabled(enabled);
+        mSoundTitle.setEnabled(enabled);
     }
 
     @Override
@@ -139,15 +135,11 @@ public class TimerSettingPopup extends AbstractSettingPopup {
     }
 
     private void updateInputState() {
-        if (mTimerSwitch.isChecked()) {
-            int newId = mNumberSpinner.getValue() + 1;
-            mPreference.setValueIndex(newId);
-        } else {
-            mPreference.setValueIndex(0);
-        }
-
+        mTimer.setValueIndex(mNumberSpinner.getValue());
+        mBeep.setValueIndex(mTimerSound.isChecked() ? 1 : 0);
         if (mListener != null) {
-            mListener.onListPrefChanged(mPreference);
+            mListener.onListPrefChanged(mTimer);
+            mListener.onListPrefChanged(mBeep);
         }
     }
 }