summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Haeberling <haeberling@google.com>2014-05-20 16:28:11 -0700
committerSascha Haeberling <haeberling@google.com>2014-05-20 17:39:37 -0700
commit4333fac867f6f6a11235b16d305dd197093b44d5 (patch)
tree6e953fac1563fe4157d3ec6fa047a43d9cdcd24e
parentc808dc9e18865ad3d188729b3d79a17a0ee983c8 (diff)
downloadandroid_packages_apps_Camera2-4333fac867f6f6a11235b16d305dd197093b44d5.tar.gz
android_packages_apps_Camera2-4333fac867f6f6a11235b16d305dd197093b44d5.tar.bz2
android_packages_apps_Camera2-4333fac867f6f6a11235b16d305dd197093b44d5.zip
Show timer option in HDR+ mode and as disabled.
Bug: 15089347 Change-Id: I366cd0b553808d55136c141bc1efec6ada9ee9b0
-rw-r--r--res/drawable-hdpi/ic_timer_10s_disabled.pngbin0 -> 1263 bytes
-rw-r--r--res/drawable-hdpi/ic_timer_3s_disabled.pngbin0 -> 1283 bytes
-rw-r--r--res/drawable-hdpi/ic_timer_off_disabled.pngbin0 -> 1494 bytes
-rw-r--r--res/drawable-mdpi/ic_timer_10s_disabled.pngbin0 -> 879 bytes
-rw-r--r--res/drawable-mdpi/ic_timer_3s_disabled.pngbin0 -> 905 bytes
-rw-r--r--res/drawable-mdpi/ic_timer_off_disabled.pngbin0 -> 1062 bytes
-rw-r--r--res/drawable-xhdpi/ic_timer_10s_disabled.pngbin0 -> 1810 bytes
-rw-r--r--res/drawable-xhdpi/ic_timer_3s_disabled.pngbin0 -> 1792 bytes
-rw-r--r--res/drawable-xhdpi/ic_timer_off_disabled.pngbin0 -> 1986 bytes
-rw-r--r--res/drawable-xxhdpi/ic_timer_10s_disabled.pngbin0 -> 2639 bytes
-rw-r--r--res/drawable-xxhdpi/ic_timer_3s_disabled.pngbin0 -> 2656 bytes
-rw-r--r--res/drawable-xxhdpi/ic_timer_off_disabled.pngbin0 -> 2565 bytes
-rw-r--r--res/drawable/ic_timer_10s.xml39
-rw-r--r--res/drawable/ic_timer_3s.xml39
-rw-r--r--res/drawable/ic_timer_off.xml39
-rw-r--r--res/values/arrays.xml6
-rw-r--r--src/com/android/camera/PhotoModule.java1
-rw-r--r--src/com/android/camera/app/CameraAppUI.java15
18 files changed, 134 insertions, 5 deletions
diff --git a/res/drawable-hdpi/ic_timer_10s_disabled.png b/res/drawable-hdpi/ic_timer_10s_disabled.png
new file mode 100644
index 000000000..0f9d4a1fa
--- /dev/null
+++ b/res/drawable-hdpi/ic_timer_10s_disabled.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_timer_3s_disabled.png b/res/drawable-hdpi/ic_timer_3s_disabled.png
new file mode 100644
index 000000000..eaf9ffe6f
--- /dev/null
+++ b/res/drawable-hdpi/ic_timer_3s_disabled.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_timer_off_disabled.png b/res/drawable-hdpi/ic_timer_off_disabled.png
new file mode 100644
index 000000000..713da5bea
--- /dev/null
+++ b/res/drawable-hdpi/ic_timer_off_disabled.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_timer_10s_disabled.png b/res/drawable-mdpi/ic_timer_10s_disabled.png
new file mode 100644
index 000000000..6ce956406
--- /dev/null
+++ b/res/drawable-mdpi/ic_timer_10s_disabled.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_timer_3s_disabled.png b/res/drawable-mdpi/ic_timer_3s_disabled.png
new file mode 100644
index 000000000..372a1b1ac
--- /dev/null
+++ b/res/drawable-mdpi/ic_timer_3s_disabled.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_timer_off_disabled.png b/res/drawable-mdpi/ic_timer_off_disabled.png
new file mode 100644
index 000000000..046328268
--- /dev/null
+++ b/res/drawable-mdpi/ic_timer_off_disabled.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_timer_10s_disabled.png b/res/drawable-xhdpi/ic_timer_10s_disabled.png
new file mode 100644
index 000000000..cc73c7a0b
--- /dev/null
+++ b/res/drawable-xhdpi/ic_timer_10s_disabled.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_timer_3s_disabled.png b/res/drawable-xhdpi/ic_timer_3s_disabled.png
new file mode 100644
index 000000000..3fe1a2c49
--- /dev/null
+++ b/res/drawable-xhdpi/ic_timer_3s_disabled.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_timer_off_disabled.png b/res/drawable-xhdpi/ic_timer_off_disabled.png
new file mode 100644
index 000000000..7ceb53a88
--- /dev/null
+++ b/res/drawable-xhdpi/ic_timer_off_disabled.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_timer_10s_disabled.png b/res/drawable-xxhdpi/ic_timer_10s_disabled.png
new file mode 100644
index 000000000..bb8449644
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_timer_10s_disabled.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_timer_3s_disabled.png b/res/drawable-xxhdpi/ic_timer_3s_disabled.png
new file mode 100644
index 000000000..f67c754ce
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_timer_3s_disabled.png
Binary files differ
diff --git a/res/drawable-xxhdpi/ic_timer_off_disabled.png b/res/drawable-xxhdpi/ic_timer_off_disabled.png
new file mode 100644
index 000000000..d617e79fb
--- /dev/null
+++ b/res/drawable-xxhdpi/ic_timer_off_disabled.png
Binary files differ
diff --git a/res/drawable/ic_timer_10s.xml b/res/drawable/ic_timer_10s.xml
new file mode 100644
index 000000000..0fc1e7602
--- /dev/null
+++ b/res/drawable/ic_timer_10s.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 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"
+ android:constantSize="true">
+ <item android:state_enabled="false">
+ <bitmap
+ android:gravity="center"
+ android:src="@drawable/ic_timer_10s_disabled" />
+ </item>
+ <item android:state_pressed="true">
+ <layer-list>
+ <item android:drawable="@drawable/button_background_pressed_dark" />
+ <item>
+ <bitmap
+ android:gravity="center"
+ android:src="@drawable/ic_timer_10s_normal" />
+ </item>
+ </layer-list>
+ </item>
+ <item>
+ <bitmap
+ android:gravity="center"
+ android:src="@drawable/ic_timer_10s_normal" />
+ </item>
+</selector>
diff --git a/res/drawable/ic_timer_3s.xml b/res/drawable/ic_timer_3s.xml
new file mode 100644
index 000000000..f69138008
--- /dev/null
+++ b/res/drawable/ic_timer_3s.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 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"
+ android:constantSize="true">
+ <item android:state_enabled="false">
+ <bitmap
+ android:gravity="center"
+ android:src="@drawable/ic_timer_3s_disabled" />
+ </item>
+ <item android:state_pressed="true">
+ <layer-list>
+ <item android:drawable="@drawable/button_background_pressed_dark" />
+ <item>
+ <bitmap
+ android:gravity="center"
+ android:src="@drawable/ic_timer_3s_normal" />
+ </item>
+ </layer-list>
+ </item>
+ <item>
+ <bitmap
+ android:gravity="center"
+ android:src="@drawable/ic_timer_3s_normal" />
+ </item>
+</selector>
diff --git a/res/drawable/ic_timer_off.xml b/res/drawable/ic_timer_off.xml
new file mode 100644
index 000000000..bb041b459
--- /dev/null
+++ b/res/drawable/ic_timer_off.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 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"
+ android:constantSize="true">
+ <item android:state_enabled="false">
+ <bitmap
+ android:gravity="center"
+ android:src="@drawable/ic_timer_off_disabled" />
+ </item>
+ <item android:state_pressed="true">
+ <layer-list>
+ <item android:drawable="@drawable/button_background_pressed_dark" />
+ <item>
+ <bitmap
+ android:gravity="center"
+ android:src="@drawable/ic_timer_off_normal" />
+ </item>
+ </layer-list>
+ </item>
+ <item>
+ <bitmap
+ android:gravity="center"
+ android:src="@drawable/ic_timer_off_normal" />
+ </item>
+</selector>
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index 9b30aff56..9d3d5f727 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -481,9 +481,9 @@
</array>
<array name="countdown_duration_icons" translatable="false">
- <item>@drawable/ic_timer_off_normal</item>
- <item>@drawable/ic_timer_3s_normal</item>
- <item>@drawable/ic_timer_10s_normal</item>
+ <item>@drawable/ic_timer_off</item>
+ <item>@drawable/ic_timer_3s</item>
+ <item>@drawable/ic_timer_10s</item>
</array>
<array name="pref_camera_countdown_indicators" translatable="false">
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index ff52f99d7..3cd295eda 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -749,6 +749,7 @@ public class PhotoModule
}
bottomBarSpec.enableSelfTimer = true;
+ bottomBarSpec.showSelfTimer = true;
if (isImageCaptureIntent()) {
bottomBarSpec.showCancel = true;
diff --git a/src/com/android/camera/app/CameraAppUI.java b/src/com/android/camera/app/CameraAppUI.java
index 231ff1aa3..b281a8754 100644
--- a/src/com/android/camera/app/CameraAppUI.java
+++ b/src/com/android/camera/app/CameraAppUI.java
@@ -446,9 +446,16 @@ public class CameraAppUI implements ModeListView.ModeSwitchListener,
public float exposureCompensationStep;
/**
- * Whether or not timer should show.
+ * Whether self-timer is enabled.
*/
public boolean enableSelfTimer = false;
+
+ /**
+ * Whether the option for self-timer should show. If true and
+ * {@link #enableSelfTimer} is false, then the option should be shown
+ * disabled.
+ */
+ public boolean showSelfTimer = false;
}
@@ -1756,7 +1763,11 @@ public class CameraAppUI implements ModeListView.ModeSwitchListener,
if (bottomBarSpec.enableSelfTimer) {
buttonManager.initializeButton(ButtonManager.BUTTON_COUNTDOWN, null);
} else {
- buttonManager.hideButton(ButtonManager.BUTTON_COUNTDOWN);
+ if (bottomBarSpec.showSelfTimer) {
+ buttonManager.disableButton(ButtonManager.BUTTON_COUNTDOWN);
+ } else {
+ buttonManager.hideButton(ButtonManager.BUTTON_COUNTDOWN);
+ }
}
if (bottomBarSpec.enablePanoOrientation