Merge "CameraUtil: add float clamp function" into gb-ub-photos-carlsbad
diff --git a/res/drawable-sw600dp-hdpi-v19/btn_shutter_default.png b/res/drawable-sw600dp-hdpi-v19/btn_shutter_default.png
index f283d64..e6a95b7 100644
--- a/res/drawable-sw600dp-hdpi-v19/btn_shutter_default.png
+++ b/res/drawable-sw600dp-hdpi-v19/btn_shutter_default.png
Binary files differ
diff --git a/res/drawable-sw600dp-hdpi-v19/btn_shutter_default_disabled.png b/res/drawable-sw600dp-hdpi-v19/btn_shutter_default_disabled.png
index 18071c7..512055c 100644
--- a/res/drawable-sw600dp-hdpi-v19/btn_shutter_default_disabled.png
+++ b/res/drawable-sw600dp-hdpi-v19/btn_shutter_default_disabled.png
Binary files differ
diff --git a/res/drawable-sw600dp-hdpi-v19/btn_shutter_pressed.png b/res/drawable-sw600dp-hdpi-v19/btn_shutter_pressed.png
index 2d6f407..e0ae2dc 100644
--- a/res/drawable-sw600dp-hdpi-v19/btn_shutter_pressed.png
+++ b/res/drawable-sw600dp-hdpi-v19/btn_shutter_pressed.png
Binary files differ
diff --git a/res/drawable-sw600dp-hdpi-v19/btn_shutter_pressed_disabled.png b/res/drawable-sw600dp-hdpi-v19/btn_shutter_pressed_disabled.png
index f481f72..cc3c0ef 100644
--- a/res/drawable-sw600dp-hdpi-v19/btn_shutter_pressed_disabled.png
+++ b/res/drawable-sw600dp-hdpi-v19/btn_shutter_pressed_disabled.png
Binary files differ
diff --git a/res/drawable-sw600dp-hdpi-v19/btn_shutter_recording.png b/res/drawable-sw600dp-hdpi-v19/btn_shutter_recording.png
index 4cb9ebf..d5dd218 100644
--- a/res/drawable-sw600dp-hdpi-v19/btn_shutter_recording.png
+++ b/res/drawable-sw600dp-hdpi-v19/btn_shutter_recording.png
Binary files differ
diff --git a/res/drawable-sw600dp-hdpi-v19/btn_shutter_video_default.png b/res/drawable-sw600dp-hdpi-v19/btn_shutter_video_default.png
index c45cfb5..d3030ed 100644
--- a/res/drawable-sw600dp-hdpi-v19/btn_shutter_video_default.png
+++ b/res/drawable-sw600dp-hdpi-v19/btn_shutter_video_default.png
Binary files differ
diff --git a/res/drawable-sw600dp-hdpi-v19/btn_shutter_video_pressed.png b/res/drawable-sw600dp-hdpi-v19/btn_shutter_video_pressed.png
index fe31d66..f6204a7 100644
--- a/res/drawable-sw600dp-hdpi-v19/btn_shutter_video_pressed.png
+++ b/res/drawable-sw600dp-hdpi-v19/btn_shutter_video_pressed.png
Binary files differ
diff --git a/res/drawable-sw600dp-hdpi-v19/btn_shutter_video_recording.png b/res/drawable-sw600dp-hdpi-v19/btn_shutter_video_recording.png
index 37507d4..d7fee79 100644
--- a/res/drawable-sw600dp-hdpi-v19/btn_shutter_video_recording.png
+++ b/res/drawable-sw600dp-hdpi-v19/btn_shutter_video_recording.png
Binary files differ
diff --git a/res/drawable-sw600dp-hdpi-v19/switcher_bg.9.png b/res/drawable-sw600dp-hdpi-v19/switcher_bg.9.png
new file mode 100644
index 0000000..b12785f
--- /dev/null
+++ b/res/drawable-sw600dp-hdpi-v19/switcher_bg.9.png
Binary files differ
diff --git a/res/drawable-sw600dp-hdpi/btn_shutter_default.png b/res/drawable-sw600dp-hdpi/btn_shutter_default.png
index bdd641f..f5aa01e 100644
--- a/res/drawable-sw600dp-hdpi/btn_shutter_default.png
+++ b/res/drawable-sw600dp-hdpi/btn_shutter_default.png
Binary files differ
diff --git a/res/drawable-sw600dp-hdpi/btn_shutter_default_disabled.png b/res/drawable-sw600dp-hdpi/btn_shutter_default_disabled.png
index 921ed5d..c84311d 100644
--- a/res/drawable-sw600dp-hdpi/btn_shutter_default_disabled.png
+++ b/res/drawable-sw600dp-hdpi/btn_shutter_default_disabled.png
Binary files differ
diff --git a/res/drawable-sw600dp-hdpi/btn_shutter_pressed.png b/res/drawable-sw600dp-hdpi/btn_shutter_pressed.png
index 80f7ef5..0e53d4a 100644
--- a/res/drawable-sw600dp-hdpi/btn_shutter_pressed.png
+++ b/res/drawable-sw600dp-hdpi/btn_shutter_pressed.png
Binary files differ
diff --git a/res/drawable-sw600dp-hdpi/btn_shutter_pressed_disabled.png b/res/drawable-sw600dp-hdpi/btn_shutter_pressed_disabled.png
index ab900c8..5021f34 100644
--- a/res/drawable-sw600dp-hdpi/btn_shutter_pressed_disabled.png
+++ b/res/drawable-sw600dp-hdpi/btn_shutter_pressed_disabled.png
Binary files differ
diff --git a/res/drawable-sw600dp-hdpi/btn_shutter_recording.png b/res/drawable-sw600dp-hdpi/btn_shutter_recording.png
index 80f04ff..ad4b990 100644
--- a/res/drawable-sw600dp-hdpi/btn_shutter_recording.png
+++ b/res/drawable-sw600dp-hdpi/btn_shutter_recording.png
Binary files differ
diff --git a/res/drawable-sw600dp-hdpi/btn_shutter_video_default.png b/res/drawable-sw600dp-hdpi/btn_shutter_video_default.png
index 44ea9b0..7ba9b20 100644
--- a/res/drawable-sw600dp-hdpi/btn_shutter_video_default.png
+++ b/res/drawable-sw600dp-hdpi/btn_shutter_video_default.png
Binary files differ
diff --git a/res/drawable-sw600dp-hdpi/btn_shutter_video_pressed.png b/res/drawable-sw600dp-hdpi/btn_shutter_video_pressed.png
index fc8173d..ce2eb66 100644
--- a/res/drawable-sw600dp-hdpi/btn_shutter_video_pressed.png
+++ b/res/drawable-sw600dp-hdpi/btn_shutter_video_pressed.png
Binary files differ
diff --git a/res/drawable-sw600dp-hdpi/btn_shutter_video_recording.png b/res/drawable-sw600dp-hdpi/btn_shutter_video_recording.png
index 65d9879..abbb46a 100644
--- a/res/drawable-sw600dp-hdpi/btn_shutter_video_recording.png
+++ b/res/drawable-sw600dp-hdpi/btn_shutter_video_recording.png
Binary files differ
diff --git a/res/drawable-sw600dp-mdpi-v19/btn_shutter_default.png b/res/drawable-sw600dp-mdpi-v19/btn_shutter_default.png
index 86aced7..b8c81ef 100644
--- a/res/drawable-sw600dp-mdpi-v19/btn_shutter_default.png
+++ b/res/drawable-sw600dp-mdpi-v19/btn_shutter_default.png
Binary files differ
diff --git a/res/drawable-sw600dp-mdpi-v19/btn_shutter_default_disabled.png b/res/drawable-sw600dp-mdpi-v19/btn_shutter_default_disabled.png
index a9710b6..7fd7f7d 100644
--- a/res/drawable-sw600dp-mdpi-v19/btn_shutter_default_disabled.png
+++ b/res/drawable-sw600dp-mdpi-v19/btn_shutter_default_disabled.png
Binary files differ
diff --git a/res/drawable-sw600dp-mdpi-v19/btn_shutter_pressed.png b/res/drawable-sw600dp-mdpi-v19/btn_shutter_pressed.png
index 49f9db1..71fd6cc 100644
--- a/res/drawable-sw600dp-mdpi-v19/btn_shutter_pressed.png
+++ b/res/drawable-sw600dp-mdpi-v19/btn_shutter_pressed.png
Binary files differ
diff --git a/res/drawable-sw600dp-mdpi-v19/btn_shutter_pressed_disabled.png b/res/drawable-sw600dp-mdpi-v19/btn_shutter_pressed_disabled.png
index cd9b735..9ba8aa0 100644
--- a/res/drawable-sw600dp-mdpi-v19/btn_shutter_pressed_disabled.png
+++ b/res/drawable-sw600dp-mdpi-v19/btn_shutter_pressed_disabled.png
Binary files differ
diff --git a/res/drawable-sw600dp-mdpi-v19/btn_shutter_recording.png b/res/drawable-sw600dp-mdpi-v19/btn_shutter_recording.png
index 4faed7d..5fe740b 100644
--- a/res/drawable-sw600dp-mdpi-v19/btn_shutter_recording.png
+++ b/res/drawable-sw600dp-mdpi-v19/btn_shutter_recording.png
Binary files differ
diff --git a/res/drawable-sw600dp-mdpi-v19/btn_shutter_video_default.png b/res/drawable-sw600dp-mdpi-v19/btn_shutter_video_default.png
index ad8bf1d..e38f4d2 100644
--- a/res/drawable-sw600dp-mdpi-v19/btn_shutter_video_default.png
+++ b/res/drawable-sw600dp-mdpi-v19/btn_shutter_video_default.png
Binary files differ
diff --git a/res/drawable-sw600dp-mdpi-v19/btn_shutter_video_pressed.png b/res/drawable-sw600dp-mdpi-v19/btn_shutter_video_pressed.png
index 7d68e64..4180fa3 100644
--- a/res/drawable-sw600dp-mdpi-v19/btn_shutter_video_pressed.png
+++ b/res/drawable-sw600dp-mdpi-v19/btn_shutter_video_pressed.png
Binary files differ
diff --git a/res/drawable-sw600dp-mdpi-v19/btn_shutter_video_recording.png b/res/drawable-sw600dp-mdpi-v19/btn_shutter_video_recording.png
index f265413..8aeadc6 100644
--- a/res/drawable-sw600dp-mdpi-v19/btn_shutter_video_recording.png
+++ b/res/drawable-sw600dp-mdpi-v19/btn_shutter_video_recording.png
Binary files differ
diff --git a/res/drawable-sw600dp-mdpi/btn_shutter_default.png b/res/drawable-sw600dp-mdpi/btn_shutter_default.png
index bf6cf2c..2164071 100644
--- a/res/drawable-sw600dp-mdpi/btn_shutter_default.png
+++ b/res/drawable-sw600dp-mdpi/btn_shutter_default.png
Binary files differ
diff --git a/res/drawable-sw600dp-mdpi/btn_shutter_default_disabled.png b/res/drawable-sw600dp-mdpi/btn_shutter_default_disabled.png
index 18d7955..86ac78f 100644
--- a/res/drawable-sw600dp-mdpi/btn_shutter_default_disabled.png
+++ b/res/drawable-sw600dp-mdpi/btn_shutter_default_disabled.png
Binary files differ
diff --git a/res/drawable-sw600dp-mdpi/btn_shutter_pressed.png b/res/drawable-sw600dp-mdpi/btn_shutter_pressed.png
index d8b29e6..88ae980 100644
--- a/res/drawable-sw600dp-mdpi/btn_shutter_pressed.png
+++ b/res/drawable-sw600dp-mdpi/btn_shutter_pressed.png
Binary files differ
diff --git a/res/drawable-sw600dp-mdpi/btn_shutter_pressed_disabled.png b/res/drawable-sw600dp-mdpi/btn_shutter_pressed_disabled.png
index 2b44284..b9940d7 100644
--- a/res/drawable-sw600dp-mdpi/btn_shutter_pressed_disabled.png
+++ b/res/drawable-sw600dp-mdpi/btn_shutter_pressed_disabled.png
Binary files differ
diff --git a/res/drawable-sw600dp-mdpi/btn_shutter_recording.png b/res/drawable-sw600dp-mdpi/btn_shutter_recording.png
index 5f56b49..8c28b18 100644
--- a/res/drawable-sw600dp-mdpi/btn_shutter_recording.png
+++ b/res/drawable-sw600dp-mdpi/btn_shutter_recording.png
Binary files differ
diff --git a/res/drawable-sw600dp-mdpi/btn_shutter_video_default.png b/res/drawable-sw600dp-mdpi/btn_shutter_video_default.png
index 67f5532..87a0a03 100644
--- a/res/drawable-sw600dp-mdpi/btn_shutter_video_default.png
+++ b/res/drawable-sw600dp-mdpi/btn_shutter_video_default.png
Binary files differ
diff --git a/res/drawable-sw600dp-mdpi/btn_shutter_video_pressed.png b/res/drawable-sw600dp-mdpi/btn_shutter_video_pressed.png
index 3a1e613..1e4d218 100644
--- a/res/drawable-sw600dp-mdpi/btn_shutter_video_pressed.png
+++ b/res/drawable-sw600dp-mdpi/btn_shutter_video_pressed.png
Binary files differ
diff --git a/res/drawable-sw600dp-mdpi/btn_shutter_video_recording.png b/res/drawable-sw600dp-mdpi/btn_shutter_video_recording.png
index ecf0276..a7865f5 100644
--- a/res/drawable-sw600dp-mdpi/btn_shutter_video_recording.png
+++ b/res/drawable-sw600dp-mdpi/btn_shutter_video_recording.png
Binary files differ
diff --git a/res/drawable-sw600dp-xhdpi-v19/btn_shutter_default.png b/res/drawable-sw600dp-xhdpi-v19/btn_shutter_default.png
index ae4cd8a..86d164c 100644
--- a/res/drawable-sw600dp-xhdpi-v19/btn_shutter_default.png
+++ b/res/drawable-sw600dp-xhdpi-v19/btn_shutter_default.png
Binary files differ
diff --git a/res/drawable-sw600dp-xhdpi-v19/btn_shutter_default_disabled.png b/res/drawable-sw600dp-xhdpi-v19/btn_shutter_default_disabled.png
index 2aa419c..989ea8e 100644
--- a/res/drawable-sw600dp-xhdpi-v19/btn_shutter_default_disabled.png
+++ b/res/drawable-sw600dp-xhdpi-v19/btn_shutter_default_disabled.png
Binary files differ
diff --git a/res/drawable-sw600dp-xhdpi-v19/btn_shutter_pressed.png b/res/drawable-sw600dp-xhdpi-v19/btn_shutter_pressed.png
index 08b5ee0..2d17380 100644
--- a/res/drawable-sw600dp-xhdpi-v19/btn_shutter_pressed.png
+++ b/res/drawable-sw600dp-xhdpi-v19/btn_shutter_pressed.png
Binary files differ
diff --git a/res/drawable-sw600dp-xhdpi-v19/btn_shutter_pressed_disabled.png b/res/drawable-sw600dp-xhdpi-v19/btn_shutter_pressed_disabled.png
index 93b73ff..9789709 100644
--- a/res/drawable-sw600dp-xhdpi-v19/btn_shutter_pressed_disabled.png
+++ b/res/drawable-sw600dp-xhdpi-v19/btn_shutter_pressed_disabled.png
Binary files differ
diff --git a/res/drawable-sw600dp-xhdpi-v19/btn_shutter_recording.png b/res/drawable-sw600dp-xhdpi-v19/btn_shutter_recording.png
index 26a2967..50e84cb 100644
--- a/res/drawable-sw600dp-xhdpi-v19/btn_shutter_recording.png
+++ b/res/drawable-sw600dp-xhdpi-v19/btn_shutter_recording.png
Binary files differ
diff --git a/res/drawable-sw600dp-xhdpi-v19/btn_shutter_video_default.png b/res/drawable-sw600dp-xhdpi-v19/btn_shutter_video_default.png
index caf8911..c826fe8 100644
--- a/res/drawable-sw600dp-xhdpi-v19/btn_shutter_video_default.png
+++ b/res/drawable-sw600dp-xhdpi-v19/btn_shutter_video_default.png
Binary files differ
diff --git a/res/drawable-sw600dp-xhdpi-v19/btn_shutter_video_pressed.png b/res/drawable-sw600dp-xhdpi-v19/btn_shutter_video_pressed.png
index c690338..bc1981e 100644
--- a/res/drawable-sw600dp-xhdpi-v19/btn_shutter_video_pressed.png
+++ b/res/drawable-sw600dp-xhdpi-v19/btn_shutter_video_pressed.png
Binary files differ
diff --git a/res/drawable-sw600dp-xhdpi-v19/btn_shutter_video_recording.png b/res/drawable-sw600dp-xhdpi-v19/btn_shutter_video_recording.png
index 9782f6f..36d6221 100644
--- a/res/drawable-sw600dp-xhdpi-v19/btn_shutter_video_recording.png
+++ b/res/drawable-sw600dp-xhdpi-v19/btn_shutter_video_recording.png
Binary files differ
diff --git a/res/drawable-sw600dp-xhdpi/btn_shutter_default.png b/res/drawable-sw600dp-xhdpi/btn_shutter_default.png
index b7aa393..c0014a6 100644
--- a/res/drawable-sw600dp-xhdpi/btn_shutter_default.png
+++ b/res/drawable-sw600dp-xhdpi/btn_shutter_default.png
Binary files differ
diff --git a/res/drawable-sw600dp-xhdpi/btn_shutter_default_disabled.png b/res/drawable-sw600dp-xhdpi/btn_shutter_default_disabled.png
index c31ec8a..f272314 100644
--- a/res/drawable-sw600dp-xhdpi/btn_shutter_default_disabled.png
+++ b/res/drawable-sw600dp-xhdpi/btn_shutter_default_disabled.png
Binary files differ
diff --git a/res/drawable-sw600dp-xhdpi/btn_shutter_pressed.png b/res/drawable-sw600dp-xhdpi/btn_shutter_pressed.png
index 4a08947..4717fc5 100644
--- a/res/drawable-sw600dp-xhdpi/btn_shutter_pressed.png
+++ b/res/drawable-sw600dp-xhdpi/btn_shutter_pressed.png
Binary files differ
diff --git a/res/drawable-sw600dp-xhdpi/btn_shutter_pressed_disabled.png b/res/drawable-sw600dp-xhdpi/btn_shutter_pressed_disabled.png
index 70974eb..d7be54e 100644
--- a/res/drawable-sw600dp-xhdpi/btn_shutter_pressed_disabled.png
+++ b/res/drawable-sw600dp-xhdpi/btn_shutter_pressed_disabled.png
Binary files differ
diff --git a/res/drawable-sw600dp-xhdpi/btn_shutter_recording.png b/res/drawable-sw600dp-xhdpi/btn_shutter_recording.png
index 0a0e108..e91347b 100644
--- a/res/drawable-sw600dp-xhdpi/btn_shutter_recording.png
+++ b/res/drawable-sw600dp-xhdpi/btn_shutter_recording.png
Binary files differ
diff --git a/res/drawable-sw600dp-xhdpi/btn_shutter_video_default.png b/res/drawable-sw600dp-xhdpi/btn_shutter_video_default.png
index acb8d21..0536628 100644
--- a/res/drawable-sw600dp-xhdpi/btn_shutter_video_default.png
+++ b/res/drawable-sw600dp-xhdpi/btn_shutter_video_default.png
Binary files differ
diff --git a/res/drawable-sw600dp-xhdpi/btn_shutter_video_pressed.png b/res/drawable-sw600dp-xhdpi/btn_shutter_video_pressed.png
index 7621341..a1bebd8 100644
--- a/res/drawable-sw600dp-xhdpi/btn_shutter_video_pressed.png
+++ b/res/drawable-sw600dp-xhdpi/btn_shutter_video_pressed.png
Binary files differ
diff --git a/res/drawable-sw600dp-xhdpi/btn_shutter_video_recording.png b/res/drawable-sw600dp-xhdpi/btn_shutter_video_recording.png
index aa3a4bd..6d13634 100644
--- a/res/drawable-sw600dp-xhdpi/btn_shutter_video_recording.png
+++ b/res/drawable-sw600dp-xhdpi/btn_shutter_video_recording.png
Binary files differ
diff --git a/res/drawable-sw600dp-xxhdpi-v19/btn_shutter_default.png b/res/drawable-sw600dp-xxhdpi-v19/btn_shutter_default.png
index bee6236..4aebbd1 100644
--- a/res/drawable-sw600dp-xxhdpi-v19/btn_shutter_default.png
+++ b/res/drawable-sw600dp-xxhdpi-v19/btn_shutter_default.png
Binary files differ
diff --git a/res/drawable-sw600dp-xxhdpi-v19/btn_shutter_default_disabled.png b/res/drawable-sw600dp-xxhdpi-v19/btn_shutter_default_disabled.png
index 93043be..2f4a965 100644
--- a/res/drawable-sw600dp-xxhdpi-v19/btn_shutter_default_disabled.png
+++ b/res/drawable-sw600dp-xxhdpi-v19/btn_shutter_default_disabled.png
Binary files differ
diff --git a/res/drawable-sw600dp-xxhdpi-v19/btn_shutter_pressed.png b/res/drawable-sw600dp-xxhdpi-v19/btn_shutter_pressed.png
index e1f75a5..feb5769 100644
--- a/res/drawable-sw600dp-xxhdpi-v19/btn_shutter_pressed.png
+++ b/res/drawable-sw600dp-xxhdpi-v19/btn_shutter_pressed.png
Binary files differ
diff --git a/res/drawable-sw600dp-xxhdpi-v19/btn_shutter_pressed_disabled.png b/res/drawable-sw600dp-xxhdpi-v19/btn_shutter_pressed_disabled.png
index 31a9788..86c469d 100644
--- a/res/drawable-sw600dp-xxhdpi-v19/btn_shutter_pressed_disabled.png
+++ b/res/drawable-sw600dp-xxhdpi-v19/btn_shutter_pressed_disabled.png
Binary files differ
diff --git a/res/drawable-sw600dp-xxhdpi-v19/btn_shutter_recording.png b/res/drawable-sw600dp-xxhdpi-v19/btn_shutter_recording.png
index 6627a70..7dbf092 100644
--- a/res/drawable-sw600dp-xxhdpi-v19/btn_shutter_recording.png
+++ b/res/drawable-sw600dp-xxhdpi-v19/btn_shutter_recording.png
Binary files differ
diff --git a/res/drawable-sw600dp-xxhdpi-v19/btn_shutter_video_default.png b/res/drawable-sw600dp-xxhdpi-v19/btn_shutter_video_default.png
index 20a5e28..6569c79 100644
--- a/res/drawable-sw600dp-xxhdpi-v19/btn_shutter_video_default.png
+++ b/res/drawable-sw600dp-xxhdpi-v19/btn_shutter_video_default.png
Binary files differ
diff --git a/res/drawable-sw600dp-xxhdpi-v19/btn_shutter_video_pressed.png b/res/drawable-sw600dp-xxhdpi-v19/btn_shutter_video_pressed.png
index 51ea45b..eb89ed3 100644
--- a/res/drawable-sw600dp-xxhdpi-v19/btn_shutter_video_pressed.png
+++ b/res/drawable-sw600dp-xxhdpi-v19/btn_shutter_video_pressed.png
Binary files differ
diff --git a/res/drawable-sw600dp-xxhdpi-v19/btn_shutter_video_recording.png b/res/drawable-sw600dp-xxhdpi-v19/btn_shutter_video_recording.png
index 350fc85..52145b4 100644
--- a/res/drawable-sw600dp-xxhdpi-v19/btn_shutter_video_recording.png
+++ b/res/drawable-sw600dp-xxhdpi-v19/btn_shutter_video_recording.png
Binary files differ
diff --git a/res/drawable-sw600dp-xxhdpi/btn_shutter_default.png b/res/drawable-sw600dp-xxhdpi/btn_shutter_default.png
new file mode 100644
index 0000000..4aebbd1
--- /dev/null
+++ b/res/drawable-sw600dp-xxhdpi/btn_shutter_default.png
Binary files differ
diff --git a/res/drawable-sw600dp-xxhdpi/btn_shutter_default_disabled.png b/res/drawable-sw600dp-xxhdpi/btn_shutter_default_disabled.png
index 93043be..565bd41 100644
--- a/res/drawable-sw600dp-xxhdpi/btn_shutter_default_disabled.png
+++ b/res/drawable-sw600dp-xxhdpi/btn_shutter_default_disabled.png
Binary files differ
diff --git a/res/drawable-sw600dp-xxhdpi/btn_shutter_pressed.png b/res/drawable-sw600dp-xxhdpi/btn_shutter_pressed.png
new file mode 100644
index 0000000..e5e676a
--- /dev/null
+++ b/res/drawable-sw600dp-xxhdpi/btn_shutter_pressed.png
Binary files differ
diff --git a/res/drawable-sw600dp-xxhdpi/btn_shutter_pressed_disabled.png b/res/drawable-sw600dp-xxhdpi/btn_shutter_pressed_disabled.png
index 4ebc18f..17cc880 100644
--- a/res/drawable-sw600dp-xxhdpi/btn_shutter_pressed_disabled.png
+++ b/res/drawable-sw600dp-xxhdpi/btn_shutter_pressed_disabled.png
Binary files differ
diff --git a/res/drawable-sw600dp-xxhdpi/btn_shutter_recording.png b/res/drawable-sw600dp-xxhdpi/btn_shutter_recording.png
new file mode 100644
index 0000000..7dbf092
--- /dev/null
+++ b/res/drawable-sw600dp-xxhdpi/btn_shutter_recording.png
Binary files differ
diff --git a/res/drawable-sw600dp-xxhdpi/btn_shutter_video_default.png b/res/drawable-sw600dp-xxhdpi/btn_shutter_video_default.png
new file mode 100644
index 0000000..6569c79
--- /dev/null
+++ b/res/drawable-sw600dp-xxhdpi/btn_shutter_video_default.png
Binary files differ
diff --git a/res/drawable-sw600dp-xxhdpi/btn_shutter_video_pressed.png b/res/drawable-sw600dp-xxhdpi/btn_shutter_video_pressed.png
new file mode 100644
index 0000000..51ea45b
--- /dev/null
+++ b/res/drawable-sw600dp-xxhdpi/btn_shutter_video_pressed.png
Binary files differ
diff --git a/res/drawable-sw600dp-xxhdpi/btn_shutter_video_recording.png b/res/drawable-sw600dp-xxhdpi/btn_shutter_video_recording.png
new file mode 100644
index 0000000..52145b4
--- /dev/null
+++ b/res/drawable-sw600dp-xxhdpi/btn_shutter_video_recording.png
Binary files differ
diff --git a/res/layout/panorama_module.xml b/res/layout/panorama_module.xml
index 3711cc6..0b2785a 100644
--- a/res/layout/panorama_module.xml
+++ b/res/layout/panorama_module.xml
@@ -14,8 +14,7 @@
limitations under the License.
-->
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/pano_layout"
+<merge xmlns:android="http://schemas.android.com/apk/res/android"
android:clickable="true"
android:layout_width="match_parent"
android:layout_height="match_parent">
@@ -24,4 +23,4 @@
<include layout="@layout/camera_controls"
android:layout_gravity="center"
style="@style/CameraControls"/>
-</FrameLayout>
+</merge>
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index 52d0e4d..ab46e02 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -334,6 +334,35 @@
}
@Override
+ public void onReload() {
+ setPreviewControlsVisibility(true);
+ }
+
+ @Override
+ public void onCurrentDataCentered(int dataID) {
+ if (dataID != 0 && !mFilmStripView.isCameraPreview()) {
+ // For now, We ignore all items that are not the camera preview.
+ return;
+ }
+
+ if(!arePreviewControlsVisible()) {
+ setPreviewControlsVisibility(true);
+ }
+ }
+
+ @Override
+ public void onCurrentDataOffCentered(int dataID) {
+ if (dataID != 0 && !mFilmStripView.isCameraPreview()) {
+ // For now, We ignore all items that are not the camera preview.
+ return;
+ }
+
+ if (arePreviewControlsVisible()) {
+ setPreviewControlsVisibility(false);
+ }
+ }
+
+ @Override
public void onDataFocusChanged(final int dataID, final boolean focused) {
// Delay hiding action bar if there is any user interaction
if (mMainHandler.hasMessages(HIDE_ACTION_BAR)) {
@@ -363,10 +392,10 @@
hidePanoStitchingProgress();
} else {
if (isCameraID) {
- mCurrentModule.onPreviewFocusChanged(true);
// Don't show the action bar in Camera
// preview.
CameraActivity.this.setSystemBarsVisibility(false);
+
if (mPendingDeletion) {
performDeletion();
}
@@ -1449,6 +1478,26 @@
}
}
+
+ /**
+ * Check whether camera controls are visible.
+ *
+ * @return whether controls are visible.
+ */
+ private boolean arePreviewControlsVisible() {
+ return mCurrentModule.arePreviewControlsVisible();
+ }
+
+ /**
+ * Show or hide the {@link CameraControls} using the current module's
+ * implementation of {@link #onPreviewFocusChanged}.
+ *
+ * @param showControls whether to show camera controls.
+ */
+ private void setPreviewControlsVisibility(boolean showControls) {
+ mCurrentModule.onPreviewFocusChanged(showControls);
+ }
+
// Accessor methods for getting latency times used in performance testing
public long getAutoFocusTime() {
return (mCurrentModule instanceof PhotoModule) ?
diff --git a/src/com/android/camera/CameraModule.java b/src/com/android/camera/CameraModule.java
index 1283a98..55cae9f 100644
--- a/src/com/android/camera/CameraModule.java
+++ b/src/com/android/camera/CameraModule.java
@@ -64,4 +64,6 @@
public void onShowSwitcherPopup();
public void onMediaSaveServiceConnected(MediaSaveService s);
+
+ public boolean arePreviewControlsVisible();
}
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 8699ef0..bed8a21 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -1944,6 +1944,11 @@
mUI.onPreviewFocusChanged(previewFocused);
}
+ @Override
+ public boolean arePreviewControlsVisible() {
+ return mUI.arePreviewControlsVisible();
+ }
+
// For debugging only.
public void setDebugUri(Uri uri) {
mDebugUri = uri;
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java
index 9273e21..58df436 100644
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -398,6 +398,10 @@
mCameraControls.setVisibility(View.VISIBLE);
}
+ public boolean arePreviewControlsVisible() {
+ return (mCameraControls.getVisibility() == View.VISIBLE);
+ }
+
public void hideSwitcher() {
mSwitcher.closePopup();
mSwitcher.setVisibility(View.INVISIBLE);
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index 012376c..fdd48e2 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -136,6 +136,7 @@
// examined by the user.
private String mCurrentVideoFilename;
private Uri mCurrentVideoUri;
+ private boolean mCurrentVideoUriFromMediaSaved;
private ContentValues mCurrentVideoValues;
private CamcorderProfile mProfile;
@@ -162,8 +163,6 @@
private OrientationManager mOrientationManager;
private int mPendingSwitchCameraId;
- private boolean mOpenCameraFail;
- private boolean mCameraDisabled;
private final Handler mHandler = new MainHandler();
private VideoUI mUI;
private CameraProxy mCameraDevice;
@@ -179,6 +178,7 @@
public void onMediaSaved(Uri uri) {
if (uri != null) {
mCurrentVideoUri = uri;
+ mCurrentVideoUriFromMediaSaved = true;
onVideoSaved();
mActivity.notifyNewMedia(uri);
}
@@ -350,11 +350,7 @@
// Make sure camera device is opened.
try {
cameraOpenThread.join();
- if (mOpenCameraFail) {
- CameraUtil.showErrorAndFinish(mActivity, R.string.cannot_connect_camera);
- return;
- } else if (mCameraDisabled) {
- CameraUtil.showErrorAndFinish(mActivity, R.string.camera_disabled);
+ if (mCameraDevice == null) {
return;
}
} catch (InterruptedException ex) {
@@ -478,11 +474,8 @@
// TODO: It should be better to not even insert the URI at all before we
// confirm done in review, which means we need to handle temporary video
// files in a quite different way than we currently had.
- // When the video capture intent doesn't contain the Uri info and the
- // review is cancelled before taking a video, mCurrentVideoUri can be
- // null. Also make sure we don't delete the Uri sent from the video
- // capture intent.
- if (mIsInReviewMode && mCurrentVideoUri != null) {
+ // Make sure we don't delete the Uri sent from the video capture intent.
+ if (mCurrentVideoUriFromMediaSaved) {
mContentResolver.delete(mCurrentVideoUri, null, null);
}
mIsInReviewMode = false;
@@ -604,6 +597,9 @@
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
private void getDesiredPreviewSize() {
+ if (mCameraDevice == null) {
+ return;
+ }
mParameters = mCameraDevice.getParameters();
if (mParameters.getSupportedVideoSizes() == null) {
mDesiredPreviewWidth = mProfile.videoFrameWidth;
@@ -653,9 +649,6 @@
@Override
public void onResumeAfterSuper() {
- if (mOpenCameraFail || mCameraDisabled) {
- return;
- }
mUI.enableShutter(false);
mZoomValue = 0;
@@ -663,12 +656,7 @@
if (!mPreviewing) {
openCamera();
- if (mOpenCameraFail) {
- CameraUtil.showErrorAndFinish(mActivity,
- R.string.cannot_connect_camera);
- return;
- } else if (mCameraDisabled) {
- CameraUtil.showErrorAndFinish(mActivity, R.string.camera_disabled);
+ if (mCameraDevice == null) {
return;
}
readVideoPreferences();
@@ -735,7 +723,10 @@
Log.v(TAG, "startPreview");
SurfaceTexture surfaceTexture = mUI.getSurfaceTexture();
- if (!mPreferenceRead || surfaceTexture == null || mPaused == true) return;
+ if (!mPreferenceRead || surfaceTexture == null || mPaused == true ||
+ mCameraDevice == null) {
+ return;
+ }
mCameraDevice.setErrorCallback(mErrorCallback);
if (mPreviewing == true) {
@@ -754,12 +745,6 @@
} catch (Throwable ex) {
closeCamera();
throw new RuntimeException("startPreview failed", ex);
- } finally {
- if (mOpenCameraFail) {
- CameraUtil.showErrorAndFinish(mActivity, R.string.cannot_connect_camera);
- } else if (mCameraDisabled) {
- CameraUtil.showErrorAndFinish(mActivity, R.string.camera_disabled);
- }
}
}
@@ -962,6 +947,7 @@
long requestedSizeLimit = 0;
closeVideoFileDescriptor();
+ mCurrentVideoUriFromMediaSaved = false;
if (mIsVideoCaptureIntent && myExtras != null) {
Uri saveUri = (Uri) myExtras.getParcelable(MediaStore.EXTRA_OUTPUT);
if (saveUri != null) {
@@ -1717,6 +1703,11 @@
forceFlashOff(!previewFocused);
}
+ @Override
+ public boolean arePreviewControlsVisible() {
+ return mUI.arePreviewControlsVisible();
+ }
+
private final class JpegPictureCallback implements CameraPictureCallback {
Location mLocation;
diff --git a/src/com/android/camera/VideoUI.java b/src/com/android/camera/VideoUI.java
index f097d93..23d08db 100644
--- a/src/com/android/camera/VideoUI.java
+++ b/src/com/android/camera/VideoUI.java
@@ -345,6 +345,10 @@
mCameraControls.setVisibility(View.VISIBLE);
}
+ public boolean arePreviewControlsVisible() {
+ return (mCameraControls.getVisibility() == View.VISIBLE);
+ }
+
public void hideSwitcher() {
mSwitcher.closePopup();
mSwitcher.setVisibility(View.INVISIBLE);
diff --git a/src/com/android/camera/WideAnglePanoramaModule.java b/src/com/android/camera/WideAnglePanoramaModule.java
index 189bf99..aa66bdc 100644
--- a/src/com/android/camera/WideAnglePanoramaModule.java
+++ b/src/com/android/camera/WideAnglePanoramaModule.java
@@ -144,6 +144,7 @@
private OrientationManager mOrientationManager;
private ComboPreferences mPreferences;
private boolean mMosaicPreviewConfigured;
+ private boolean mPreviewFocused;
@Override
public void onPreviewUIReady() {
@@ -308,11 +309,13 @@
@Override
public void onPreviewFocusChanged(boolean previewFocused) {
- if (previewFocused) {
- mUI.showUI();
- } else {
- mUI.hideUI();
- }
+ mPreviewFocused = previewFocused;
+ mUI.onPreviewFocusChanged(previewFocused);
+ }
+
+ @Override
+ public boolean arePreviewControlsVisible() {
+ return mUI.arePreviewControlsVisible();
}
/**
@@ -454,7 +457,7 @@
final boolean isLandscape =
(mActivity.getResources().getConfiguration().orientation ==
Configuration.ORIENTATION_LANDSCAPE);
-
+ mUI.flipPreviewIfNeeded();
MosaicPreviewRenderer renderer = new MosaicPreviewRenderer(
mUI.getSurfaceTexture(),
mPreviewUIWidth, mPreviewUIHeight, isLandscape);
@@ -705,7 +708,9 @@
mActivity.setSwipingEnabled(true);
// Orientation change will trigger onLayoutChange->configMosaicPreview->
// resetToPreview. Do not show the capture UI in film strip.
- mUI.showPreviewUI();
+ if (mPreviewFocused) {
+ mUI.showPreviewUI();
+ }
mMosaicFrameProcessor.reset();
}
@@ -819,6 +824,7 @@
mWaitProcessorTask = null;
}
resetScreenOn();
+ mUI.removeDisplayChangeListener();
if (mSoundPlayer != null) {
mSoundPlayer.release();
mSoundPlayer = null;
@@ -879,7 +885,7 @@
boolean recordLocation = RecordLocationPreference.get(mPreferences,
mContentResolver);
mLocationManager.recordLocation(recordLocation);
-
+ mUI.initDisplayChangeListener();
UsageStatistics.onContentViewChanged(
UsageStatistics.COMPONENT_CAMERA, "PanoramaModule");
}
diff --git a/src/com/android/camera/WideAnglePanoramaUI.java b/src/com/android/camera/WideAnglePanoramaUI.java
index 4071609..da49638 100644
--- a/src/com/android/camera/WideAnglePanoramaUI.java
+++ b/src/com/android/camera/WideAnglePanoramaUI.java
@@ -43,6 +43,7 @@
import com.android.camera.ui.CameraControls;
import com.android.camera.ui.CameraRootView;
import com.android.camera.ui.ModuleSwitcher;
+import com.android.camera.util.CameraUtil;
import com.android.camera2.R;
/**
@@ -51,6 +52,7 @@
public class WideAnglePanoramaUI implements
TextureView.SurfaceTextureListener,
ShutterButton.OnShutterButtonListener,
+ CameraRootView.MyDisplayListener,
View.OnLayoutChangeListener {
@SuppressWarnings("unused")
@@ -61,7 +63,6 @@
private ViewGroup mRootView;
private ModuleSwitcher mSwitcher;
- private ViewGroup mPanoLayout;
private FrameLayout mCaptureLayout;
private View mReviewLayout;
private ImageView mReview;
@@ -137,6 +138,18 @@
mCameraControls.setVisibility(View.VISIBLE);
}
+ public void onPreviewFocusChanged(boolean previewFocused) {
+ if (previewFocused) {
+ showUI();
+ } else {
+ hideUI();
+ }
+ }
+
+ public boolean arePreviewControlsVisible() {
+ return (mCameraControls.getVisibility() == View.VISIBLE);
+ }
+
public void showSwitcher() {
mSwitcher.setVisibility(View.VISIBLE);
}
@@ -274,7 +287,7 @@
mReviewControl.removeAllViews();
inflater.inflate(R.layout.pano_review_control, mReviewControl, true);
- mPanoLayout.bringChildToFront(mCameraControls);
+ mRootView.bringChildToFront(mCameraControls);
setViews(mActivity.getResources());
if (threadRunning) {
mReview.setImageDrawable(lowResReview);
@@ -333,7 +346,6 @@
mReviewBackground = appRes.getColor(R.color.review_background);
mIndicatorColorFast = appRes.getColor(R.color.pano_progress_indication_fast);
- mPanoLayout = (ViewGroup) mRootView.findViewById(R.id.pano_layout);
mPreviewLayout = mRootView.findViewById(R.id.pano_preview_layout);
mReviewControl = (ViewGroup) mRootView.findViewById(R.id.pano_review_control);
mReviewLayout = mRootView.findViewById(R.id.pano_review_layout);
@@ -418,6 +430,29 @@
mRightIndicator.setEnabled(false);
}
+ public void flipPreviewIfNeeded() {
+ if (CameraUtil.getDisplayRotation(mActivity) >= 180) {
+ // In either reverse landscape or reverse portrait
+ mTextureView.setRotation(180);
+ } else {
+ mTextureView.setRotation(0);
+ }
+ }
+
+ @Override
+ public void onDisplayChanged() {
+ mCameraControls.checkLayoutFlip();
+ flipPreviewIfNeeded();
+ }
+
+ public void initDisplayChangeListener() {
+ ((CameraRootView) mRootView).setDisplayChangeListener(this);
+ }
+
+ public void removeDisplayChangeListener() {
+ ((CameraRootView) mRootView).removeDisplayChangeListener();
+ }
+
private class DialogHelper {
private ProgressDialog mProgressDialog;
private AlertDialog mAlertDialog;
diff --git a/src/com/android/camera/ui/FilmStripView.java b/src/com/android/camera/ui/FilmStripView.java
index 5de2d7c..074f80b 100644
--- a/src/com/android/camera/ui/FilmStripView.java
+++ b/src/com/android/camera/ui/FilmStripView.java
@@ -340,6 +340,27 @@
public void onDataFullScreenChange(int dataID, boolean fullScreen);
/**
+ * Called by {@link reload}.
+ */
+ public void onReload();
+
+ /**
+ * Called by {@link checkCurrentDataCentered} when the
+ * data is centered in the film strip.
+ *
+ * @param dataID the ID of the local data
+ */
+ public void onCurrentDataCentered(int dataID);
+
+ /**
+ * Called by {@link checkCurrentDataCentered} when the
+ * data is off centered in the film strip.
+ *
+ * @param dataID the ID of the local data
+ */
+ public void onCurrentDataOffCentered(int dataID);
+
+ /**
* The callback when the item is centered/off-centered.
*
* @param dataID The ID of the image data.
@@ -712,7 +733,7 @@
* @param id The id of the data to check.
* @return {@code True} if the data is currently at the center.
*/
- protected boolean isDataAtCenter(int id) {
+ private boolean isDataAtCenter(int id) {
if (mViewItem[mCurrentItem] == null) {
return false;
}
@@ -763,6 +784,11 @@
private void measureViewItem(ViewItem item, int boundWidth, int boundHeight) {
int id = item.getId();
ImageData imageData = mDataAdapter.getImageData(id);
+ if (imageData == null) {
+ Log.e(TAG, "trying to measure a null item");
+ return;
+ }
+
int[] dim = calculateChildDimension(imageData.getWidth(), imageData.getHeight(),
imageData.getOrientation(), boundWidth, boundHeight);
@@ -826,6 +852,7 @@
if (nearest == BUFFER_SIZE) {
return -1;
}
+
int min = Math.abs(pointX - mViewItem[nearest].getCenterX());
for (int itemID = nearest + 1; itemID < BUFFER_SIZE && mViewItem[itemID] != null; itemID++) {
@@ -870,8 +897,11 @@
if (itemID >= mViewItem.length || mViewItem[itemID] == null) {
return;
}
-
ImageData data = mDataAdapter.getImageData(mViewItem[itemID].getId());
+ if (data == null) {
+ Log.e(TAG, "trying to remove a null item");
+ return;
+ }
checkForRemoval(data, mViewItem[itemID].getView());
mViewItem[itemID] = null;
}
@@ -961,10 +991,28 @@
if (stopScroll) {
mCenterX = curr.getCenterX();
}
+
return stopScroll;
}
/**
+ * Checks if the item is centered in the film strip, and calls
+ * {@link #onCurrentDataCentered} or {@link #onCurrentDataOffCentered}.
+ * TODO: refactor.
+ *
+ * @param dataID the ID of the image data.
+ */
+ private void checkCurrentDataCentered(int dataID) {
+ if (mListener != null) {
+ if (isDataAtCenter(dataID)) {
+ mListener.onCurrentDataCentered(dataID);
+ } else {
+ mListener.onCurrentDataOffCentered(dataID);
+ }
+ }
+ }
+
+ /**
* Reorders the child views to be consistent with their data ID. This
* method should be called after adding/removing views.
*/
@@ -1026,6 +1074,13 @@
* has been checked for button visibilities
*/
private void updateBottomControls(boolean force) {
+ if (mActivity.isSecureCamera()) {
+ // We cannot show buttons in secure camera that send out of app intents,
+ // because another app with the same name can parade as the intented
+ // Activity.
+ return;
+ }
+
if (mBottomControls == null) {
mBottomControls = (FilmstripBottomControls) ((View) getParent())
.findViewById(R.id.filmstrip_bottom_controls);
@@ -1034,7 +1089,6 @@
}
final int requestId = getCurrentId();
-
if (requestId < 0) {
return;
}
@@ -1688,6 +1742,10 @@
return (mScale == FULL_SCREEN_SCALE);
}
+ public boolean isCameraPreview() {
+ return (getCurrentViewType() == ImageData.VIEW_TYPE_STICKY);
+ }
+
public boolean inCameraFullscreen() {
return isDataAtCenter(0) && inFullScreen()
&& (getCurrentViewType() == ImageData.VIEW_TYPE_STICKY);
@@ -1745,7 +1803,12 @@
return;
}
removeView(item.getView());
+
ImageData data = mDataAdapter.getImageData(item.getId());
+ if (data == null) {
+ Log.e(TAG, "trying recycle a null item");
+ return;
+ }
data.recycle();
ViewItem newItem = buildItemFromData(item.getId());
@@ -1758,7 +1821,10 @@
}
newItem.copyGeometry(item);
mViewItem[itemID] = newItem;
- if (clampCenterX()) {
+
+ boolean stopScroll = clampCenterX();
+ checkCurrentDataCentered(getCurrentId());
+ if (stopScroll) {
mController.stopScrolling(true);
}
adjustChildZOrder();
@@ -1883,6 +1949,7 @@
invalidate();
if (mListener != null) {
+ mListener.onReload();
mListener.onDataFocusChanged(mViewItem[mCurrentItem].getId(), true);
}
}
@@ -1917,7 +1984,10 @@
@Override
public void onScrollUpdate(int currX, int currY) {
mCenterX = currX;
- if (clampCenterX()) {
+
+ boolean stopScroll = clampCenterX();
+ checkCurrentDataCentered(getCurrentId());
+ if (stopScroll) {
mController.stopScrolling(true);
}
invalidate();
@@ -2056,7 +2126,10 @@
return;
}
mCenterX += deltaX;
- if (clampCenterX()) {
+
+ boolean stopScroll = clampCenterX();
+ checkCurrentDataCentered(getCurrentId());
+ if (stopScroll) {
mController.stopScrolling(true);
}
invalidate();
@@ -2201,6 +2274,8 @@
mCanStopScroll = interruptible;
mScroller.startScroll(mCenterX, 0, position - mCenterX,
0, duration);
+
+ checkCurrentDataCentered(mViewItem[mCurrentItem].getId());
}
@Override
diff --git a/src/com/android/camera/util/CameraUtil.java b/src/com/android/camera/util/CameraUtil.java
index 0653199..458ae04 100644
--- a/src/com/android/camera/util/CameraUtil.java
+++ b/src/com/android/camera/util/CameraUtil.java
@@ -55,6 +55,7 @@
import com.android.camera.CameraDisabledException;
import com.android.camera.CameraHolder;
import com.android.camera.CameraManager;
+import com.android.camera.util.IntentHelper;
import com.android.camera2.R;
import java.io.Closeable;
@@ -865,8 +866,7 @@
try {
boolean isSecureCamera = ((CameraActivity)activity).isSecureCamera();
if (!isSecureCamera) {
- Intent intent = new Intent(Intent.ACTION_VIEW)
- .setDataAndType(uri, "video/*")
+ Intent intent = IntentHelper.getVideoPlayerIntent(activity, uri)
.putExtra(Intent.EXTRA_TITLE, title)
.putExtra(KEY_TREAT_UP_AS_BACK, true);
activity.startActivityForResult(intent, CameraActivity.REQ_CODE_DONT_SWITCH_TO_PREVIEW);
@@ -940,8 +940,7 @@
*/
public static boolean launchGallery(Context ctx) {
if (ApiHelper.HAS_APP_GALLERY) {
- ctx.startActivity(Intent.makeMainSelectorActivity(
- Intent.ACTION_MAIN, Intent.CATEGORY_APP_GALLERY));
+ ctx.startActivity(IntentHelper.getGalleryIntent(ctx));
return true;
}
return false;
diff --git a/src_pd/com/android/camera/util/IntentHelper.java b/src_pd/com/android/camera/util/IntentHelper.java
new file mode 100644
index 0000000..a6c2c37
--- /dev/null
+++ b/src_pd/com/android/camera/util/IntentHelper.java
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+package com.android.camera.util;
+
+import android.content.Context;
+import android.content.Intent;
+import android.net.Uri;
+
+public class IntentHelper {
+
+ private static final String GALLERY_PACKAGE_NAME = "com.android.gallery3d";
+ private static final String GALLERY_ACTIVITY_CLASS =
+ "com.android.gallery3d.app.GalleryActivity";
+
+ public static Intent getGalleryIntent(Context context) {
+ return new Intent(Intent.ACTION_MAIN)
+ .setClassName(GALLERY_PACKAGE_NAME, GALLERY_ACTIVITY_CLASS);
+ }
+
+ public static Intent getVideoPlayerIntent(Context context, Uri uri) {
+ return new Intent(Intent.ACTION_VIEW)
+ .setPackage(GALLERY_PACKAGE_NAME)
+ .setDataAndType(uri, "video/*");
+ }
+}