summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--res/drawable-hdpi/ic_exposure_holo_light_large.pngbin1551 -> 0 bytes
-rw-r--r--res/drawable-hdpi/ic_exposure_holo_light_xlarge.pngbin1551 -> 0 bytes
-rw-r--r--res/drawable-hdpi/ic_flash_auto_holo_light_large.pngbin2959 -> 0 bytes
-rw-r--r--res/drawable-hdpi/ic_flash_auto_holo_light_xlarge.pngbin2959 -> 0 bytes
-rw-r--r--res/drawable-hdpi/ic_flash_off_holo_light_large.pngbin2592 -> 0 bytes
-rw-r--r--res/drawable-hdpi/ic_flash_off_holo_light_xlarge.pngbin2592 -> 0 bytes
-rw-r--r--res/drawable-hdpi/ic_flash_on_holo_light_large.pngbin1918 -> 0 bytes
-rw-r--r--res/drawable-hdpi/ic_flash_on_holo_light_xlarge.pngbin1918 -> 0 bytes
-rw-r--r--res/drawable-hdpi/ic_imagesize.pngbin0 -> 2035 bytes
-rw-r--r--res/drawable-hdpi/ic_indicator_sce_hdr.pngbin2133 -> 2167 bytes
-rw-r--r--res/drawable-hdpi/ic_indicator_sce_off.pngbin1415 -> 1372 bytes
-rw-r--r--res/drawable-hdpi/ic_indicator_sce_on.pngbin2565 -> 2656 bytes
-rw-r--r--res/drawable-hdpi/ic_settings_holo_light_large.pngbin1328 -> 0 bytes
-rw-r--r--res/drawable-hdpi/ic_settings_holo_light_xlarge.pngbin1328 -> 0 bytes
-rw-r--r--res/drawable-hdpi/ic_timer.pngbin0 -> 3331 bytes
-rw-r--r--res/drawable-mdpi/ic_exposure_holo_light_xlarge.pngbin1132 -> 0 bytes
-rw-r--r--res/drawable-mdpi/ic_flash_auto_holo_light_xlarge.pngbin1838 -> 0 bytes
-rw-r--r--res/drawable-mdpi/ic_flash_off_holo_light_xlarge.pngbin1876 -> 0 bytes
-rw-r--r--res/drawable-mdpi/ic_flash_on_holo_light_xlarge.pngbin1304 -> 0 bytes
-rw-r--r--res/drawable-mdpi/ic_imagesize.pngbin0 -> 1377 bytes
-rw-r--r--res/drawable-mdpi/ic_indicator_sce_hdr.pngbin1422 -> 1419 bytes
-rw-r--r--res/drawable-mdpi/ic_indicator_sce_off.pngbin965 -> 971 bytes
-rw-r--r--res/drawable-mdpi/ic_indicator_sce_on.pngbin1651 -> 1642 bytes
-rw-r--r--res/drawable-mdpi/ic_settings_holo_light_xlarge.pngbin1459 -> 0 bytes
-rw-r--r--res/drawable-mdpi/ic_timer.pngbin0 -> 2171 bytes
-rw-r--r--res/drawable-xhdpi/ic_exposure_holo_light_xlarge.pngbin2131 -> 0 bytes
-rw-r--r--res/drawable-xhdpi/ic_flash_auto_holo_light_xlarge.pngbin4090 -> 0 bytes
-rw-r--r--res/drawable-xhdpi/ic_flash_off_holo_light_xlarge.pngbin3683 -> 0 bytes
-rw-r--r--res/drawable-xhdpi/ic_flash_on_holo_light_xlarge.pngbin2537 -> 0 bytes
-rw-r--r--res/drawable-xhdpi/ic_imagesize.pngbin0 -> 2560 bytes
-rw-r--r--res/drawable-xhdpi/ic_indicator_sce_hdr.pngbin2903 -> 2941 bytes
-rw-r--r--res/drawable-xhdpi/ic_indicator_sce_off.pngbin1864 -> 1865 bytes
-rw-r--r--res/drawable-xhdpi/ic_indicator_sce_on.pngbin3586 -> 3688 bytes
-rw-r--r--res/drawable-xhdpi/ic_settings_holo_light_xlarge.pngbin2782 -> 0 bytes
-rw-r--r--res/drawable-xhdpi/ic_timer.pngbin0 -> 4636 bytes
-rw-r--r--res/layout/countdown_setting_popup.xml101
-rw-r--r--res/layout/timer_setting_popup.xml101
-rw-r--r--res/values-large-hdpi/drawable.xml5
-rw-r--r--res/values-sw600dp-hdpi/drawable.xml5
-rw-r--r--res/values-sw640dp/drawable.xml5
-rw-r--r--res/values-xlarge/drawable.xml5
-rw-r--r--src/com/android/camera/CountDownTimerPreference.java19
-rw-r--r--src/com/android/camera/PhotoMenu.java133
-rw-r--r--src/com/android/camera/PhotoUI.java16
-rw-r--r--src/com/android/camera/ui/CountdownTimerPopup.java (renamed from src/com/android/camera/ui/TimerSettingPopup.java)92
45 files changed, 203 insertions, 279 deletions
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
index ee45cfce2..000000000
--- a/res/drawable-hdpi/ic_exposure_holo_light_large.png
+++ /dev/null
Binary files 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
index ee45cfce2..000000000
--- a/res/drawable-hdpi/ic_exposure_holo_light_xlarge.png
+++ /dev/null
Binary files 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
index 00caf1bc7..000000000
--- a/res/drawable-hdpi/ic_flash_auto_holo_light_large.png
+++ /dev/null
Binary files 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
index 00caf1bc7..000000000
--- a/res/drawable-hdpi/ic_flash_auto_holo_light_xlarge.png
+++ /dev/null
Binary files 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
index 353df48ee..000000000
--- a/res/drawable-hdpi/ic_flash_off_holo_light_large.png
+++ /dev/null
Binary files 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
index 353df48ee..000000000
--- a/res/drawable-hdpi/ic_flash_off_holo_light_xlarge.png
+++ /dev/null
Binary files 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
index b508318e7..000000000
--- a/res/drawable-hdpi/ic_flash_on_holo_light_large.png
+++ /dev/null
Binary files 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
index b508318e7..000000000
--- a/res/drawable-hdpi/ic_flash_on_holo_light_xlarge.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_imagesize.png b/res/drawable-hdpi/ic_imagesize.png
new file mode 100644
index 000000000..126208b44
--- /dev/null
+++ b/res/drawable-hdpi/ic_imagesize.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_indicator_sce_hdr.png b/res/drawable-hdpi/ic_indicator_sce_hdr.png
index de09fe158..0b8fdfa13 100644
--- a/res/drawable-hdpi/ic_indicator_sce_hdr.png
+++ b/res/drawable-hdpi/ic_indicator_sce_hdr.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_indicator_sce_off.png b/res/drawable-hdpi/ic_indicator_sce_off.png
index 076d82303..09bd2c893 100644
--- a/res/drawable-hdpi/ic_indicator_sce_off.png
+++ b/res/drawable-hdpi/ic_indicator_sce_off.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_indicator_sce_on.png b/res/drawable-hdpi/ic_indicator_sce_on.png
index 9ce466b81..ef0f56faf 100644
--- a/res/drawable-hdpi/ic_indicator_sce_on.png
+++ b/res/drawable-hdpi/ic_indicator_sce_on.png
Binary files 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
index 13c99911d..000000000
--- a/res/drawable-hdpi/ic_settings_holo_light_large.png
+++ /dev/null
Binary files 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
index 13c99911d..000000000
--- a/res/drawable-hdpi/ic_settings_holo_light_xlarge.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-hdpi/ic_timer.png b/res/drawable-hdpi/ic_timer.png
new file mode 100644
index 000000000..a3cec8d4c
--- /dev/null
+++ b/res/drawable-hdpi/ic_timer.png
Binary files 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
index 4f4cc740a..000000000
--- a/res/drawable-mdpi/ic_exposure_holo_light_xlarge.png
+++ /dev/null
Binary files 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
index 7dacd2058..000000000
--- a/res/drawable-mdpi/ic_flash_auto_holo_light_xlarge.png
+++ /dev/null
Binary files 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
index 30b51a5b0..000000000
--- a/res/drawable-mdpi/ic_flash_off_holo_light_xlarge.png
+++ /dev/null
Binary files 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
index 7bc69632c..000000000
--- a/res/drawable-mdpi/ic_flash_on_holo_light_xlarge.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_imagesize.png b/res/drawable-mdpi/ic_imagesize.png
new file mode 100644
index 000000000..d3f8b62fd
--- /dev/null
+++ b/res/drawable-mdpi/ic_imagesize.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_indicator_sce_hdr.png b/res/drawable-mdpi/ic_indicator_sce_hdr.png
index 06519411e..7907f647b 100644
--- a/res/drawable-mdpi/ic_indicator_sce_hdr.png
+++ b/res/drawable-mdpi/ic_indicator_sce_hdr.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_indicator_sce_off.png b/res/drawable-mdpi/ic_indicator_sce_off.png
index 52ad71394..4bfd91a97 100644
--- a/res/drawable-mdpi/ic_indicator_sce_off.png
+++ b/res/drawable-mdpi/ic_indicator_sce_off.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_indicator_sce_on.png b/res/drawable-mdpi/ic_indicator_sce_on.png
index 510c39f1f..6ea6d77c4 100644
--- a/res/drawable-mdpi/ic_indicator_sce_on.png
+++ b/res/drawable-mdpi/ic_indicator_sce_on.png
Binary files 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
index 2b89fef8d..000000000
--- a/res/drawable-mdpi/ic_settings_holo_light_xlarge.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-mdpi/ic_timer.png b/res/drawable-mdpi/ic_timer.png
new file mode 100644
index 000000000..b55555ffc
--- /dev/null
+++ b/res/drawable-mdpi/ic_timer.png
Binary files 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
index ed73752ad..000000000
--- a/res/drawable-xhdpi/ic_exposure_holo_light_xlarge.png
+++ /dev/null
Binary files 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
index 915f4a55f..000000000
--- a/res/drawable-xhdpi/ic_flash_auto_holo_light_xlarge.png
+++ /dev/null
Binary files 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
index f34e5a9b6..000000000
--- a/res/drawable-xhdpi/ic_flash_off_holo_light_xlarge.png
+++ /dev/null
Binary files 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
index b1dbbc07a..000000000
--- a/res/drawable-xhdpi/ic_flash_on_holo_light_xlarge.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_imagesize.png b/res/drawable-xhdpi/ic_imagesize.png
new file mode 100644
index 000000000..54fd00825
--- /dev/null
+++ b/res/drawable-xhdpi/ic_imagesize.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_indicator_sce_hdr.png b/res/drawable-xhdpi/ic_indicator_sce_hdr.png
index b60abb335..318c8fa6b 100644
--- a/res/drawable-xhdpi/ic_indicator_sce_hdr.png
+++ b/res/drawable-xhdpi/ic_indicator_sce_hdr.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_indicator_sce_off.png b/res/drawable-xhdpi/ic_indicator_sce_off.png
index aad8cf806..429d6ec79 100644
--- a/res/drawable-xhdpi/ic_indicator_sce_off.png
+++ b/res/drawable-xhdpi/ic_indicator_sce_off.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_indicator_sce_on.png b/res/drawable-xhdpi/ic_indicator_sce_on.png
index 39cfa4b52..8b2440c57 100644
--- a/res/drawable-xhdpi/ic_indicator_sce_on.png
+++ b/res/drawable-xhdpi/ic_indicator_sce_on.png
Binary files 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
index 9fa8f7292..000000000
--- a/res/drawable-xhdpi/ic_settings_holo_light_xlarge.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable-xhdpi/ic_timer.png b/res/drawable-xhdpi/ic_timer.png
new file mode 100644
index 000000000..1764fddc8
--- /dev/null
+++ b/res/drawable-xhdpi/ic_timer.png
Binary files differ
diff --git a/res/layout/countdown_setting_popup.xml b/res/layout/countdown_setting_popup.xml
new file mode 100644
index 000000000..22acd9251
--- /dev/null
+++ b/res/layout/countdown_setting_popup.xml
@@ -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
index d6e8000ee..000000000
--- a/res/layout/timer_setting_popup.xml
+++ /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>
diff --git a/res/values-large-hdpi/drawable.xml b/res/values-large-hdpi/drawable.xml
index 119ab1de8..b810347b4 100644
--- a/res/values-large-hdpi/drawable.xml
+++ b/res/values-large-hdpi/drawable.xml
@@ -17,10 +17,6 @@
<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>
diff --git a/res/values-sw600dp-hdpi/drawable.xml b/res/values-sw600dp-hdpi/drawable.xml
index 119ab1de8..b810347b4 100644
--- a/res/values-sw600dp-hdpi/drawable.xml
+++ b/res/values-sw600dp-hdpi/drawable.xml
@@ -17,10 +17,6 @@
<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>
diff --git a/res/values-sw640dp/drawable.xml b/res/values-sw640dp/drawable.xml
index 77d453c4d..6a6e71192 100644
--- a/res/values-sw640dp/drawable.xml
+++ b/res/values-sw640dp/drawable.xml
@@ -17,10 +17,6 @@
<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>
diff --git a/res/values-xlarge/drawable.xml b/res/values-xlarge/drawable.xml
index 48436c052..648f1d7fd 100644
--- a/res/values-xlarge/drawable.xml
+++ b/res/values-xlarge/drawable.xml
@@ -15,10 +15,6 @@
-->
<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>
diff --git a/src/com/android/camera/CountDownTimerPreference.java b/src/com/android/camera/CountDownTimerPreference.java
index 0bbf6bc9d..9c66dda8c 100644
--- a/src/com/android/camera/CountDownTimerPreference.java
+++ b/src/com/android/camera/CountDownTimerPreference.java
@@ -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 {
diff --git a/src/com/android/camera/PhotoMenu.java b/src/com/android/camera/PhotoMenu.java
index f29ed4a8b..d0f21ed68 100644
--- a/src/com/android/camera/PhotoMenu.java
+++ b/src/com/android/camera/PhotoMenu.java
@@ -16,34 +16,28 @@
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);
- }
}
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java
index 5475b98f6..5a7b5bfef 100644
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -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) {
diff --git a/src/com/android/camera/ui/TimerSettingPopup.java b/src/com/android/camera/ui/CountdownTimerPopup.java
index 983c7f21b..7c3572b55 100644
--- a/src/com/android/camera/ui/TimerSettingPopup.java
+++ b/src/com/android/camera/ui/CountdownTimerPopup.java
@@ -16,37 +16,35 @@
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);
}
}
}