diff options
72 files changed, 168 insertions, 121 deletions
diff --git a/res/drawable-hdpi/bg_camera_pattern.jpg b/res/drawable-hdpi/bg_camera_pattern.jpg Binary files differdeleted file mode 100644 index d0c290f..0000000 --- a/res/drawable-hdpi/bg_camera_pattern.jpg +++ /dev/null diff --git a/res/drawable-hdpi/bg_camera_pattern.png b/res/drawable-hdpi/bg_camera_pattern.png Binary files differnew file mode 100644 index 0000000..82296d3 --- /dev/null +++ b/res/drawable-hdpi/bg_camera_pattern.png diff --git a/res/drawable-hdpi/bg_ring_control_holo.9.png b/res/drawable-hdpi/bg_ring_control_holo.9.png Binary files differdeleted file mode 100644 index 51cd387..0000000 --- a/res/drawable-hdpi/bg_ring_control_holo.9.png +++ /dev/null diff --git a/res/drawable-hdpi/btn_camera_shutter_holo.png b/res/drawable-hdpi/btn_camera_shutter_holo.png Binary files differnew file mode 100644 index 0000000..443a42b --- /dev/null +++ b/res/drawable-hdpi/btn_camera_shutter_holo.png diff --git a/res/drawable-hdpi/btn_camera_shutter_pressed_holo.png b/res/drawable-hdpi/btn_camera_shutter_pressed_holo.png Binary files differnew file mode 100644 index 0000000..c1fd6d1 --- /dev/null +++ b/res/drawable-hdpi/btn_camera_shutter_pressed_holo.png diff --git a/res/drawable-hdpi/btn_shutter_normal.png b/res/drawable-hdpi/btn_shutter_normal.png Binary files differdeleted file mode 100644 index d815d2e..0000000 --- a/res/drawable-hdpi/btn_shutter_normal.png +++ /dev/null diff --git a/res/drawable-hdpi/btn_shutter_pressed.png b/res/drawable-hdpi/btn_shutter_pressed.png Binary files differdeleted file mode 100644 index eed68f2..0000000 --- a/res/drawable-hdpi/btn_shutter_pressed.png +++ /dev/null diff --git a/res/drawable-hdpi/btn_video_shutter_holo.png b/res/drawable-hdpi/btn_video_shutter_holo.png Binary files differnew file mode 100644 index 0000000..f43b938 --- /dev/null +++ b/res/drawable-hdpi/btn_video_shutter_holo.png diff --git a/res/drawable-hdpi/btn_video_shutter_pressed_holo.png b/res/drawable-hdpi/btn_video_shutter_pressed_holo.png Binary files differnew file mode 100644 index 0000000..9bdc2b1 --- /dev/null +++ b/res/drawable-hdpi/btn_video_shutter_pressed_holo.png diff --git a/res/drawable-mdpi/bg_camera_pattern.jpg b/res/drawable-mdpi/bg_camera_pattern.jpg Binary files differdeleted file mode 100644 index d0c290f..0000000 --- a/res/drawable-mdpi/bg_camera_pattern.jpg +++ /dev/null diff --git a/res/drawable-mdpi/bg_camera_pattern.png b/res/drawable-mdpi/bg_camera_pattern.png Binary files differnew file mode 100644 index 0000000..f5694a2 --- /dev/null +++ b/res/drawable-mdpi/bg_camera_pattern.png diff --git a/res/drawable-mdpi/bg_ring_control_holo.9.png b/res/drawable-mdpi/bg_ring_control_holo.9.png Binary files differdeleted file mode 100644 index 51cd387..0000000 --- a/res/drawable-mdpi/bg_ring_control_holo.9.png +++ /dev/null diff --git a/res/drawable-mdpi/btn_camera_shutter_holo.png b/res/drawable-mdpi/btn_camera_shutter_holo.png Binary files differnew file mode 100644 index 0000000..e03a5bd --- /dev/null +++ b/res/drawable-mdpi/btn_camera_shutter_holo.png diff --git a/res/drawable-mdpi/btn_camera_shutter_pressed_holo.png b/res/drawable-mdpi/btn_camera_shutter_pressed_holo.png Binary files differnew file mode 100644 index 0000000..5e3abe3 --- /dev/null +++ b/res/drawable-mdpi/btn_camera_shutter_pressed_holo.png diff --git a/res/drawable-mdpi/btn_shutter_normal.png b/res/drawable-mdpi/btn_shutter_normal.png Binary files differdeleted file mode 100755 index b35cf44..0000000 --- a/res/drawable-mdpi/btn_shutter_normal.png +++ /dev/null diff --git a/res/drawable-mdpi/btn_shutter_pressed.png b/res/drawable-mdpi/btn_shutter_pressed.png Binary files differdeleted file mode 100755 index 49458ff..0000000 --- a/res/drawable-mdpi/btn_shutter_pressed.png +++ /dev/null diff --git a/res/drawable-mdpi/btn_video_shutter_holo.png b/res/drawable-mdpi/btn_video_shutter_holo.png Binary files differnew file mode 100644 index 0000000..6274e66 --- /dev/null +++ b/res/drawable-mdpi/btn_video_shutter_holo.png diff --git a/res/drawable-mdpi/btn_video_shutter_pressed_holo.png b/res/drawable-mdpi/btn_video_shutter_pressed_holo.png Binary files differnew file mode 100644 index 0000000..93610b3 --- /dev/null +++ b/res/drawable-mdpi/btn_video_shutter_pressed_holo.png diff --git a/res/drawable-w1024dp-hdpi/bg_camera_pattern.png b/res/drawable-w1024dp-hdpi/bg_camera_pattern.png Binary files differnew file mode 100644 index 0000000..fff5d52 --- /dev/null +++ b/res/drawable-w1024dp-hdpi/bg_camera_pattern.png diff --git a/res/drawable-w1024dp-hdpi/btn_camera_shutter_holo.png b/res/drawable-w1024dp-hdpi/btn_camera_shutter_holo.png Binary files differnew file mode 100644 index 0000000..0661b2e --- /dev/null +++ b/res/drawable-w1024dp-hdpi/btn_camera_shutter_holo.png diff --git a/res/drawable-w1024dp-hdpi/btn_camera_shutter_pressed_holo.png b/res/drawable-w1024dp-hdpi/btn_camera_shutter_pressed_holo.png Binary files differnew file mode 100644 index 0000000..9926f39 --- /dev/null +++ b/res/drawable-w1024dp-hdpi/btn_camera_shutter_pressed_holo.png diff --git a/res/drawable-w1024dp-hdpi/btn_video_shutter_holo.png b/res/drawable-w1024dp-hdpi/btn_video_shutter_holo.png Binary files differnew file mode 100644 index 0000000..886c1d9 --- /dev/null +++ b/res/drawable-w1024dp-hdpi/btn_video_shutter_holo.png diff --git a/res/drawable-w1024dp-hdpi/btn_video_shutter_pressed_holo.png b/res/drawable-w1024dp-hdpi/btn_video_shutter_pressed_holo.png Binary files differnew file mode 100644 index 0000000..e976ba8 --- /dev/null +++ b/res/drawable-w1024dp-hdpi/btn_video_shutter_pressed_holo.png diff --git a/res/drawable-w1024dp-mdpi/bg_camera_pattern.png b/res/drawable-w1024dp-mdpi/bg_camera_pattern.png Binary files differnew file mode 100644 index 0000000..7b120f6 --- /dev/null +++ b/res/drawable-w1024dp-mdpi/bg_camera_pattern.png diff --git a/res/drawable-w1024dp-mdpi/btn_camera_shutter_holo.png b/res/drawable-w1024dp-mdpi/btn_camera_shutter_holo.png Binary files differnew file mode 100644 index 0000000..edb317b --- /dev/null +++ b/res/drawable-w1024dp-mdpi/btn_camera_shutter_holo.png diff --git a/res/drawable-w1024dp-mdpi/btn_camera_shutter_pressed_holo.png b/res/drawable-w1024dp-mdpi/btn_camera_shutter_pressed_holo.png Binary files differnew file mode 100644 index 0000000..895be4b --- /dev/null +++ b/res/drawable-w1024dp-mdpi/btn_camera_shutter_pressed_holo.png diff --git a/res/drawable-w1024dp-mdpi/btn_shutter.xml b/res/drawable-w1024dp-mdpi/btn_shutter.xml index d1772ae..d15f870 100644 --- a/res/drawable-w1024dp-mdpi/btn_shutter.xml +++ b/res/drawable-w1024dp-mdpi/btn_shutter.xml @@ -15,7 +15,7 @@ --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:state_pressed="true" android:drawable="@drawable/button_camera_shutter_pressed_holo" /> - <item android:drawable="@drawable/button_camera_shutter_holo" /> + <item android:state_pressed="true" android:drawable="@drawable/btn_camera_shutter_pressed_holo" /> + <item android:drawable="@drawable/btn_camera_shutter_holo" /> </selector> diff --git a/res/drawable-w1024dp-mdpi/btn_shutter_recording.xml b/res/drawable-w1024dp-mdpi/btn_shutter_video.xml index c2a07ff..86b60bc 100644 --- a/res/drawable-w1024dp-mdpi/btn_shutter_recording.xml +++ b/res/drawable-w1024dp-mdpi/btn_shutter_video.xml @@ -15,7 +15,7 @@ --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:state_pressed="true" android:drawable="@drawable/button_video_shutter_pressed_holo" /> - <item android:drawable="@drawable/button_video_shutter_holo" /> + <item android:state_pressed="true" android:drawable="@drawable/btn_video_shutter_pressed_holo" /> + <item android:drawable="@drawable/btn_video_shutter_holo" /> </selector> diff --git a/res/drawable-w1024dp-mdpi/btn_video_shutter_holo.png b/res/drawable-w1024dp-mdpi/btn_video_shutter_holo.png Binary files differnew file mode 100644 index 0000000..f9f8587 --- /dev/null +++ b/res/drawable-w1024dp-mdpi/btn_video_shutter_holo.png diff --git a/res/drawable-w1024dp-mdpi/btn_video_shutter_pressed_holo.png b/res/drawable-w1024dp-mdpi/btn_video_shutter_pressed_holo.png Binary files differnew file mode 100644 index 0000000..ec6863b --- /dev/null +++ b/res/drawable-w1024dp-mdpi/btn_video_shutter_pressed_holo.png diff --git a/res/drawable-w1024dp-mdpi/button_camera_shutter_holo.png b/res/drawable-w1024dp-mdpi/button_camera_shutter_holo.png Binary files differdeleted file mode 100644 index 556c921..0000000 --- a/res/drawable-w1024dp-mdpi/button_camera_shutter_holo.png +++ /dev/null diff --git a/res/drawable-w1024dp-mdpi/button_camera_shutter_pressed_holo.png b/res/drawable-w1024dp-mdpi/button_camera_shutter_pressed_holo.png Binary files differdeleted file mode 100644 index 7ccc389..0000000 --- a/res/drawable-w1024dp-mdpi/button_camera_shutter_pressed_holo.png +++ /dev/null diff --git a/res/drawable-w1024dp-mdpi/button_video_shutter_holo.png b/res/drawable-w1024dp-mdpi/button_video_shutter_holo.png Binary files differdeleted file mode 100644 index 8c8b4df..0000000 --- a/res/drawable-w1024dp-mdpi/button_video_shutter_holo.png +++ /dev/null diff --git a/res/drawable-w1024dp-mdpi/button_video_shutter_pressed_holo.png b/res/drawable-w1024dp-mdpi/button_video_shutter_pressed_holo.png Binary files differdeleted file mode 100644 index 903a57a..0000000 --- a/res/drawable-w1024dp-mdpi/button_video_shutter_pressed_holo.png +++ /dev/null diff --git a/res/drawable-w1024dp-xhdpi/bg_camera_pattern.png b/res/drawable-w1024dp-xhdpi/bg_camera_pattern.png Binary files differnew file mode 100644 index 0000000..9ba9994 --- /dev/null +++ b/res/drawable-w1024dp-xhdpi/bg_camera_pattern.png diff --git a/res/drawable-w1024dp-xhdpi/btn_camera_shutter_holo.png b/res/drawable-w1024dp-xhdpi/btn_camera_shutter_holo.png Binary files differnew file mode 100644 index 0000000..1b1552c --- /dev/null +++ b/res/drawable-w1024dp-xhdpi/btn_camera_shutter_holo.png diff --git a/res/drawable-w1024dp-xhdpi/btn_camera_shutter_pressed_holo.png b/res/drawable-w1024dp-xhdpi/btn_camera_shutter_pressed_holo.png Binary files differnew file mode 100644 index 0000000..3d410ad --- /dev/null +++ b/res/drawable-w1024dp-xhdpi/btn_camera_shutter_pressed_holo.png diff --git a/res/drawable-w1024dp-xhdpi/btn_video_shutter_holo.png b/res/drawable-w1024dp-xhdpi/btn_video_shutter_holo.png Binary files differnew file mode 100644 index 0000000..8245e62 --- /dev/null +++ b/res/drawable-w1024dp-xhdpi/btn_video_shutter_holo.png diff --git a/res/drawable-w1024dp-xhdpi/btn_video_shutter_pressed_holo.png b/res/drawable-w1024dp-xhdpi/btn_video_shutter_pressed_holo.png Binary files differnew file mode 100644 index 0000000..eeb09ae --- /dev/null +++ b/res/drawable-w1024dp-xhdpi/btn_video_shutter_pressed_holo.png diff --git a/res/drawable-xhdpi/bg_camera_pattern.png b/res/drawable-xhdpi/bg_camera_pattern.png Binary files differnew file mode 100644 index 0000000..050a419 --- /dev/null +++ b/res/drawable-xhdpi/bg_camera_pattern.png diff --git a/res/drawable-xhdpi/btn_camera_shutter_holo.png b/res/drawable-xhdpi/btn_camera_shutter_holo.png Binary files differnew file mode 100644 index 0000000..d477b5b --- /dev/null +++ b/res/drawable-xhdpi/btn_camera_shutter_holo.png diff --git a/res/drawable-xhdpi/btn_camera_shutter_pressed_holo.png b/res/drawable-xhdpi/btn_camera_shutter_pressed_holo.png Binary files differnew file mode 100644 index 0000000..103ae4b --- /dev/null +++ b/res/drawable-xhdpi/btn_camera_shutter_pressed_holo.png diff --git a/res/drawable-xhdpi/btn_video_shutter_holo.png b/res/drawable-xhdpi/btn_video_shutter_holo.png Binary files differnew file mode 100644 index 0000000..10f29dd --- /dev/null +++ b/res/drawable-xhdpi/btn_video_shutter_holo.png diff --git a/res/drawable-xhdpi/btn_video_shutter_pressed_holo.png b/res/drawable-xhdpi/btn_video_shutter_pressed_holo.png Binary files differnew file mode 100644 index 0000000..ab32f62 --- /dev/null +++ b/res/drawable-xhdpi/btn_video_shutter_pressed_holo.png diff --git a/res/drawable/btn_shutter.xml b/res/drawable/btn_shutter.xml index 2e4218c..983a269 100644 --- a/res/drawable/btn_shutter.xml +++ b/res/drawable/btn_shutter.xml @@ -15,7 +15,7 @@ --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:state_pressed="true" android:drawable="@drawable/btn_shutter_pressed" /> - <item android:drawable="@drawable/btn_shutter_normal" /> + <item android:state_pressed="true" android:drawable="@drawable/btn_camera_shutter_pressed_holo" /> + <item android:drawable="@drawable/btn_camera_shutter_holo" /> </selector> diff --git a/res/drawable/btn_shutter_recording.xml b/res/drawable/btn_shutter_video.xml index 042af69..04dcec9 100644 --- a/res/drawable/btn_shutter_recording.xml +++ b/res/drawable/btn_shutter_video.xml @@ -15,7 +15,7 @@ --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:state_pressed="true" android:drawable="@drawable/btn_shutter_pressed" /> - <item android:drawable="@drawable/btn_shutter_normal" /> + <item android:state_pressed="true" android:drawable="@drawable/btn_video_shutter_pressed_holo" /> + <item android:drawable="@drawable/btn_video_shutter_holo" /> </selector> diff --git a/res/layout-w1024dp/camera.xml b/res/layout-w1024dp/camera.xml index 6b327b0..87ab2c7 100644 --- a/res/layout-w1024dp/camera.xml +++ b/res/layout-w1024dp/camera.xml @@ -14,14 +14,13 @@ limitations under the License. --> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:camera="http://schemas.android.com/apk/res/com.android.camera" android:id="@+id/app_root" android:orientation="horizontal" android:layout_width="match_parent" - android:layout_height="match_parent" - android:background="@drawable/bg_ring_control_holo"> + android:layout_height="match_parent"> - <include layout="@layout/camera_control"/> <include layout="@layout/preview_frame"/> -</RelativeLayout> + <include layout="@layout/camera_control"/> +</LinearLayout> diff --git a/res/layout-w1024dp/camera_attach.xml b/res/layout-w1024dp/camera_attach.xml index 6b327b0..87ab2c7 100644 --- a/res/layout-w1024dp/camera_attach.xml +++ b/res/layout-w1024dp/camera_attach.xml @@ -14,14 +14,13 @@ limitations under the License. --> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:camera="http://schemas.android.com/apk/res/com.android.camera" android:id="@+id/app_root" android:orientation="horizontal" android:layout_width="match_parent" - android:layout_height="match_parent" - android:background="@drawable/bg_ring_control_holo"> + android:layout_height="match_parent"> - <include layout="@layout/camera_control"/> <include layout="@layout/preview_frame"/> -</RelativeLayout> + <include layout="@layout/camera_control"/> +</LinearLayout> diff --git a/res/layout-w1024dp/camera_control.xml b/res/layout-w1024dp/camera_control.xml index ca70b44..342d167 100644 --- a/res/layout-w1024dp/camera_control.xml +++ b/res/layout-w1024dp/camera_control.xml @@ -14,12 +14,13 @@ limitations under the License. --> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<com.android.camera.ui.ControlPanelLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:camera="http://schemas.android.com/apk/res/com.android.camera" android:id="@+id/control_panel" + android:layout_width="wrap_content" android:layout_height="match_parent" - android:layout_width="@dimen/camera_control_width" - android:layout_alignParentRight="true"> + android:minWidth="260dp" + android:background="@drawable/bg_camera_pattern"> <!-- The width is determined by IndicatorWheel so we should set layout_width as wrap_contant but RelativeLayout Javadoc says that this is circular dependency and is not allowed so it's very @@ -38,7 +39,6 @@ android:scaleType="center" android:clickable="true" android:focusable="true" - android:src="@drawable/btn_ic_camera_shutter" android:background="@drawable/btn_shutter" /> <com.android.camera.ui.RotateImageView android:id="@+id/zoom_increment" android:clickable="true" @@ -61,5 +61,5 @@ </com.android.camera.ui.IndicatorWheel> <include layout="@layout/mode_picker"/> -</RelativeLayout> +</com.android.camera.ui.ControlPanelLayout> diff --git a/res/layout-w1024dp/pano_control.xml b/res/layout-w1024dp/pano_control.xml index 1882ff6..e218fa5 100644 --- a/res/layout-w1024dp/pano_control.xml +++ b/res/layout-w1024dp/pano_control.xml @@ -14,10 +14,11 @@ limitations under the License. --> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<com.android.camera.ui.ControlPanelLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_width="@dimen/camera_control_width" - android:layout_alignParentRight="true"> + android:minWidth="260dp" + android:background="@drawable/bg_camera_pattern"> <include layout="@layout/review_thumbnail"/> @@ -26,12 +27,9 @@ android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_alignParentRight="true" - android:layout_marginRight="32dp" - android:scaleType="center" android:clickable="true" android:focusable="true" - android:src="@drawable/btn_ic_camera_shutter" android:background="@drawable/btn_shutter"/> <include layout="@layout/mode_picker"/> -</RelativeLayout> +</com.android.camera.ui.ControlPanelLayout> diff --git a/res/layout-w1024dp/preview_frame.xml b/res/layout-w1024dp/preview_frame.xml index 9cfc206..41c419f 100644 --- a/res/layout-w1024dp/preview_frame.xml +++ b/res/layout-w1024dp/preview_frame.xml @@ -17,7 +17,7 @@ android:id="@+id/frame_layout" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_toLeftOf="@id/control_panel"> + android:layout_weight="1"> <RelativeLayout android:id="@+id/frame" android:layout_width="match_parent" android:layout_height="match_parent"> diff --git a/res/layout-w1024dp/preview_frame_video.xml b/res/layout-w1024dp/preview_frame_video.xml index 11fe590..0323d40 100644 --- a/res/layout-w1024dp/preview_frame_video.xml +++ b/res/layout-w1024dp/preview_frame_video.xml @@ -18,7 +18,7 @@ android:id="@+id/frame_layout" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_toLeftOf="@id/control_panel"> + android:layout_weight="1"> <RelativeLayout android:id="@+id/frame" android:layout_width="match_parent" android:layout_height="match_parent"> diff --git a/res/layout-w1024dp/video_camera.xml b/res/layout-w1024dp/video_camera.xml index afe0408..76a4624 100644 --- a/res/layout-w1024dp/video_camera.xml +++ b/res/layout-w1024dp/video_camera.xml @@ -14,14 +14,13 @@ limitations under the License. --> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:camera="http://schemas.android.com/apk/res/com.android.camera" android:id="@+id/app_root" android:orientation="horizontal" android:layout_width="match_parent" - android:layout_height="match_parent" - android:background="@drawable/bg_ring_control_holo"> + android:layout_height="match_parent"> - <include layout="@layout/camera_control"/> <include layout="@layout/preview_frame_video"/> -</RelativeLayout> + <include layout="@layout/camera_control"/> +</LinearLayout> diff --git a/res/layout-w1024dp/video_camera_attach.xml b/res/layout-w1024dp/video_camera_attach.xml index 958f72c..94011a3 100644 --- a/res/layout-w1024dp/video_camera_attach.xml +++ b/res/layout-w1024dp/video_camera_attach.xml @@ -14,14 +14,13 @@ limitations under the License. --> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:camera="http://schemas.android.com/apk/res/com.android.camera" android:id="@+id/app_root" android:orientation="horizontal" android:layout_width="match_parent" - android:layout_height="match_parent" - android:background="@drawable/bg_ring_control_holo"> + android:layout_height="match_parent"> - <include layout="@layout/camera_control"/> <include layout="@layout/preview_frame_video"/> -</RelativeLayout> + <include layout="@layout/camera_control"/> +</LinearLayout> diff --git a/res/layout/attach_camera_control.xml b/res/layout/attach_camera_control.xml index b688a44..10fa6f7 100644 --- a/res/layout/attach_camera_control.xml +++ b/res/layout/attach_camera_control.xml @@ -14,14 +14,15 @@ limitations under the License. --> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<com.android.camera.ui.ControlPanelLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:camera="http://schemas.android.com/apk/res/com.android.camera" android:id="@+id/control_panel" + android:layout_width="wrap_content" android:layout_height="match_parent" - android:layout_width="76dp" + android:minWidth="76dp" android:paddingTop="13dp" android:paddingBottom="3dp" - android:layout_alignParentRight="true"> + android:background="@drawable/bg_camera_pattern"> <LinearLayout android:orientation="vertical" android:id="@+id/review_control" android:gravity="top|center_horizontal" @@ -61,10 +62,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" - android:scaleType="center" android:clickable="true" android:focusable="true" - android:src="@drawable/btn_ic_camera_shutter" android:background="@drawable/btn_shutter"/> <LinearLayout style="@style/ReviewControlGroup" android:visibility="invisible" @@ -76,4 +75,4 @@ <TextView style="@style/ReviewControlText" android:text="@string/review_ok" /> </LinearLayout> -</RelativeLayout> +</com.android.camera.ui.ControlPanelLayout> diff --git a/res/layout/camera.xml b/res/layout/camera.xml index cb54dce..bc9e313 100644 --- a/res/layout/camera.xml +++ b/res/layout/camera.xml @@ -14,7 +14,7 @@ limitations under the License. --> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:camera="http://schemas.android.com/apk/res/com.android.camera" android:id="@+id/app_root" android:orientation="horizontal" @@ -22,4 +22,4 @@ android:layout_height="match_parent"> <include layout="@layout/preview_frame"/> <include layout="@layout/camera_control"/> -</RelativeLayout> +</LinearLayout> diff --git a/res/layout/camera_attach.xml b/res/layout/camera_attach.xml index 92ab6f5..9145e4b 100644 --- a/res/layout/camera_attach.xml +++ b/res/layout/camera_attach.xml @@ -14,7 +14,7 @@ limitations under the License. --> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:camera="http://schemas.android.com/apk/res/com.android.camera" android:id="@+id/app_root" android:orientation="horizontal" @@ -23,4 +23,4 @@ <include layout="@layout/preview_frame"/> <include layout="@layout/attach_camera_control"/> -</RelativeLayout> +</LinearLayout> diff --git a/res/layout/camera_control.xml b/res/layout/camera_control.xml index 2185c32..6347f3c 100644 --- a/res/layout/camera_control.xml +++ b/res/layout/camera_control.xml @@ -14,12 +14,12 @@ limitations under the License. --> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<com.android.camera.ui.ControlPanelLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/control_panel" - android:layout_alignParentRight="true" + android:layout_width="wrap_content" android:layout_height="match_parent" - android:layout_width="76dp" - android:orientation="vertical"> + android:minWidth="76dp" + android:background="@drawable/bg_camera_pattern"> <include layout="@layout/review_thumbnail"/> @@ -40,9 +40,8 @@ android:scaleType="center" android:clickable="true" android:focusable="true" - android:src="@drawable/btn_ic_camera_shutter" android:background="@drawable/btn_shutter"/> <include layout="@layout/mode_picker"/> -</RelativeLayout> +</com.android.camera.ui.ControlPanelLayout> diff --git a/res/layout/mode_picker.xml b/res/layout/mode_picker.xml index 15c2101..31178d6 100644 --- a/res/layout/mode_picker.xml +++ b/res/layout/mode_picker.xml @@ -17,7 +17,6 @@ android:id="@+id/mode_picker" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginBottom="12dp" android:layout_centerHorizontal="true" android:layout_alignParentBottom="true"> <com.android.camera.ui.RotateImageView android:id="@+id/current_mode" diff --git a/res/layout/pano_control.xml b/res/layout/pano_control.xml index 0faa595..e3ab1d4 100644 --- a/res/layout/pano_control.xml +++ b/res/layout/pano_control.xml @@ -14,10 +14,12 @@ limitations under the License. --> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<com.android.camera.ui.ControlPanelLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="wrap_content" android:layout_height="match_parent" - android:layout_width="76dp" - android:paddingTop="13dp"> + android:minWidth="76dp" + android:paddingTop="13dp" + android:background="@drawable/bg_camera_pattern"> <include layout="@layout/review_thumbnail"/> @@ -27,8 +29,7 @@ android:layout_centerInParent="true" android:clickable="true" android:focusable="true" - android:src="@drawable/btn_ic_camera_shutter" android:background="@drawable/btn_shutter"/> <include layout="@layout/mode_picker"/> -</RelativeLayout> +</com.android.camera.ui.ControlPanelLayout> diff --git a/res/layout/pano_preview.xml b/res/layout/pano_preview.xml index 908497b..96ab4ff 100644 --- a/res/layout/pano_preview.xml +++ b/res/layout/pano_preview.xml @@ -15,8 +15,6 @@ --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/pano_preview_layout" - android:layout_gravity="right" android:orientation="horizontal" android:layout_height="match_parent" android:layout_width="match_parent" @@ -24,10 +22,10 @@ android:layout_marginRight="2dp"> <FrameLayout - android:layout_weight="1" android:gravity="center" android:layout_width="match_parent" - android:layout_height="match_parent"> + android:layout_height="match_parent" + android:layout_weight="1"> <SurfaceView android:id="@+id/pano_preview_view" android:layout_gravity="center" diff --git a/res/layout/preview_frame.xml b/res/layout/preview_frame.xml index e35e65c..6f1dafd 100644 --- a/res/layout/preview_frame.xml +++ b/res/layout/preview_frame.xml @@ -18,9 +18,8 @@ android:id="@+id/frame_layout" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_toLeftOf="@id/control_panel" - android:layout_marginLeft="2dp" - android:layout_weight="1"> + android:layout_weight="1" + android:layout_marginLeft="2dp"> <!-- To be consistent with w1024dp layout, preview border is not inside the preview frame. --> <ImageView android:id="@+id/preview_border" android:layout_width="match_parent" diff --git a/res/layout/preview_frame_video.xml b/res/layout/preview_frame_video.xml index 1293d1b..32154cd 100644 --- a/res/layout/preview_frame_video.xml +++ b/res/layout/preview_frame_video.xml @@ -17,9 +17,8 @@ android:id="@+id/frame_layout" android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_toLeftOf="@id/control_panel" - android:layout_marginLeft="2dip" - android:layout_weight="1"> + android:layout_weight="1" + android:layout_marginLeft="2dip"> <!-- To be consistent with w1024dp layout, preview border is not inside the preview frame. --> <ImageView android:id="@+id/preview_border" android:layout_width="match_parent" diff --git a/res/layout/video_camera.xml b/res/layout/video_camera.xml index 036b512..c8c24c2 100644 --- a/res/layout/video_camera.xml +++ b/res/layout/video_camera.xml @@ -14,7 +14,7 @@ limitations under the License. --> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:camera="http://schemas.android.com/apk/res/com.android.camera" android:id="@+id/app_root" android:orientation="horizontal" @@ -22,4 +22,4 @@ android:layout_height="match_parent"> <include layout="@layout/preview_frame_video"/> <include layout="@layout/camera_control"/> -</RelativeLayout> +</LinearLayout> diff --git a/res/layout/video_camera_attach.xml b/res/layout/video_camera_attach.xml index 4ec8a8f..c526ca8 100644 --- a/res/layout/video_camera_attach.xml +++ b/res/layout/video_camera_attach.xml @@ -14,12 +14,13 @@ limitations under the License. --> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:camera="http://schemas.android.com/apk/res/com.android.camera" android:id="@+id/app_root" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="match_parent"> + <include layout="@layout/preview_frame_video"/> <include layout="@layout/attach_camera_control"/> -</RelativeLayout> +</LinearLayout> diff --git a/res/values-w1024dp/dimens.xml b/res/values-w1024dp/dimens.xml index ad93943..4aa86c7 100644 --- a/res/values-w1024dp/dimens.xml +++ b/res/values-w1024dp/dimens.xml @@ -18,7 +18,6 @@ */ --> <resources> - <dimen name="camera_control_width">245dp</dimen> <dimen name="thumbnail_margin_top">8dp</dimen> <dimen name="thumbnail_margin_right">28dp</dimen> <dimen name="mode_switcher_margin_right">5dp</dimen> diff --git a/res/values-w1280dp/dimens.xml b/res/values-w1280dp/dimens.xml index 2fee255..e5b8894 100644 --- a/res/values-w1280dp/dimens.xml +++ b/res/values-w1280dp/dimens.xml @@ -18,7 +18,6 @@ */ --> <resources> - <dimen name="camera_control_width">295dp</dimen> <dimen name="thumbnail_margin_top">32dp</dimen> <dimen name="thumbnail_margin_right">32dp</dimen> <dimen name="mode_switcher_margin_right">34dp</dimen> diff --git a/res/values/styles.xml b/res/values/styles.xml index c205a69..3219e1a 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -19,7 +19,6 @@ <resources xmlns:android="http://schemas.android.com/apk/res/android"> <style name="ThemeCamera" parent="android:Theme.Black.NoTitleBar.Fullscreen"> - <item name="android:windowBackground">@drawable/bg_camera_pattern</item> </style> <style name="OnScreenHintTextAppearance"> <item name="android:textColor">@android:color/primary_text_dark</item> diff --git a/src/com/android/camera/Util.java b/src/com/android/camera/Util.java index 2b39b3d..3023565 100644 --- a/src/com/android/camera/Util.java +++ b/src/com/android/camera/Util.java @@ -34,10 +34,12 @@ import android.net.Uri; import android.os.Build; import android.os.ParcelFileDescriptor; import android.telephony.TelephonyManager; +import android.util.DisplayMetrics; import android.util.Log; import android.view.Display; import android.view.Surface; import android.view.View; +import android.view.WindowManager; import java.io.Closeable; import java.io.IOException; @@ -62,18 +64,29 @@ public class Util { "android.intent.extras.CAMERA_FACING"; private static boolean sIsTabletUI; + private static float sPixelDensity = 1; private Util() { } public static void initialize(Context context) { sIsTabletUI = (context.getResources().getConfiguration().screenWidthDp >= 1024); + + DisplayMetrics metrics = new DisplayMetrics(); + WindowManager wm = (WindowManager) + context.getSystemService(Context.WINDOW_SERVICE); + wm.getDefaultDisplay().getMetrics(metrics); + sPixelDensity = metrics.density; } public static boolean isTabletUI() { return sIsTabletUI; } + public static int dpToPixel(int dp) { + return Math.round(sPixelDensity * dp); + } + // Rotates the bitmap by the specified degree. // If a new bitmap is created, the original bitmap is recycled. public static Bitmap rotate(Bitmap b, int degrees) { diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java index b730e0d..18c0764 100644 --- a/src/com/android/camera/VideoCamera.java +++ b/src/com/android/camera/VideoCamera.java @@ -60,7 +60,6 @@ import android.view.OrientationEventListener; import android.view.SurfaceHolder; import android.view.SurfaceView; import android.view.View; -import android.view.ViewGroup; import android.view.Window; import android.view.WindowManager; import android.view.animation.AlphaAnimation; @@ -428,7 +427,7 @@ public class VideoCamera extends ActivityBase mQuickCapture = getIntent().getBooleanExtra(EXTRA_QUICK_CAPTURE, false); mShutterButton = (ShutterButton) findViewById(R.id.shutter_button); - mShutterButton.setImageResource(R.drawable.btn_ic_video_record); + mShutterButton.setBackgroundResource(R.drawable.btn_shutter_video); mShutterButton.setOnShutterButtonListener(this); mShutterButton.requestFocus(); @@ -1414,9 +1413,7 @@ public class VideoCamera extends ActivityBase private void showRecordingUI(boolean recording) { if (recording) { - mShutterButton.setImageDrawable(getResources().getDrawable( - R.drawable.btn_ic_video_record_stop)); - mShutterButton.setBackgroundResource(R.drawable.btn_shutter_recording); + mShutterButton.setBackgroundResource(R.drawable.btn_shutter_video); mRecordingTimeView.setText(""); mRecordingTimeView.setVisibility(View.VISIBLE); if (mReviewControl != null) mReviewControl.setVisibility(View.GONE); @@ -1428,9 +1425,7 @@ public class VideoCamera extends ActivityBase } } } else { - mShutterButton.setImageDrawable(getResources().getDrawable( - R.drawable.btn_ic_video_record)); - mShutterButton.setBackgroundResource(R.drawable.btn_shutter); + mShutterButton.setBackgroundResource(R.drawable.btn_shutter_video); mRecordingTimeView.setVisibility(View.GONE); if (mReviewControl != null) mReviewControl.setVisibility(View.VISIBLE); if (mCaptureTimeLapse) { diff --git a/src/com/android/camera/ui/ControlPanelLayout.java b/src/com/android/camera/ui/ControlPanelLayout.java new file mode 100644 index 0000000..f85d955 --- /dev/null +++ b/src/com/android/camera/ui/ControlPanelLayout.java @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2011 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.ui; + +import android.content.Context; +import android.util.AttributeSet; +import android.util.Log; +import android.widget.RelativeLayout; + +/** + * A layout which handles the the width of the control panel, which contains + * the shutter button, thumbnail, front/back camera picker, and mode picker. + * The purpose of this is to have a consistent width of control panel in camera, + * camcorder, and panorama modes. The control panel can also be GONE and the + * preview can expand to full-screen in panorama. + */ +public class ControlPanelLayout extends RelativeLayout { + private static final String TAG = "ControlPanelLayout"; + + public ControlPanelLayout(Context context, AttributeSet attrs) { + super(context, attrs); + } + + @Override + protected void onMeasure(int widthSpec, int heightSpec) { + int widthSpecSize = MeasureSpec.getSize(widthSpec); + int heightSpecSize = MeasureSpec.getSize(heightSpec); + int widthMode = MeasureSpec.getMode(widthSpec); + int measuredWidth = 0; + + if (widthSpecSize > 0 && heightSpecSize > 0 && widthMode == MeasureSpec.AT_MOST) { + // Calculate how big 4:3 preview occupies. Then deduct it from the + // width of the parent. + measuredWidth = (int) (widthSpecSize - heightSpecSize / 3.0 * 4.0 - 16); + } else { + Log.e(TAG, "layout_width of ControlPanelLayout should be wrap_content"); + } + + // Make sure the width is bigger than the minimum width. + int minWidth = getSuggestedMinimumWidth(); + if (minWidth > measuredWidth) { + measuredWidth = minWidth; + } + + // The width cannot be bigger than the constraint. + if (widthMode == MeasureSpec.AT_MOST && measuredWidth > widthSpecSize) { + measuredWidth = widthSpecSize; + } + + super.onMeasure(MeasureSpec.makeMeasureSpec(measuredWidth, MeasureSpec.EXACTLY), + heightSpec); + } +} diff --git a/src/com/android/camera/ui/IndicatorWheel.java b/src/com/android/camera/ui/IndicatorWheel.java index fa2a1d3..ac1305e 100644 --- a/src/com/android/camera/ui/IndicatorWheel.java +++ b/src/com/android/camera/ui/IndicatorWheel.java @@ -17,6 +17,7 @@ package com.android.camera.ui; import com.android.camera.R; +import com.android.camera.Util; import android.content.Context; import android.content.res.Resources; @@ -79,39 +80,27 @@ public class IndicatorWheel extends IndicatorControl { mBackgroundRect = new RectF(); } - private boolean isInsideShutterButton(MotionEvent ev) { - float x = ev.getX(); - float y = ev.getY(); - float shutterButtonX = mShutterButton.getX(); - float shutterButtonY = mShutterButton.getY(); - if (x >= shutterButtonX && y >= shutterButtonY - && (x < shutterButtonX + mShutterButton.getWidth()) - && (y < shutterButtonY + mShutterButton.getHeight())) { - return true; - } - return false; - } - @Override public boolean dispatchTouchEvent(MotionEvent event) { if (!onFilterTouchEventForSecurity(event)) return false; int action = event.getAction(); + double dx = event.getX() - mCenterX; + double dy = mCenterY - event.getY(); + double radius = Math.sqrt(dx * dx + dy * dy); + // Check if the event should be dispatched to the shutter button. - if (isInsideShutterButton(event)) { + if (radius <= mShutterButtonRadius) { if (action == MotionEvent.ACTION_DOWN || action == MotionEvent.ACTION_UP) { return mShutterButton.dispatchTouchEvent(event); } return false; } - double dx = event.getX() - mCenterX; - double dy = mCenterY - event.getY(); - double radius = Math.sqrt(dx * dx + dy * dy); // Ignore the event if it's too near to the shutter button or too far // from the shutter button. - if (radius >= mShutterButtonRadius && radius <= mWheelRadius + mStrokeWidth) { + if (radius <= mWheelRadius + mStrokeWidth) { double delta = Math.atan2(dy, dx); if (delta < 0) delta += Math.PI * 2; // Check which sector is pressed. @@ -195,9 +184,9 @@ public class IndicatorWheel extends IndicatorControl { getChildAt(i).measure(freeSpec, freeSpec); } - // Measure myself. - int desiredWidth = mShutterButton.getMeasuredWidth() * 3; - int desiredHeight = (int)(mShutterButton.getMeasuredHeight() * 4.5) + 2; + // Measure myself. Add some buffer for highlight arc. + int desiredWidth = mShutterButton.getMeasuredWidth() + HIGHLIGHT_WIDTH * 4; + int desiredHeight = mShutterButton.getMeasuredHeight() + HIGHLIGHT_WIDTH * 4; int widthMode = MeasureSpec.getMode(widthSpec); int heightMode = MeasureSpec.getMode(heightSpec); int measuredWidth, measuredHeight; @@ -226,24 +215,21 @@ public class IndicatorWheel extends IndicatorControl { // Layout the shutter button. int shutterButtonWidth = mShutterButton.getMeasuredWidth(); - mShutterButtonRadius = shutterButtonWidth / 2.0; int shutterButtonHeight = mShutterButton.getMeasuredHeight(); - mStrokeWidth = (int) (mShutterButtonRadius * 1.05); - int innerRadius = (int) (mShutterButtonRadius + mStrokeWidth * 0.84); - // 64 is the requirement by UI design. The distance between the center - // and the border is 64 pixels. This has to be consistent with the - // background. - mCenterX = right - left - 64; + // These numbers have to sync with the background of the shutter button. + mShutterButtonRadius = Util.dpToPixel(74); + mStrokeWidth = Util.dpToPixel(87); + mCenterX = right - left - Util.dpToPixel(93); mCenterY = (bottom - top) / 2; - mShutterButton.layout(mCenterX - shutterButtonWidth / 2, + mShutterButton.layout(right - left - shutterButtonWidth, mCenterY - shutterButtonHeight / 2, - mCenterX + shutterButtonWidth / 2, - mCenterY + shutterButtonHeight / 2); + right - left, + mCenterY + shutterButtonHeight - shutterButtonHeight / 2); // Layout the settings. The icons are spreaded on the left side of the // shutter button. So the angle starts from 90 to 270 degrees. if (count == 1) return; - mWheelRadius = innerRadius + mStrokeWidth * 0.5; + mWheelRadius = mShutterButtonRadius + mStrokeWidth * 0.5; double intervalDegrees = (count == 2) ? 90.0 : 180.0 / (count - 2); double initialDegrees = 90.0; int index = 0; |