summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChung-yih Wang <cywang@google.com>2011-10-18 12:47:44 +0800
committerChung-yih Wang <cywang@google.com>2011-11-01 15:31:16 +0800
commitd33109730e0ab81230f84e2bd35599e8e24fc4ba (patch)
treedf80db1d6647bf952f495a81d8ab67ee7498880d
parentabf79a3e25e6c631275e9f81424c0aa25ec9191b (diff)
downloadLegacyCamera-d33109730e0ab81230f84e2bd35599e8e24fc4ba.tar.gz
LegacyCamera-d33109730e0ab81230f84e2bd35599e8e24fc4ba.tar.bz2
LegacyCamera-d33109730e0ab81230f84e2bd35599e8e24fc4ba.zip
Change the default orientation to portrait.
bug:5446617 Since the orientation is mainly portrait on phones, the default orientation of an application will decide if the window animation will be played before it starts. In order to reduce the launch time of Camera apps, this change is to skip the window animations by changing the default orientation to portrait. Change-Id: I6682ab408d7e8d1f0580f3c1600b6c9c3d6a7f6e
-rw-r--r--AndroidManifest.xml3
-rw-r--r--res/anim/first_level_fade_in.xml (renamed from res/anim/grow_fade_in_from_bottom.xml)2
-rw-r--r--res/anim/first_level_fade_out.xml (renamed from res/anim/shrink_fade_out_from_top.xml)2
-rw-r--r--res/anim/mode_selection_fade_in.xml2
-rw-r--r--res/anim/mode_selection_fade_out.xml2
-rw-r--r--res/anim/second_level_fade_in.xml (renamed from res/anim/grow_fade_in_from_top.xml)2
-rw-r--r--res/anim/second_level_fade_out.xml (renamed from res/anim/shrink_fade_out_from_bottom.xml)2
-rw-r--r--res/drawable-hdpi/btn_close_settings.pngbin522 -> 387 bytes
-rw-r--r--res/drawable-hdpi/ic_zoom_big.9.pngbin135 -> 121 bytes
-rw-r--r--res/drawable-hdpi/ic_zoom_big_dark.9.pngbin170 -> 93 bytes
-rw-r--r--res/drawable-hdpi/list_divider.9.pngbin0 -> 78 bytes
-rw-r--r--res/drawable-mdpi/btn_close_settings.pngbin446 -> 322 bytes
-rw-r--r--res/drawable-mdpi/ic_zoom_big.9.pngbin132 -> 117 bytes
-rw-r--r--res/drawable-mdpi/ic_zoom_big_dark.9.pngbin168 -> 90 bytes
-rw-r--r--res/drawable-mdpi/list_divider.9.pngbin0 -> 78 bytes
-rw-r--r--res/drawable-xhdpi/btn_close_settings.pngbin656 -> 554 bytes
-rw-r--r--res/drawable-xhdpi/ic_zoom_big.9.pngbin92 -> 95 bytes
-rw-r--r--res/drawable-xhdpi/ic_zoom_big_dark.9.pngbin171 -> 96 bytes
-rw-r--r--res/drawable-xhdpi/list_divider.9.pngbin0 -> 83 bytes
-rw-r--r--res/layout-sw600dp/pano_capture.xml128
-rw-r--r--res/layout-sw600dp/pano_review.xml80
-rw-r--r--res/layout-sw600dp/share_popup.xml87
-rw-r--r--res/layout-sw600dp/viewfinder_labels_video.xml31
-rw-r--r--res/layout-w1024dp/priority_indicators.xml34
-rw-r--r--res/layout/bg_replacement_training_message.xml16
-rw-r--r--res/layout/camera.xml2
-rw-r--r--res/layout/camera_control.xml8
-rw-r--r--res/layout/effect_setting_item.xml2
-rw-r--r--res/layout/focus_indicator.xml6
-rw-r--r--res/layout/indicator_bar.xml45
-rw-r--r--res/layout/mode_picker.xml83
-rw-r--r--res/layout/on_screen_hint.xml6
-rw-r--r--res/layout/pano_capture.xml127
-rw-r--r--res/layout/pano_review.xml90
-rw-r--r--res/layout/pano_rotate_dialog.xml104
-rw-r--r--res/layout/panorama.xml5
-rw-r--r--res/layout/preview_frame_video.xml14
-rw-r--r--res/layout/priority_indicators.xml10
-rw-r--r--res/layout/review_control.xml14
-rw-r--r--res/layout/setting_item.xml2
-rw-r--r--res/layout/share_icon.xml12
-rw-r--r--res/layout/share_popup.xml60
-rw-r--r--res/layout/video_camera.xml10
-rw-r--r--res/layout/viewfinder_labels_video.xml4
-rw-r--r--res/values-sw600dp/styles.xml21
-rw-r--r--res/values/dimens.xml2
-rw-r--r--res/values/styles.xml27
-rw-r--r--src/com/android/camera/ActivityBase.java2
-rw-r--r--src/com/android/camera/Camera.java7
-rwxr-xr-xsrc/com/android/camera/panorama/PanoramaActivity.java120
-rw-r--r--src/com/android/camera/ui/ControlPanelLayout.java9
-rw-r--r--src/com/android/camera/ui/IndicatorControlBar.java15
-rw-r--r--src/com/android/camera/ui/IndicatorControlBarContainer.java8
-rw-r--r--src/com/android/camera/ui/OneRowGridView.java43
-rw-r--r--src/com/android/camera/ui/RightAlignedHorizontalScrollView.java44
-rw-r--r--src/com/android/camera/ui/SecondLevelIndicatorControlBar.java60
-rw-r--r--src/com/android/camera/ui/SharePopup.java17
-rw-r--r--src/com/android/camera/ui/ZoomControlBar.java52
58 files changed, 1052 insertions, 370 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 23114dba..ad6755f0 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -31,7 +31,6 @@
</receiver>
<activity android:name="com.android.camera.Camera"
android:configChanges="orientation|screenSize|keyboardHidden"
- android:screenOrientation="landscape"
android:clearTaskOnLaunch="true"
android:windowSoftInputMode="stateAlwaysHidden|adjustPan">
<intent-filter>
@@ -52,7 +51,6 @@
android:label="@string/video_camera_label"
android:configChanges="orientation|screenSize|keyboardHidden"
android:icon="@mipmap/ic_launcher_video_camera"
- android:screenOrientation="landscape"
android:clearTaskOnLaunch="true"
android:windowSoftInputMode="stateAlwaysHidden|adjustPan">
<intent-filter>
@@ -67,7 +65,6 @@
<activity android:name="com.android.camera.panorama.PanoramaActivity"
android:label="@string/pano_dialog_title"
android:configChanges="orientation|screenSize|keyboardHidden"
- android:screenOrientation="landscape"
android:clearTaskOnLaunch="true"
android:windowSoftInputMode="stateAlwaysHidden|adjustPan">
</activity>
diff --git a/res/anim/grow_fade_in_from_bottom.xml b/res/anim/first_level_fade_in.xml
index e2ea9ff1..9cd50b72 100644
--- a/res/anim/grow_fade_in_from_bottom.xml
+++ b/res/anim/first_level_fade_in.xml
@@ -14,5 +14,5 @@
limitations under the License.
-->
<set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_interpolator">
- <translate android:fromYDelta="100%p" android:toYDelta="0" android:duration="300" />
+ <translate android:fromXDelta="100%p" android:toXDelta="0" android:duration="300" />
</set>
diff --git a/res/anim/shrink_fade_out_from_top.xml b/res/anim/first_level_fade_out.xml
index 4d31904c..102b695a 100644
--- a/res/anim/shrink_fade_out_from_top.xml
+++ b/res/anim/first_level_fade_out.xml
@@ -14,5 +14,5 @@
limitations under the License.
-->
<set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_interpolator">
- <translate android:fromYDelta="0" android:toYDelta="100%p" android:duration="300" />
+ <translate android:fromXDelta="0" android:toXDelta="100%p" android:duration="300" />
</set>
diff --git a/res/anim/mode_selection_fade_in.xml b/res/anim/mode_selection_fade_in.xml
index bb710bbe..be316894 100644
--- a/res/anim/mode_selection_fade_in.xml
+++ b/res/anim/mode_selection_fade_in.xml
@@ -14,5 +14,5 @@
limitations under the License.
-->
<set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_interpolator">
- <translate android:fromYDelta="66%p" android:toYDelta="0" android:duration="200" />
+ <translate android:fromXDelta="-66%p" android:toXDelta="0" android:duration="200" />
</set>
diff --git a/res/anim/mode_selection_fade_out.xml b/res/anim/mode_selection_fade_out.xml
index c770420f..a4d225bb 100644
--- a/res/anim/mode_selection_fade_out.xml
+++ b/res/anim/mode_selection_fade_out.xml
@@ -14,5 +14,5 @@
limitations under the License.
-->
<set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_interpolator">
- <translate android:fromYDelta="0" android:toYDelta="66%p" android:duration="200" />
+ <translate android:fromXDelta="0" android:toXDelta="-66%p" android:duration="200" />
</set>
diff --git a/res/anim/grow_fade_in_from_top.xml b/res/anim/second_level_fade_in.xml
index 22c33f7d..baf165f2 100644
--- a/res/anim/grow_fade_in_from_top.xml
+++ b/res/anim/second_level_fade_in.xml
@@ -14,5 +14,5 @@
limitations under the License.
-->
<set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_interpolator">
- <translate android:fromYDelta="-100%p" android:toYDelta="0" android:duration="300" />
+ <translate android:fromXDelta="-100%p" android:toXDelta="0" android:duration="300" />
</set>
diff --git a/res/anim/shrink_fade_out_from_bottom.xml b/res/anim/second_level_fade_out.xml
index 04bfd6e0..272f1712 100644
--- a/res/anim/shrink_fade_out_from_bottom.xml
+++ b/res/anim/second_level_fade_out.xml
@@ -14,5 +14,5 @@
limitations under the License.
-->
<set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_interpolator">
- <translate android:fromYDelta="0" android:toYDelta="-100%p" android:duration="300" />
+ <translate android:fromXDelta="0" android:toXDelta="-100%p" android:duration="300" />
</set>
diff --git a/res/drawable-hdpi/btn_close_settings.png b/res/drawable-hdpi/btn_close_settings.png
index 96e65bc5..f7b863da 100644
--- a/res/drawable-hdpi/btn_close_settings.png
+++ b/res/drawable-hdpi/btn_close_settings.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_zoom_big.9.png b/res/drawable-hdpi/ic_zoom_big.9.png
index 8e6380e9..8c6cdeae 100644
--- a/res/drawable-hdpi/ic_zoom_big.9.png
+++ b/res/drawable-hdpi/ic_zoom_big.9.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_zoom_big_dark.9.png b/res/drawable-hdpi/ic_zoom_big_dark.9.png
index 340254b9..63ba20e8 100644
--- a/res/drawable-hdpi/ic_zoom_big_dark.9.png
+++ b/res/drawable-hdpi/ic_zoom_big_dark.9.png
Binary files differ
diff --git a/res/drawable-hdpi/list_divider.9.png b/res/drawable-hdpi/list_divider.9.png
new file mode 100644
index 00000000..986ab0b9
--- /dev/null
+++ b/res/drawable-hdpi/list_divider.9.png
Binary files differ
diff --git a/res/drawable-mdpi/btn_close_settings.png b/res/drawable-mdpi/btn_close_settings.png
index 4a04aa54..dc24d946 100644
--- a/res/drawable-mdpi/btn_close_settings.png
+++ b/res/drawable-mdpi/btn_close_settings.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_zoom_big.9.png b/res/drawable-mdpi/ic_zoom_big.9.png
index e551fd06..f5e31b44 100644
--- a/res/drawable-mdpi/ic_zoom_big.9.png
+++ b/res/drawable-mdpi/ic_zoom_big.9.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_zoom_big_dark.9.png b/res/drawable-mdpi/ic_zoom_big_dark.9.png
index 4c12ae5e..919db3fb 100644
--- a/res/drawable-mdpi/ic_zoom_big_dark.9.png
+++ b/res/drawable-mdpi/ic_zoom_big_dark.9.png
Binary files differ
diff --git a/res/drawable-mdpi/list_divider.9.png b/res/drawable-mdpi/list_divider.9.png
new file mode 100644
index 00000000..986ab0b9
--- /dev/null
+++ b/res/drawable-mdpi/list_divider.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/btn_close_settings.png b/res/drawable-xhdpi/btn_close_settings.png
index d252c657..4226f346 100644
--- a/res/drawable-xhdpi/btn_close_settings.png
+++ b/res/drawable-xhdpi/btn_close_settings.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_zoom_big.9.png b/res/drawable-xhdpi/ic_zoom_big.9.png
index 48b9e246..48dbf4f8 100644
--- a/res/drawable-xhdpi/ic_zoom_big.9.png
+++ b/res/drawable-xhdpi/ic_zoom_big.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/ic_zoom_big_dark.9.png b/res/drawable-xhdpi/ic_zoom_big_dark.9.png
index b33b5462..43b27403 100644
--- a/res/drawable-xhdpi/ic_zoom_big_dark.9.png
+++ b/res/drawable-xhdpi/ic_zoom_big_dark.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/list_divider.9.png b/res/drawable-xhdpi/list_divider.9.png
new file mode 100644
index 00000000..e62f011d
--- /dev/null
+++ b/res/drawable-xhdpi/list_divider.9.png
Binary files differ
diff --git a/res/layout-sw600dp/pano_capture.xml b/res/layout-sw600dp/pano_capture.xml
new file mode 100644
index 00000000..2f58b107
--- /dev/null
+++ b/res/layout-sw600dp/pano_capture.xml
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/pano_capture_layout"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:orientation="horizontal">
+
+ <RelativeLayout android:id="@+id/frame_layout"
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1">
+
+ <LinearLayout android:id="@+id/pano_capture_preview"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+
+ <!-- The top bar with capture indication -->
+ <FrameLayout android:id="@+id/pano_capture_indicator_layout"
+ style="@style/PanoViewHorizontalBar"
+ android:padding="5dp">
+
+ <com.android.camera.ui.RotateLayout
+ android:id="@+id/pano_capture_indicator"
+ android:visibility="gone"
+ android:layout_gravity="top|left"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <TextView
+ android:text="@string/pano_capture_indication"
+ android:paddingLeft="0dp"
+ android:drawablePadding="5sp"
+ android:drawableLeft="@drawable/ic_pan_recording_indicator"
+ android:layout_marginLeft="16dp"
+ android:layout_marginTop="16dp"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
+ </com.android.camera.ui.RotateLayout>
+ </FrameLayout>
+
+ <RelativeLayout
+ android:layout_gravity="center"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/pano_mosaic_surface_height">
+ <com.android.camera.panorama.MosaicRendererSurfaceView
+ android:id="@+id/pano_renderer"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
+ <View
+ android:id="@+id/pano_speed_indication_border"
+ android:visibility="gone"
+ android:background="@drawable/ic_pan_border_fast"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
+ </RelativeLayout>
+
+ <!-- The bottom bar with progress bar and direction indicators -->
+ <RelativeLayout
+ style="@style/PanoViewHorizontalBar">
+
+ <com.android.camera.ui.RotateLayout
+ android:id="@+id/pano_pan_progress_bar_layout"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_centerInParent="true">
+ <com.android.camera.panorama.PanoProgressBar
+ android:id="@+id/pano_pan_progress_bar"
+ android:visibility="gone"
+ android:src="@drawable/ic_pan_progression"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
+ </com.android.camera.ui.RotateLayout>
+ <ImageView
+ android:id="@+id/pano_pan_left_indicator"
+ android:src="@drawable/pano_direction_left_indicator"
+ android:visibility="gone"
+ android:layout_marginRight="5dp"
+ android:layout_toLeftOf="@id/pano_pan_progress_bar_layout"
+ android:layout_centerVertical="true"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
+
+ <ImageView
+ android:id="@+id/pano_pan_right_indicator"
+ android:src="@drawable/pano_direction_right_indicator"
+ android:visibility="gone"
+ android:layout_marginLeft="5dp"
+ android:layout_toRightOf="@id/pano_pan_progress_bar_layout"
+ android:layout_centerVertical="true"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
+ </RelativeLayout>
+
+ </LinearLayout>
+
+ <!-- The hint for "Too fast" text view-->
+ <com.android.camera.ui.RotateLayout
+ android:id="@+id/pano_capture_too_fast_textview_layout"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_centerInParent="true">
+ <TextView android:id="@+id/pano_capture_too_fast_textview"
+ android:text="@string/pano_too_fast_prompt"
+ android:textAppearance="?android:textAppearanceMedium"
+ android:layout_width="wrap_content"
+ android:layout_height="@dimen/pano_capture_too_fast_text_height"
+ android:visibility="gone" />
+ </com.android.camera.ui.RotateLayout>
+ </RelativeLayout>
+
+ <include layout="@layout/camera_control" />
+
+</LinearLayout>
diff --git a/res/layout-sw600dp/pano_review.xml b/res/layout-sw600dp/pano_review.xml
new file mode 100644
index 00000000..c16df1ac
--- /dev/null
+++ b/res/layout-sw600dp/pano_review.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/pano_review_layout"
+ android:visibility="invisible"
+ android:orientation="vertical"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent">
+
+ <LinearLayout android:id="@+id/pano_review_control"
+ style="@style/PanoViewHorizontalBar"
+ android:gravity="right"
+ android:orientation="horizontal">
+
+ <com.android.camera.ui.RotateLayout
+ android:id="@+id/pano_review_cancel_button_layout"
+ android:layout_gravity="center_vertical"
+ android:layout_marginRight="20dp"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <TextView android:id="@+id/pano_review_cancel_button"
+ android:text="@string/review_cancel"
+ android:gravity="right"
+ android:clickable="true"
+ android:onClick="onCancelButtonClicked"
+ android:textAppearance="?android:textAppearanceMedium"
+ android:minWidth="@dimen/pano_review_button_width"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content" />
+ </com.android.camera.ui.RotateLayout>
+ </LinearLayout>
+
+ <ImageView android:id="@+id/pano_reviewarea"
+ android:scaleType="fitCenter"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/pano_mosaic_surface_height" />
+
+ <RelativeLayout style="@style/PanoViewHorizontalBar">
+ <com.android.camera.ui.RotateLayout
+ android:id="@+id/pano_review_saving_indication_layout"
+ android:layout_alignParentLeft="true"
+ android:layout_centerVertical="true"
+ android:layout_marginLeft="20dp"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content">
+ <TextView android:id="@+id/pano_review_saving_indication"
+ android:text="@string/pano_review_saving_indication_str"
+ android:textAppearance="?android:textAppearanceMedium"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content" />
+ </com.android.camera.ui.RotateLayout>
+
+ <com.android.camera.ui.RotateLayout
+ android:id="@+id/pano_saving_progress_bar_layout"
+ android:layout_centerInParent="true"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content">
+ <com.android.camera.panorama.PanoProgressBar
+ android:id="@+id/pano_saving_progress_bar"
+ android:src="@drawable/ic_pan_progression"
+ android:layout_centerInParent="true"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content" />
+ </com.android.camera.ui.RotateLayout>
+ </RelativeLayout>
+</LinearLayout>
diff --git a/res/layout-sw600dp/share_popup.xml b/res/layout-sw600dp/share_popup.xml
new file mode 100644
index 00000000..5f72365c
--- /dev/null
+++ b/res/layout-sw600dp/share_popup.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 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.
+-->
+
+<!-- Use a full-screen popup window because UI has some intermediate problems
+ when its size is changed. -->
+<FrameLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:camera="http://schemas.android.com/apk/res/com.android.camera"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@color/share_popup_background">
+ <FrameLayout android:id="@+id/root"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="left|center">
+ <RelativeLayout android:id="@+id/share_view"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@drawable/border_last_picture">
+ <com.android.camera.ui.RotateLayout
+ android:id="@+id/thumbnail_rotate_layout"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentTop="true"
+ android:layout_alignParentLeft="true">
+ <!-- The size of the thumbnail is calculated in SharePopup.java -->
+ <FrameLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" >
+ <ImageView android:id="@+id/thumbnail"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:adjustViewBounds="true"
+ android:scaleType="fitCenter"/>
+ <ImageView android:id="@+id/play"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_gravity="center"
+ android:scaleType="center"
+ style="@style/ReviewPlayIcon"/>
+ </FrameLayout>
+ </com.android.camera.ui.RotateLayout>
+ </RelativeLayout>
+ <LinearLayout
+ android:layout_width="@dimen/share_item_width"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:layout_gravity="right"
+ android:background="@color/share_icon_background">
+ <com.android.camera.ui.RotateLayout
+ android:layout_marginTop="8dip"
+ android:id="@+id/goto_gallery_button_rotate"
+ android:layout_gravity="center"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" >
+ <ImageButton
+ android:id="@+id/goto_gallery_button"
+ android:background="?android:attr/selectableItemBackground"
+ android:layout_gravity="center"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:src="@drawable/ic_gallery" />
+ </com.android.camera.ui.RotateLayout>
+ <View
+ android:layout_width="match_parent"
+ android:layout_margin="8dip"
+ android:layout_height="1dp"
+ android:background="#5affffff" />
+
+ <GridView android:id="@+id/share_list"
+ style="@style/OneColumnGrid" />
+ </LinearLayout>
+ </FrameLayout>
+</FrameLayout>
diff --git a/res/layout-sw600dp/viewfinder_labels_video.xml b/res/layout-sw600dp/viewfinder_labels_video.xml
new file mode 100644
index 00000000..6fa7d2dc
--- /dev/null
+++ b/res/layout-sw600dp/viewfinder_labels_video.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent">
+ <TextView android:id="@+id/recording_time"
+ style="@style/OnViewfinderLabel"
+ android:gravity="center"
+ android:drawableLeft="@drawable/ic_recording_indicator"
+ android:drawablePadding="5dp"
+ android:visibility="gone" />
+ <TextView android:id="@+id/time_lapse_label"
+ android:text="@string/time_lapse_title"
+ style="@style/OnViewfinderLabel"
+ android:visibility="gone" />
+</LinearLayout>
diff --git a/res/layout-w1024dp/priority_indicators.xml b/res/layout-w1024dp/priority_indicators.xml
new file mode 100644
index 00000000..49264842
--- /dev/null
+++ b/res/layout-w1024dp/priority_indicators.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="horizontal"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentTop="true"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:padding="8dp">
+ <ImageView style="@style/OnScreenIndicator"
+ android:id="@+id/onscreen_gps_indicator_no_signal"
+ android:src="@drawable/ic_viewfinder_gps_no_signal"/>
+ <ImageView style="@style/OnScreenIndicator"
+ android:id="@+id/onscreen_gps_indicator_on"
+ android:src="@drawable/ic_viewfinder_gps_on"/>
+ <TextView style="@style/OnScreenIndicator"
+ android:id="@+id/onscreen_exposure_indicator"
+ android:gravity="center_vertical"
+ android:textSize="15dp"
+ android:textColor="@android:color/white"/>
+</LinearLayout>
diff --git a/res/layout/bg_replacement_training_message.xml b/res/layout/bg_replacement_training_message.xml
index 382c7c48..449e8df9 100644
--- a/res/layout/bg_replacement_training_message.xml
+++ b/res/layout/bg_replacement_training_message.xml
@@ -16,20 +16,20 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/bg_replace_message_frame"
- android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:layout_width="match_parent"
android:visibility="gone"
android:onClick="onProtectiveCurtainClick"
android:background="#77000000">
<com.android.camera.ui.RotateLayout
android:id="@+id/bg_replace_message"
- android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
android:layout_centerInParent="true">
<LinearLayout
- android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:orientation="vertical"
+ android:layout_width="wrap_content"
+ android:orientation="horizontal"
android:background="@drawable/dialog_full_holo_dark">
<TextView
android:layout_width="wrap_content"
@@ -39,13 +39,13 @@
android:padding="32dp" />
<View
- android:layout_width="match_parent"
- android:layout_height="1px"
+ android:layout_height="match_parent"
+ android:layout_width="1px"
android:background="#aaaaaa" />
<Button android:id="@+id/bg_replace_cancel_button"
- android:layout_width="match_parent"
- android:layout_height="48dip"
+ android:layout_height="match_parent"
+ android:layout_width="48dip"
android:layout_gravity="center"
android:textAppearance="?android:attr/textAppearanceMedium"
style="?android:attr/borderlessButtonStyle"
diff --git a/res/layout/camera.xml b/res/layout/camera.xml
index bc9e3135..939007a8 100644
--- a/res/layout/camera.xml
+++ b/res/layout/camera.xml
@@ -17,7 +17,7 @@
<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:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include layout="@layout/preview_frame"/>
diff --git a/res/layout/camera_control.xml b/res/layout/camera_control.xml
index 366393da..3595849c 100644
--- a/res/layout/camera_control.xml
+++ b/res/layout/camera_control.xml
@@ -16,15 +16,15 @@
<com.android.camera.ui.ControlPanelLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/control_panel"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:minWidth="76dp"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:minHeight="76dp"
android:background="@drawable/bg_camera_pattern">
<include layout="@layout/review_thumbnail" />
<include layout="@layout/review_control" />
<com.android.camera.ShutterButton android:id="@+id/shutter_button"
- android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
android:layout_centerInParent="true"
android:scaleType="center"
android:clickable="true"
diff --git a/res/layout/effect_setting_item.xml b/res/layout/effect_setting_item.xml
index 0b212c34..86d09dd5 100644
--- a/res/layout/effect_setting_item.xml
+++ b/res/layout/effect_setting_item.xml
@@ -17,8 +17,8 @@
style="@style/EffectSettingItem">
<ImageView android:id="@+id/image"
- android:layout_width="@dimen/effect_setting_item_icon_width"
android:layout_height="@dimen/effect_setting_item_icon_width"
+ android:layout_width="@dimen/effect_setting_item_icon_width"
android:layout_gravity="center_horizontal"
android:scaleType="fitCenter"
android:adjustViewBounds="true" />
diff --git a/res/layout/focus_indicator.xml b/res/layout/focus_indicator.xml
index 0e670612..9e66b405 100644
--- a/res/layout/focus_indicator.xml
+++ b/res/layout/focus_indicator.xml
@@ -16,10 +16,10 @@
<com.android.camera.ui.RotateLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/focus_indicator_rotate_layout"
- android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
android:layout_centerInParent="true">
<com.android.camera.ui.FocusIndicatorView android:id="@+id/focus_indicator"
- android:layout_width="120dp"
- android:layout_height="120dp"/>
+ android:layout_height="120dp"
+ android:layout_width="120dp"/>
</com.android.camera.ui.RotateLayout>
diff --git a/res/layout/indicator_bar.xml b/res/layout/indicator_bar.xml
index 764d6d60..33a8c7a2 100644
--- a/res/layout/indicator_bar.xml
+++ b/res/layout/indicator_bar.xml
@@ -15,59 +15,58 @@
-->
<com.android.camera.ui.IndicatorControlBarContainer xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/indicator_control"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
android:clickable="true"
- android:layout_alignParentRight="true">
+ android:layout_alignParentBottom="true">
<RelativeLayout
android:id="@+id/control_bars"
- android:layout_toRightOf="@+id/zoom_index_bar"
- android:layout_width="@dimen/indicator_bar_width"
- android:layout_height="match_parent">
+ android:layout_height="@dimen/indicator_bar_width"
+ android:layout_width="match_parent">
<com.android.camera.ui.IndicatorControlBar
android:id="@+id/indicator_bar"
android:padding="8dp"
- android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_centerHorizontal="true">
+ android:layout_width="match_parent"
+ android:layout_centerVertical="true">
<com.android.camera.ui.ZoomControlBar
android:id="@+id/zoom_control"
- android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:layout_width="match_parent"
android:visibility="gone" />
<com.android.camera.ui.RotateImageView
android:id="@+id/second_level_indicator_bar_icon"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
+ android:layout_height="match_parent"
+ android:layout_width="wrap_content"
+ android:layout_alignParentLeft="true"
android:contentDescription="@string/accessibility_second_level_indicators"
android:src="@drawable/ic_settings_holo_light" />
</com.android.camera.ui.IndicatorControlBar>
<com.android.camera.ui.SecondLevelIndicatorControlBar
android:id="@+id/second_level_indicator_bar"
- android:layout_width="match_parent"
android:layout_height="match_parent"
- android:paddingTop="8dp"
- android:paddingBottom="8dp"
- android:layout_centerHorizontal="true"
+ android:layout_width="match_parent"
+ android:paddingRight="8dp"
+ android:paddingLeft="8dp"
+ android:layout_centerVertical="true"
android:background="@color/indicator_background"
android:visibility="gone">
<View android:id="@+id/divider"
- android:layout_width="match_parent"
- android:layout_height="1dp"
+ android:layout_height="match_parent"
+ android:layout_width="1dp"
android:background="@android:color/white" />
<View android:id="@+id/indicator_highlight"
- android:layout_alignParentLeft="true"
- android:layout_width="3dp"
- android:layout_height="0dp"
+ android:layout_alignParentTop="true"
+ android:layout_height="3dp"
+ android:layout_width="0dp"
android:background="@color/mode_selection_border"
android:visibility="gone" />
<com.android.camera.ui.ColorFilterImageView
android:id="@+id/back_to_first_level"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_width="wrap_content"
android:contentDescription="@string/accessibility_back_to_first_level"
android:src="@drawable/btn_close_settings" />
</com.android.camera.ui.SecondLevelIndicatorControlBar>
diff --git a/res/layout/mode_picker.xml b/res/layout/mode_picker.xml
index 12c9618d..1b5e16b6 100644
--- a/res/layout/mode_picker.xml
+++ b/res/layout/mode_picker.xml
@@ -15,90 +15,91 @@
-->
<com.android.camera.ModePicker xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mode_picker"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_alignParentBottom="true"
+ android:layout_height="match_parent"
+ android:layout_width="wrap_content"
+ android:layout_alignParentLeft="true"
android:visibility="gone">
<RelativeLayout android:id="@+id/current_mode"
- android:orientation="vertical"
- android:layout_alignBottom="@+id/mode_selection"
- android:layout_width="match_parent"
- android:layout_height="55dp"
+ android:orientation="horizontal"
+ android:layout_alignLeft="@+id/mode_selection"
+ android:layout_height="match_parent"
+ android:layout_width="55dp"
android:contentDescription="@string/accessibility_mode_picker"
android:background="@drawable/bg_mode_picker">
- <View android:layout_width="match_parent"
- android:layout_height="1dp"
- android:background="@android:color/white"/>
<RelativeLayout
- android:orientation="horizontal"
+ android:orientation="vertical"
android:contentDescription="@string/empty"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:layout_height="match_parent"
+ android:layout_width="match_parent">
<com.android.camera.ui.RotateImageView android:id="@+id/mode_0"
+ android:layout_height="32dp"
android:layout_width="32dp"
- android:layout_height="wrap_content"
- android:layout_centerVertical="true"
- android:layout_alignParentLeft="true"
- android:layout_marginLeft="8dp"
+ android:layout_centerHorizontal="true"
+ android:layout_alignParentTop="true"
+ android:layout_marginTop="8dp"
android:scaleType="fitCenter"
android:contentDescription="@string/empty"
android:src="@drawable/ic_switch_video_holo_light" />
<com.android.camera.ui.RotateImageView android:id="@+id/mode_1"
+ android:layout_height="wrap_content"
android:layout_width="wrap_content"
- android:layout_height="match_parent"
android:layout_centerInParent="true"
android:scaleType="fitCenter"
android:contentDescription="@string/empty"
android:src="@drawable/ic_switch_camera_holo_light" />
<com.android.camera.ui.RotateImageView android:id="@+id/mode_2"
+ android:layout_height="32dp"
android:layout_width="32dp"
- android:layout_height="wrap_content"
- android:layout_centerVertical="true"
- android:layout_alignParentRight="true"
- android:layout_marginRight="8dp"
+ android:layout_centerHorizontal="true"
+ android:layout_alignParentBottom="true"
+ android:layout_marginBottom="8dp"
android:scaleType="fitCenter"
android:contentDescription="@string/empty"
android:src="@drawable/ic_switch_pan_holo_light" />
</RelativeLayout>
+ <View android:layout_height="match_parent"
+ android:layout_width="1dp"
+ android:layout_alignParentRight="true"
+ android:background="@android:color/white"/>
</RelativeLayout>
<RelativeLayout android:id="@+id/mode_selection"
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="198dp"
+ android:orientation="horizontal"
+ android:layout_height="match_parent"
+ android:layout_width="198dp"
android:background="@drawable/bg_switcher"
android:visibility="gone">
- <View android:layout_width="match_parent"
- android:layout_height="1dp"
- android:layout_alignParentTop="true"
- android:background="@color/mode_selection_border"/>
<LinearLayout
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_centerVertical="true">
+ android:orientation="horizontal"
+ android:layout_height="match_parent"
+ android:layout_width="wrap_content"
+ android:layout_centerHorizontal="true">
<com.android.camera.ui.RotateImageView android:id="@+id/mode_camera"
android:contentDescription="@string/switch_to_camera_label"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginBottom="10dp"
+ android:layout_height="match_parent"
+ android:layout_width="wrap_content"
+ android:layout_marginRight="10dp"
android:scaleType="center"
android:background="@drawable/bg_pressed"
android:src="@drawable/ic_switch_camera_holo_light" />
<com.android.camera.ui.RotateImageView android:id="@+id/mode_video"
android:contentDescription="@string/switch_to_video_label"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginBottom="10dp"
+ android:layout_height="match_parent"
+ android:layout_width="wrap_content"
+ android:layout_marginRight="10dp"
android:scaleType="center"
android:background="@drawable/bg_pressed"
android:src="@drawable/ic_switch_video_holo_light" />
<com.android.camera.ui.RotateImageView android:id="@+id/mode_panorama"
android:contentDescription="@string/switch_to_panorama_label"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_width="wrap_content"
android:scaleType="center"
android:background="@drawable/bg_pressed"
android:src="@drawable/ic_switch_pan_holo_light" />
</LinearLayout>
+ <View android:layout_height="match_parent"
+ android:layout_width="1dp"
+ android:layout_alignParentRight="true"
+ android:background="@color/mode_selection_border"/>
</RelativeLayout>
</com.android.camera.ModePicker>
diff --git a/res/layout/on_screen_hint.xml b/res/layout/on_screen_hint.xml
index 312ff6d5..b47a9e69 100644
--- a/res/layout/on_screen_hint.xml
+++ b/res/layout/on_screen_hint.xml
@@ -18,15 +18,15 @@
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
android:layout_height="match_parent"
- android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:orientation="horizontal"
android:background="@drawable/on_screen_hint_frame">
<TextView
android:id="@+id/message"
- android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
android:layout_weight="1"
android:textAppearance="@style/OnScreenHintTextAppearance.Small"
android:textColor="#ffffffff"
diff --git a/res/layout/pano_capture.xml b/res/layout/pano_capture.xml
index a91104a5..d6430f4d 100644
--- a/res/layout/pano_capture.xml
+++ b/res/layout/pano_capture.xml
@@ -16,42 +16,63 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/pano_capture_layout"
- android:layout_width="match_parent"
android:layout_height="match_parent"
- android:orientation="horizontal">
+ android:layout_width="match_parent"
+ android:orientation="vertical">
<RelativeLayout android:id="@+id/frame_layout"
- android:layout_width="0dp"
- android:layout_height="match_parent"
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
android:layout_weight="1">
<LinearLayout android:id="@+id/pano_capture_preview"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:orientation="vertical">
+ android:orientation="horizontal">
- <!-- The top bar with capture indication -->
- <FrameLayout android:id="@+id/pano_capture_indicator_layout"
- style="@style/PanoViewHorizontalBar">
+ <!-- The bottom bar with progress bar and direction indicators -->
+ <RelativeLayout
+ style="@style/PanoViewHorizontalBar">
- <TextView
- android:id="@+id/pano_capture_indicator"
- android:text="@string/pano_capture_indication"
- android:paddingTop="0dp"
- android:drawablePadding="5sp"
- android:drawableLeft="@drawable/ic_pan_recording_indicator"
+ <com.android.camera.ui.RotateLayout
+ android:id="@+id/pano_pan_progress_bar_layout"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_centerInParent="true">
+ <com.android.camera.panorama.PanoProgressBar
+ android:id="@+id/pano_pan_progress_bar"
+ android:visibility="gone"
+ android:src="@drawable/ic_pan_progression"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
+ </com.android.camera.ui.RotateLayout>
+ <ImageView
+ android:id="@+id/pano_pan_left_indicator"
+ android:src="@drawable/pano_direction_left_indicator"
+ android:rotation="90"
android:visibility="gone"
- android:layout_marginLeft="16dp"
- android:layout_marginTop="16dp"
- android:layout_gravity="top|left"
+ android:layout_marginBottom="5dp"
+ android:layout_above="@id/pano_pan_progress_bar_layout"
+ android:layout_centerHorizontal="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
- </FrameLayout>
+
+ <ImageView
+ android:id="@+id/pano_pan_right_indicator"
+ android:src="@drawable/pano_direction_right_indicator"
+ android:rotation="90"
+ android:visibility="gone"
+ android:layout_marginTop="5dp"
+ android:layout_below="@id/pano_pan_progress_bar_layout"
+ android:layout_centerHorizontal="true"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
+ </RelativeLayout>
<RelativeLayout
android:layout_gravity="center"
- android:layout_width="match_parent"
- android:layout_height="@dimen/pano_mosaic_surface_height">
+ android:layout_width="@dimen/pano_mosaic_surface_height"
+ android:layout_height="match_parent">
<com.android.camera.panorama.MosaicRendererSurfaceView
android:id="@+id/pano_renderer"
android:layout_width="match_parent"
@@ -62,50 +83,46 @@
android:background="@drawable/ic_pan_border_fast"
android:layout_width="match_parent"
android:layout_height="match_parent" />
-
</RelativeLayout>
- <!-- The bottom bar with progress bar and direction indicators -->
- <RelativeLayout
- style="@style/PanoViewHorizontalBar">
- <com.android.camera.panorama.PanoProgressBar
- android:id="@+id/pano_pan_progress_bar"
- android:visibility="gone"
- android:src="@drawable/ic_pan_progression"
- android:layout_centerInParent="true"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content" />
- <ImageView
- android:id="@+id/pano_pan_left_indicator"
- android:src="@drawable/pano_direction_left_indicator"
- android:visibility="gone"
- android:layout_marginRight="5dp"
- android:layout_toLeftOf="@id/pano_pan_progress_bar"
- android:layout_centerVertical="true"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content" />
+ <!-- The top bar with capture indication -->
+ <FrameLayout android:id="@+id/pano_capture_indicator_layout"
+ style="@style/PanoViewHorizontalBar"
+ android:padding="5dp">
- <ImageView
- android:id="@+id/pano_pan_right_indicator"
- android:src="@drawable/pano_direction_right_indicator"
+ <com.android.camera.ui.RotateLayout
+ android:id="@+id/pano_capture_indicator"
android:visibility="gone"
- android:layout_marginLeft="5dp"
- android:layout_toRightOf="@id/pano_pan_progress_bar"
- android:layout_centerVertical="true"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content" />
- </RelativeLayout>
+ android:layout_gravity="top|right"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <TextView
+ android:text="@string/pano_capture_indication"
+ android:paddingTop="0dp"
+ android:drawablePadding="5sp"
+ android:drawableLeft="@drawable/ic_pan_recording_indicator"
+ android:layout_marginLeft="16dp"
+ android:layout_marginTop="16dp"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
+ </com.android.camera.ui.RotateLayout>
+ </FrameLayout>
</LinearLayout>
<!-- The hint for "Too fast" text view-->
- <TextView android:id="@+id/pano_capture_too_fast_textview"
- android:text="@string/pano_too_fast_prompt"
- android:textAppearance="?android:textAppearanceMedium"
- android:layout_height="@dimen/pano_capture_too_fast_text_height"
+ <com.android.camera.ui.RotateLayout
+ android:id="@+id/pano_capture_too_fast_textview_layout"
android:layout_width="wrap_content"
- android:visibility="gone"
- android:layout_centerInParent="true" />
+ android:layout_height="wrap_content"
+ android:layout_centerInParent="true">
+ <TextView android:id="@+id/pano_capture_too_fast_textview"
+ android:text="@string/pano_too_fast_prompt"
+ android:textAppearance="?android:textAppearanceMedium"
+ android:layout_width="@dimen/pano_capture_too_fast_text_height"
+ android:layout_height="wrap_content"
+ android:visibility="gone" />
+ </com.android.camera.ui.RotateLayout>
</RelativeLayout>
<include layout="@layout/camera_control" />
diff --git a/res/layout/pano_review.xml b/res/layout/pano_review.xml
index 5b9c2fc5..2900a5aa 100644
--- a/res/layout/pano_review.xml
+++ b/res/layout/pano_review.xml
@@ -17,47 +17,65 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/pano_review_layout"
android:visibility="invisible"
- android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:orientation="horizontal"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent">
- <LinearLayout android:id="@+id/pano_review_control"
- style="@style/PanoViewHorizontalBar"
- android:gravity="right"
- android:orientation="horizontal"
- android:layout_alignParentBottom="true"
- android:layout_width="match_parent">
-
- <TextView android:id="@+id/pano_review_cancel_button"
- android:text="@string/review_cancel"
- android:clickable="true"
- android:onClick="onCancelButtonClicked"
- android:textAppearance="?android:textAppearanceMedium"
- android:minWidth="@dimen/pano_review_button_width"
+ <RelativeLayout style="@style/PanoViewHorizontalBar">
+ <com.android.camera.ui.RotateLayout
+ android:id="@+id/pano_review_saving_indication_layout"
+ android:layout_alignParentTop="true"
+ android:layout_centerHorizontal="true"
+ android:layout_marginTop="20dp"
android:layout_width="wrap_content"
- android:layout_height="@dimen/pano_review_button_height" />
- </LinearLayout>
+ android:layout_height="wrap_content">
+ <TextView android:id="@+id/pano_review_saving_indication"
+ android:text="@string/pano_review_saving_indication_str"
+ android:textAppearance="?android:textAppearanceMedium"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content" />
+ </com.android.camera.ui.RotateLayout>
+
+ <com.android.camera.ui.RotateLayout
+ android:id="@+id/pano_saving_progress_bar_layout"
+ android:layout_centerInParent="true"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content">
+ <com.android.camera.panorama.PanoProgressBar
+ android:id="@+id/pano_saving_progress_bar"
+ android:src="@drawable/ic_pan_progression"
+ android:layout_centerInParent="true"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content" />
+ </com.android.camera.ui.RotateLayout>
+ </RelativeLayout>
<ImageView android:id="@+id/pano_reviewarea"
+ android:rotation="90"
android:scaleType="fitCenter"
- android:layout_width="match_parent"
- android:layout_height="@dimen/pano_mosaic_surface_height" />
+ android:layout_height="match_parent"
+ android:layout_width="@dimen/pano_mosaic_surface_height" />
- <RelativeLayout style="@style/PanoViewHorizontalBar">
- <TextView android:id="@+id/pano_review_saving_indication"
- android:text="@string/pano_review_saving_indication_str"
- android:textSize="@dimen/pano_review_saving_indication_size"
- android:layout_alignParentLeft="true"
- android:layout_centerVertical="true"
- android:layout_marginLeft="20dp"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content" />
+ <LinearLayout android:id="@+id/pano_review_control"
+ style="@style/PanoViewHorizontalBar"
+ android:gravity="bottom"
+ android:orientation="vertical"
+ android:layout_alignParentBottom="true"
+ android:layout_height="match_parent">
- <com.android.camera.panorama.PanoProgressBar
- android:id="@+id/pano_saving_progress_bar"
- android:src="@drawable/ic_pan_progression"
- android:layout_centerInParent="true"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content" />
- </RelativeLayout>
+ <com.android.camera.ui.RotateLayout
+ android:id="@+id/pano_review_cancel_button_layout"
+ android:layout_gravity="center_horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <TextView android:id="@+id/pano_review_cancel_button"
+ android:text="@string/review_cancel"
+ android:clickable="true"
+ android:onClick="onCancelButtonClicked"
+ android:textAppearance="?android:textAppearanceMedium"
+ android:minWidth="@dimen/pano_review_button_width"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content" />
+ </com.android.camera.ui.RotateLayout>
+ </LinearLayout>
</LinearLayout>
diff --git a/res/layout/pano_rotate_dialog.xml b/res/layout/pano_rotate_dialog.xml
new file mode 100644
index 00000000..456bb027
--- /dev/null
+++ b/res/layout/pano_rotate_dialog.xml
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 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.
+-->
+
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:gravity="center"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <com.android.camera.ui.RotateLayout
+ android:id="@+id/rotate_dialog_layout"
+ android:visibility="gone"
+ android:gravity="center"
+ android:layout_gravity="center"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" >
+
+ <FrameLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:background="@color/popup_background">
+
+ <LinearLayout
+ android:orientation="vertical"
+ android:layout_gravity="center"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content">
+
+ <LinearLayout android:id="@+id/rotate_dialog_title_layout"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <TextView android:id="@+id/rotate_dialog_title"
+ style="@android:style/TextAppearance.Holo.DialogWindowTitle"
+ android:gravity="center_vertical"
+ android:layout_marginLeft="16dip"
+ android:layout_marginRight="16dip"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:minHeight="64dp"/>
+ <View android:id="@+id/rotate_dialog_title_divider"
+ layout_weight="bottom"
+ style="@style/PopupTitleSeperator" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/dialog_layout"
+ android:orientation="horizontal"
+ android:background="@color/popup_background"
+ android:padding="9dp"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content">
+
+ <ProgressBar
+ android:id="@+id/rotate_dialog_spinner"
+ android:layout_gravity="center_vertical"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
+ <TextView
+ style="@android:style/TextAppearance.Holo.Medium"
+ android:id="@+id/rotate_dialog_text"
+ android:layout_gravity="center_vertical"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
+ </LinearLayout>
+
+ <LinearLayout android:id="@+id/rotate_dialog_button_layout"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center"
+ android:minHeight="48dp"
+ android:orientation="vertical"
+ android:divider="@drawable/list_divider"
+ android:showDividers="beginning"
+ android:dividerPadding="0dip">
+
+ <Button android:id="@+id/rotate_dialog_button"
+ style="@android:style/Widget.Holo.Button.Borderless"
+ android:gravity="center"
+ android:text="@string/review_ok"
+ android:maxLines="2"
+ android:minHeight="48dp"
+ android:textSize="14sp"
+ android:onClick="onAlertDialogButtonClicked"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" />
+ </LinearLayout>
+ </LinearLayout>
+ </FrameLayout>
+ </com.android.camera.ui.RotateLayout>
+</FrameLayout>
diff --git a/res/layout/panorama.xml b/res/layout/panorama.xml
index 2b25fe11..d56cca00 100644
--- a/res/layout/panorama.xml
+++ b/res/layout/panorama.xml
@@ -17,9 +17,10 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:camera="http://schemas.android.com/apk/res/com.android.camera"
android:id="@+id/pano_layout"
- android:layout_height="match_parent"
- android:layout_width="match_parent">
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
<include layout="@layout/pano_capture" />
<include layout="@layout/pano_review" />
+ <include layout="@layout/pano_rotate_dialog" />
</RelativeLayout>
diff --git a/res/layout/preview_frame_video.xml b/res/layout/preview_frame_video.xml
index af945f5d..992eb46f 100644
--- a/res/layout/preview_frame_video.xml
+++ b/res/layout/preview_frame_video.xml
@@ -16,25 +16,25 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/frame_layout"
- android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:layout_width="match_parent"
android:layout_weight="1">
<com.android.camera.PreviewFrameLayout android:id="@+id/frame"
- android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:layout_width="match_parent"
android:layout_centerInParent="true"
android:background="@drawable/border_preview">
<SurfaceView android:id="@+id/camera_preview"
- android:layout_width="match_parent"
- android:layout_height="match_parent" />
+ android:layout_height="match_parent"
+ android:layout_width="match_parent" />
<com.android.camera.ui.RotateLayout android:id="@+id/recording_time_rect"
style="@style/ViewfinderLableLayout">
<include layout="@layout/viewfinder_labels_video" android:id="@+id/labels" />
</com.android.camera.ui.RotateLayout>
<ImageView android:id="@+id/review_image"
- android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:layout_width="match_parent"
android:visibility="gone"
android:background="@android:color/black"/>
<com.android.camera.ui.RotateImageView
@@ -50,8 +50,8 @@
<!-- Fill up the space below preview frame with black. -->
<View
android:background="#ff000000"
- android:layout_width="match_parent"
- android:layout_height="0dip"
+ android:layout_height="match_parent"
+ android:layout_width="0dip"
android:layout_below="@+id/frame"
android:layout_alignParentBottom="true" />
diff --git a/res/layout/priority_indicators.xml b/res/layout/priority_indicators.xml
index 49264842..794dfb85 100644
--- a/res/layout/priority_indicators.xml
+++ b/res/layout/priority_indicators.xml
@@ -14,20 +14,24 @@
limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="horizontal"
- android:layout_alignParentLeft="true"
+ android:orientation="vertical"
+ android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
- android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
android:padding="8dp">
<ImageView style="@style/OnScreenIndicator"
+ android:padding="1dp"
android:id="@+id/onscreen_gps_indicator_no_signal"
android:src="@drawable/ic_viewfinder_gps_no_signal"/>
<ImageView style="@style/OnScreenIndicator"
+ android:padding="1dp"
android:id="@+id/onscreen_gps_indicator_on"
android:src="@drawable/ic_viewfinder_gps_on"/>
<TextView style="@style/OnScreenIndicator"
android:id="@+id/onscreen_exposure_indicator"
+ android:layout_marginTop="6dp"
+ android:rotation="90.0"
android:gravity="center_vertical"
android:textSize="15dp"
android:textColor="@android:color/white"/>
diff --git a/res/layout/review_control.xml b/res/layout/review_control.xml
index 6a25d2c7..d590dbd7 100644
--- a/res/layout/review_control.xml
+++ b/res/layout/review_control.xml
@@ -16,18 +16,18 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/review_control"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:layout_height="match_parent"
+ android:layout_width="match_parent">
<com.android.camera.ui.RotateImageView android:id="@+id/btn_done"
style="@style/ReviewControlIcon"
android:visibility="gone"
- android:layout_alignParentTop="true"
- android:layout_marginTop="20dp"
+ android:layout_alignParentRight="true"
+ android:layout_marginRight="20dp"
android:onClick="onReviewDoneClicked"
android:src="@drawable/ic_menu_done_holo_light" />
<ImageView android:id="@+id/btn_retake"
- android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
android:layout_centerInParent="true"
android:clickable="true"
android:focusable="true"
@@ -37,8 +37,8 @@
<com.android.camera.ui.RotateImageView android:id="@+id/btn_cancel"
style="@style/ReviewControlIcon"
android:visibility="gone"
- android:layout_alignParentBottom="true"
- android:layout_marginBottom="20dp"
+ android:layout_alignParentLeft="true"
+ android:layout_marginLeft="20dp"
android:onClick="onReviewCancelClicked"
android:src="@drawable/ic_menu_cancel_holo_light" />
</RelativeLayout>
diff --git a/res/layout/setting_item.xml b/res/layout/setting_item.xml
index 5bcf3f77..3af3c3ec 100644
--- a/res/layout/setting_item.xml
+++ b/res/layout/setting_item.xml
@@ -22,8 +22,8 @@
<TextView android:id="@+id/text"
style="@style/SettingItemTitle" />
<ImageView android:id="@+id/image"
- android:layout_width="@dimen/setting_item_icon_width"
android:layout_height="@dimen/setting_item_icon_width"
+ android:layout_width="@dimen/setting_item_icon_width"
android:scaleType="fitCenter"
android:adjustViewBounds="true" />
</LinearLayout>
diff --git a/res/layout/share_icon.xml b/res/layout/share_icon.xml
index 7ab2e3b4..17b2eef0 100644
--- a/res/layout/share_icon.xml
+++ b/res/layout/share_icon.xml
@@ -14,14 +14,14 @@
limitations under the License.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="@dimen/share_item_height">
+ android:layout_height="@dimen/share_item_height"
+ android:layout_width="@dimen/share_item_width">
<com.android.camera.ui.RotateLayout android:id="@+id/share_icon_rotate_layout"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent"
android:layout_gravity="center">
<ImageView android:id="@+id/icon"
- android:layout_width="@dimen/share_icon_length"
- android:layout_height="@dimen/share_icon_length"/>
+ android:layout_height="@dimen/share_icon_length"
+ android:layout_width="@dimen/share_icon_length"/>
</com.android.camera.ui.RotateLayout>
</FrameLayout>
diff --git a/res/layout/share_popup.xml b/res/layout/share_popup.xml
index ccc74d97..d8035a0f 100644
--- a/res/layout/share_popup.xml
+++ b/res/layout/share_popup.xml
@@ -19,30 +19,31 @@
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:camera="http://schemas.android.com/apk/res/com.android.camera"
- android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:layout_width="match_parent"
android:background="@color/share_popup_background">
<FrameLayout android:id="@+id/root"
- android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
android:layout_gravity="left|center">
<RelativeLayout android:id="@+id/share_view"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:layout_gravity="center"
android:background="@drawable/border_last_picture">
<com.android.camera.ui.RotateLayout
android:id="@+id/thumbnail_rotate_layout"
- android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_alignParentTop="true"
- android:layout_alignParentLeft="true">
+ android:layout_width="wrap_content"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentRight="true">
<!-- The size of the thumbnail is calculated in SharePopup.java -->
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ImageView android:id="@+id/thumbnail"
- android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
android:adjustViewBounds="true"
android:scaleType="fitCenter"/>
<ImageView android:id="@+id/play"
@@ -52,40 +53,43 @@
android:scaleType="center"
style="@style/ReviewPlayIcon"/>
</FrameLayout>
- </com.android.camera.ui.RotateLayout>
+ </com.android.camera.ui.RotateLayout>
</RelativeLayout>
- <LinearLayout
- android:layout_width="@dimen/share_item_width"
- android:layout_height="match_parent"
- android:orientation="vertical"
- android:layout_gravity="right"
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/share_item_height"
+ android:layout_gravity="bottom"
android:background="@color/share_icon_background">
<com.android.camera.ui.RotateLayout
- android:layout_marginTop="8dip"
+ android:layout_alignParentRight="true"
+ android:layout_marginRight="8dip"
android:id="@+id/goto_gallery_button_rotate"
- android:layout_gravity="center"
- android:layout_width="match_parent"
- android:layout_height="wrap_content" >
+ android:layout_centerVertical="true"
+ android:layout_height="match_parent"
+ android:layout_width="wrap_content">
<ImageButton
android:id="@+id/goto_gallery_button"
android:background="?android:attr/selectableItemBackground"
android:layout_gravity="center"
- android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
android:src="@drawable/ic_gallery" />
</com.android.camera.ui.RotateLayout>
<View
- android:layout_width="match_parent"
+ android:id="@+id/gallery_button_divider"
+ android:layout_toLeftOf="@+id/goto_gallery_button_rotate"
+ android:layout_height="match_parent"
android:layout_margin="8dip"
- android:layout_height="1dp"
+ android:layout_width="1dp"
android:background="#5affffff" />
- <ListView android:id="@+id/share_list"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:choiceMode="singleChoice"
- style="@android:style/Widget.Holo.ListView" />
- </LinearLayout>
+ <com.android.camera.ui.RightAlignedHorizontalScrollView android:id="@+id/share_list_container"
+ android:layout_toLeftOf="@+id/gallery_button_divider"
+ android:layout_height="match_parent"
+ android:layout_width="wrap_content">
+ <com.android.camera.ui.OneRowGridView android:id="@+id/share_list"
+ style="@style/OneRowGrid"/>
+ </com.android.camera.ui.RightAlignedHorizontalScrollView>
+ </RelativeLayout>
</FrameLayout>
</FrameLayout>
diff --git a/res/layout/video_camera.xml b/res/layout/video_camera.xml
index 809c7a51..e8ae19af 100644
--- a/res/layout/video_camera.xml
+++ b/res/layout/video_camera.xml
@@ -17,12 +17,12 @@
<RelativeLayout 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:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:layout_height="match_parent"
+ android:layout_width="match_parent">
<LinearLayout
- android:orientation="horizontal"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:orientation="vertical"
+ android:layout_height="match_parent"
+ android:layout_width="match_parent">
<include layout="@layout/preview_frame_video"/>
<include layout="@layout/camera_control"/>
</LinearLayout>
diff --git a/res/layout/viewfinder_labels_video.xml b/res/layout/viewfinder_labels_video.xml
index 9e9c8923..75a44499 100644
--- a/res/layout/viewfinder_labels_video.xml
+++ b/res/layout/viewfinder_labels_video.xml
@@ -16,8 +16,8 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:layout_height="match_parent"
+ android:layout_width="match_parent">
<TextView android:id="@+id/recording_time"
style="@style/OnViewfinderLabel"
android:gravity="center"
diff --git a/res/values-sw600dp/styles.xml b/res/values-sw600dp/styles.xml
index 1e354e2d..ed3f5dae 100644
--- a/res/values-sw600dp/styles.xml
+++ b/res/values-sw600dp/styles.xml
@@ -30,9 +30,13 @@
<item name="android:background">@drawable/bg_pressed</item>
</style>
<style name="ReviewControlIcon">
- <item name="android:layout_height">60dp</item>
- <item name="android:layout_width">60dp</item>
+ <item name="android:layout_width">75dp</item>
+ <item name="android:layout_height">50dp</item>
<item name="android:gravity">center</item>
+ <item name="android:layout_centerHorizontal">true</item>
+ <item name="android:clickable">true</item>
+ <item name="android:focusable">true</item>
+ <item name="android:background">@drawable/bg_pressed</item>
</style>
<style name="ReviewControlText">
<item name="android:layout_height">wrap_content</item>
@@ -56,7 +60,20 @@
<item name="android:layout_marginRight">@dimen/setting_popup_right_margin</item>
<item name="android:visibility">gone</item>
</style>
+ <style name="PanoViewHorizontalBar">
+ <item name="android:background">#000000</item>
+ <item name="android:alpha">1.0</item>
+ <item name="android:layout_width">match_parent</item>
+ <item name="android:layout_height">0dp</item>
+ <item name="android:layout_weight">0.5</item>
+ </style>
<style name="PanoCustomDialogText">
<item name="android:textAppearance">@android:style/TextAppearance.Large</item>
</style>
+ <style name="OneColumnGrid">
+ <item name="android:columnWidth">@dimen/share_item_width</item>
+ <item name="android:numColumns">1</item>
+ <item name="android:layout_width">match_parent</item>
+ <item name="android:layout_height">match_parent</item>
+ </style>
</resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 6b3b279c..9618ae16 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -41,7 +41,7 @@
<dimen name="setting_item_list_margin">14dp</dimen>
<dimen name="indicator_bar_width">48dp</dimen>
<dimen name="popup_title_text_size">22dp</dimen>
- <dimen name="popup_title_frame_min_height">60dp</dimen>
+ <dimen name="popup_title_frame_min_height">49dp</dimen>
<dimen name="big_setting_popup_window_width">320dp</dimen>
<dimen name="setting_item_icon_width">28dp</dimen>
<dimen name="effect_setting_item_icon_width">40dp</dimen>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 91274790..bc3c3012 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -38,10 +38,10 @@
<item name="android:windowExitAnimation">@anim/on_screen_hint_exit</item>
</style>
<style name="ReviewControlIcon">
- <item name="android:layout_height">50dp</item>
- <item name="android:layout_width">75dp</item>
+ <item name="android:layout_width">50dp</item>
+ <item name="android:layout_height">75dp</item>
<item name="android:gravity">center</item>
- <item name="android:layout_centerHorizontal">true</item>
+ <item name="android:layout_centerVertical">true</item>
<item name="android:clickable">true</item>
<item name="android:focusable">true</item>
<item name="android:background">@drawable/bg_pressed</item>
@@ -72,9 +72,9 @@
<style name="SettingPopupWindow">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
- <item name="android:layout_centerVertical">true</item>
- <item name="android:layout_toLeftOf">@+id/indicator_control</item>
- <item name="android:layout_marginRight">@dimen/setting_popup_right_margin</item>
+ <item name="android:layout_centerHorizontal">true</item>
+ <item name="android:layout_above">@+id/indicator_control</item>
+ <item name="android:layout_marginBottom">@dimen/setting_popup_right_margin</item>
<item name="android:visibility">gone</item>
</style>
<style name="PopupTitleText">
@@ -85,7 +85,6 @@
<item name="android:singleLine">true</item>
<item name="android:textColor">@color/popup_title_color</item>
<item name="android:layout_marginLeft">10dp</item>
- <item name="android:paddingLeft">16dp</item>
</style>
<style name="PopupTitleSeperator">
<item name="android:layout_width">match_parent</item>
@@ -169,8 +168,8 @@
<style name="PanoViewHorizontalBar">
<item name="android:background">#000000</item>
<item name="android:alpha">1.0</item>
- <item name="android:layout_width">match_parent</item>
- <item name="android:layout_height">0dp</item>
+ <item name="android:layout_width">0dp</item>
+ <item name="android:layout_height">match_parent</item>
<item name="android:layout_weight">0.5</item>
</style>
<style name="PanoCustomDialogText">
@@ -179,8 +178,8 @@
<style name="ReviewThumbnail">
<item name="android:layout_width">52dp</item>
<item name="android:layout_height">52dp</item>
- <item name="android:layout_alignParentTop">true</item>
- <item name="android:layout_centerHorizontal">true</item>
+ <item name="android:layout_alignParentRight">true</item>
+ <item name="android:layout_centerVertical">true</item>
</style>
<style name="AnimationPopup" parent="android:Animation">
<item name="android:windowEnterAnimation">@anim/share_popup_enter</item>
@@ -232,4 +231,10 @@
<item name="android:paddingBottom">4dp</item>
<item name="android:background">@android:drawable/divider_horizontal_dark</item>
</style>
+ <style name="OneRowGrid">
+ <item name="android:stretchMode">none</item>
+ <item name="android:columnWidth">@dimen/share_item_width</item>
+ <item name="android:layout_width">match_parent</item>
+ <item name="android:layout_height">match_parent</item>
+ </style>
</resources>
diff --git a/src/com/android/camera/ActivityBase.java b/src/com/android/camera/ActivityBase.java
index 711ed8e9..ea523c8d 100644
--- a/src/com/android/camera/ActivityBase.java
+++ b/src/com/android/camera/ActivityBase.java
@@ -44,6 +44,8 @@ abstract public class ActivityBase extends Activity {
public void onCreate(Bundle icicle) {
if (Util.isTabletUI()) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
+ } else {
+ setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
super.onCreate(icicle);
setVolumeControlStream(AudioManager.STREAM_MUSIC);
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java
index f78d51ff..1bd759b0 100644
--- a/src/com/android/camera/Camera.java
+++ b/src/com/android/camera/Camera.java
@@ -33,6 +33,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences.Editor;
+import android.content.pm.ActivityInfo;
import android.graphics.Bitmap;
import android.hardware.Camera.CameraInfo;
import android.hardware.Camera.Face;
@@ -823,7 +824,11 @@ public class Camera extends ActivityBase implements FocusManager.Listener,
r.width = width;
r.height = height;
r.dateTaken = System.currentTimeMillis();
- r.previewWidth = mPreviewFrameLayout.getWidth();
+ if (getRequestedOrientation() == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) {
+ r.previewWidth = mPreviewFrameLayout.getHeight();
+ } else {
+ r.previewWidth = mPreviewFrameLayout.getWidth();
+ }
synchronized (this) {
while (mQueue.size() >= QUEUE_LIMIT) {
try {
diff --git a/src/com/android/camera/panorama/PanoramaActivity.java b/src/com/android/camera/panorama/PanoramaActivity.java
index 81859ec8..ab220de1 100755
--- a/src/com/android/camera/panorama/PanoramaActivity.java
+++ b/src/com/android/camera/panorama/PanoramaActivity.java
@@ -30,15 +30,18 @@ import com.android.camera.SoundPlayer;
import com.android.camera.Storage;
import com.android.camera.Thumbnail;
import com.android.camera.Util;
+import com.android.camera.ui.Rotatable;
import com.android.camera.ui.RotateImageView;
+import com.android.camera.ui.RotateLayout;
import com.android.camera.ui.SharePopup;
-import android.app.AlertDialog;
+import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.ContentResolver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.res.AssetFileDescriptor;
+import android.content.pm.ActivityInfo;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
@@ -60,18 +63,23 @@ import android.os.ParcelFileDescriptor;
import android.os.SystemProperties;
import android.util.Log;
import android.view.Gravity;
+import android.view.LayoutInflater;
import android.view.Menu;
import android.view.OrientationEventListener;
import android.view.View;
+import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
+import android.widget.Button;
import android.widget.ImageView;
+import android.widget.ProgressBar;
import android.widget.TextView;
import java.io.ByteArrayOutputStream;
import java.io.FileNotFoundException;
import java.io.File;
import java.util.List;
+import java.util.Vector;
/**
* Activity to handle panorama capturing.
@@ -112,7 +120,7 @@ public class PanoramaActivity extends ActivityBase implements
private View mCaptureLayout;
private View mReviewLayout;
private ImageView mReview;
- private TextView mCaptureIndicator;
+ private RotateLayout mCaptureIndicator;
private PanoProgressBar mPanoProgressBar;
private PanoProgressBar mSavingProgressBar;
private View mFastIndicationBorder;
@@ -123,11 +131,19 @@ public class PanoramaActivity extends ActivityBase implements
private ShutterButton mShutterButton;
private Object mWaitObject = new Object();
+ private RotateLayout mRotateDialog;
+ private View mRotateDialogTitleLayout;
+ private View mRotateDialogButtonLayout;
+ private TextView mRotateDialogTitle;
+ private View mRotateDialogTitleSeperator;
+ private ProgressBar mRotateDialogSpinner;
+ private TextView mRotateDialogText;
+ private TextView mRotateDialogButton;
+
private String mPreparePreviewString;
- private AlertDialog mAlertDialog;
- private ProgressDialog mProgressDialog;
private String mDialogTitle;
- private String mDialogOk;
+ private String mDialogOkString;
+ private String mDialogPanoramaFailedString;
private int mIndicatorColor;
private int mIndicatorColorFast;
@@ -272,7 +288,9 @@ public class PanoramaActivity extends ActivityBase implements
mPreparePreviewString =
getResources().getString(R.string.pano_dialog_prepare_preview);
mDialogTitle = getResources().getString(R.string.pano_dialog_title);
- mDialogOk = getResources().getString(R.string.dialog_ok);
+ mDialogOkString = getResources().getString(R.string.dialog_ok);
+ mDialogPanoramaFailedString =
+ getResources().getString(R.string.pano_dialog_panorama_failed);
mMainHandler = new Handler() {
@Override
@@ -298,7 +316,8 @@ public class PanoramaActivity extends ActivityBase implements
if (mPausing) {
resetToPreview();
} else {
- mAlertDialog.show();
+ showAlertDialog(
+ mDialogTitle, mDialogPanoramaFailedString, mDialogOkString);
}
break;
case MSG_RESET_TO_PREVIEW:
@@ -313,20 +332,12 @@ public class PanoramaActivity extends ActivityBase implements
clearMosaicFrameProcessorIfNeeded();
}
};
+ }
- mAlertDialog = (new AlertDialog.Builder(this))
- .setTitle(mDialogTitle)
- .setMessage(R.string.pano_dialog_panorama_failed)
- .create();
- mAlertDialog.setCancelable(false);
- mAlertDialog.setButton(DialogInterface.BUTTON_POSITIVE, mDialogOk,
- new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- dialog.dismiss();
- resetToPreview();
- }
- });
+ @OnClickAttr
+ public void onAlertDialogButtonClicked(View v) {
+ dismissDialog();
+ resetToPreview();
}
private void setupCamera() {
@@ -593,7 +604,7 @@ public class PanoramaActivity extends ActivityBase implements
mSurfaceTexture.setOnFrameAvailableListener(null);
if (!aborted && !mThreadRunning) {
- showDialog(mPreparePreviewString);
+ showWaitingDialog(mPreparePreviewString);
runBackgroundThread(new Thread() {
@Override
public void run() {
@@ -684,7 +695,7 @@ public class PanoramaActivity extends ActivityBase implements
mSavingProgressBar.setBackgroundColor(appRes.getColor(R.color.pano_progress_empty));
mSavingProgressBar.setDoneColor(appRes.getColor(R.color.pano_progress_indication));
- mCaptureIndicator = (TextView) findViewById(R.id.pano_capture_indicator);
+ mCaptureIndicator = (RotateLayout) findViewById(R.id.pano_capture_indicator);
mThumbnailView = (RotateImageView) findViewById(R.id.thumbnail);
mThumbnailView.enableFilter(false);
@@ -704,6 +715,29 @@ public class PanoramaActivity extends ActivityBase implements
mShutterButton.setOnShutterButtonListener(this);
mPanoLayout = findViewById(R.id.pano_layout);
+
+ mRotateDialog = (RotateLayout) findViewById(R.id.rotate_dialog_layout);
+ mRotateDialogTitleLayout = findViewById(R.id.rotate_dialog_title_layout);
+ mRotateDialogButtonLayout = findViewById(R.id.rotate_dialog_button_layout);
+ mRotateDialogTitle = (TextView) findViewById(R.id.rotate_dialog_title);
+ mRotateDialogTitleSeperator = (View) findViewById(R.id.rotate_dialog_title_divider);
+ mRotateDialogSpinner = (ProgressBar) findViewById(R.id.rotate_dialog_spinner);
+ mRotateDialogText = (TextView) findViewById(R.id.rotate_dialog_text);
+ mRotateDialogButton = (Button) findViewById(R.id.rotate_dialog_button);
+
+ if (getRequestedOrientation() == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) {
+ Rotatable[] rotateLayout = {
+ (Rotatable) findViewById(R.id.pano_pan_progress_bar_layout),
+ (Rotatable) findViewById(R.id.pano_capture_too_fast_textview_layout),
+ (Rotatable) findViewById(R.id.pano_review_saving_indication_layout),
+ (Rotatable) findViewById(R.id.pano_saving_progress_bar_layout),
+ (Rotatable) findViewById(R.id.pano_review_cancel_button_layout),
+ (Rotatable) mRotateDialog,
+ (Rotatable) mCaptureIndicator};
+ for (Rotatable r : rotateLayout) {
+ r.setOrientation(270);
+ }
+ }
}
@Override
@@ -811,10 +845,39 @@ public class PanoramaActivity extends ActivityBase implements
reportProgress();
}
- private void showDialog(String str) {
- mProgressDialog = new ProgressDialog(this);
- mProgressDialog.setMessage(str);
- mProgressDialog.show();
+ private void resetRotateDialog() {
+ mRotateDialogTitleLayout.setVisibility(View.GONE);
+ mRotateDialogSpinner.setVisibility(View.GONE);
+ mRotateDialogButtonLayout.setVisibility(View.GONE);
+ }
+
+ private void dismissDialog() {
+ if (mRotateDialog.getVisibility() != View.INVISIBLE) {
+ mRotateDialog.setVisibility(View.INVISIBLE);
+ }
+ }
+
+ private void showAlertDialog(String title, String msg, String buttonText) {
+ resetRotateDialog();
+
+ mRotateDialogTitle.setText(title);
+ mRotateDialogTitleLayout.setVisibility(View.VISIBLE);
+
+ mRotateDialogText.setText(msg);
+
+ mRotateDialogButton.setText(buttonText);
+ mRotateDialogButtonLayout.setVisibility(View.VISIBLE);
+
+ mRotateDialog.setVisibility(View.VISIBLE);
+ }
+
+ private void showWaitingDialog(String msg) {
+ resetRotateDialog();
+
+ mRotateDialogText.setText(msg);
+ mRotateDialogSpinner.setVisibility(View.VISIBLE);
+
+ mRotateDialog.setVisibility(View.VISIBLE);
}
private void runBackgroundThread(Thread thread) {
@@ -824,10 +887,7 @@ public class PanoramaActivity extends ActivityBase implements
private void onBackgroundThreadFinished() {
mThreadRunning = false;
- if (mProgressDialog != null) {
- mProgressDialog.dismiss();
- mProgressDialog = null;
- }
+ dismissDialog();
}
private void cancelHighResComputation() {
diff --git a/src/com/android/camera/ui/ControlPanelLayout.java b/src/com/android/camera/ui/ControlPanelLayout.java
index c6ab99f8..24efb8bd 100644
--- a/src/com/android/camera/ui/ControlPanelLayout.java
+++ b/src/com/android/camera/ui/ControlPanelLayout.java
@@ -41,7 +41,7 @@ public class ControlPanelLayout extends RelativeLayout {
int widthSpecSize = MeasureSpec.getSize(widthSpec);
int heightSpecSize = MeasureSpec.getSize(heightSpec);
int measuredSize = 0;
- int mode, longSideSize, shortSideSize, minSize, specSize;
+ int mode, longSideSize, shortSideSize, specSize;
boolean isLandscape = (((Activity) getContext()).getRequestedOrientation()
== ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
@@ -50,13 +50,11 @@ public class ControlPanelLayout extends RelativeLayout {
mode = MeasureSpec.getMode(widthSpec);
longSideSize = widthSpecSize;
shortSideSize = heightSpecSize;
- minSize = getSuggestedMinimumWidth();
specSize = widthSpecSize;
} else {
mode = MeasureSpec.getMode(heightSpec);
longSideSize = heightSpecSize;
shortSideSize = widthSpecSize;
- minSize = getSuggestedMinimumHeight();
specSize = heightSpecSize;
}
@@ -68,11 +66,6 @@ public class ControlPanelLayout extends RelativeLayout {
Log.e(TAG, "layout_xxx of ControlPanelLayout should be wrap_content");
}
- // Make sure the width is bigger than the minimum length.
- if (minSize > measuredSize) {
- measuredSize = minSize;
- }
-
// The width cannot be bigger than the constraint.
if (mode == MeasureSpec.AT_MOST && measuredSize > specSize) {
measuredSize = specSize;
diff --git a/src/com/android/camera/ui/IndicatorControlBar.java b/src/com/android/camera/ui/IndicatorControlBar.java
index 6c2151d5..8ab61fd9 100644
--- a/src/com/android/camera/ui/IndicatorControlBar.java
+++ b/src/com/android/camera/ui/IndicatorControlBar.java
@@ -87,20 +87,19 @@ public class IndicatorControlBar extends IndicatorControl implements
int count = getChildCount();
if (count == 0) return;
- int width = right - left;
+ int height = bottom - top;
- // First indicator will be CameraPicker if exists.
- if (mCameraPicker != null) {
- mCameraPicker.layout(0, padding, width, padding + width);
- }
+ mSecondLevelIcon.layout(0, 0, height, height);
// Layout the zoom control if required.
- int offset = padding + width; // the padding and the icon height
+ int offset = padding + height; // the padding and the icon height
if (mZoomControl != null) {
- mZoomControl.layout(0, offset, width, bottom - top - offset);
+ mZoomControl.layout(offset, 0, right - left - offset, height);
}
- mSecondLevelIcon.layout(0, bottom - top - offset, width, bottom - top);
+ if (mCameraPicker != null) {
+ mCameraPicker.layout(right - left - offset, 0, right - left, height);
+ }
}
@Override
diff --git a/src/com/android/camera/ui/IndicatorControlBarContainer.java b/src/com/android/camera/ui/IndicatorControlBarContainer.java
index 1e860ad1..3c907a89 100644
--- a/src/com/android/camera/ui/IndicatorControlBarContainer.java
+++ b/src/com/android/camera/ui/IndicatorControlBarContainer.java
@@ -43,14 +43,14 @@ public class IndicatorControlBarContainer extends IndicatorControlContainer {
public IndicatorControlBarContainer(Context context, AttributeSet attrs) {
super(context, attrs);
mFadeIn = AnimationUtils.loadAnimation(
- context, R.anim.grow_fade_in_from_top);
+ context, R.anim.first_level_fade_in);
mFadeOut = AnimationUtils.loadAnimation(
- context, R.anim.shrink_fade_out_from_bottom);
+ context, R.anim.first_level_fade_out);
mFadeOut.setAnimationListener(mAnimationListener);
mSecondLevelFadeIn = AnimationUtils.loadAnimation(
- context, R.anim.grow_fade_in_from_bottom);
+ context, R.anim.second_level_fade_in);
mSecondLevelFadeOut = AnimationUtils.loadAnimation(
- context, R.anim.shrink_fade_out_from_top);
+ context, R.anim.second_level_fade_out);
mSecondLevelFadeOut.setAnimationListener(mAnimationListener);
}
diff --git a/src/com/android/camera/ui/OneRowGridView.java b/src/com/android/camera/ui/OneRowGridView.java
new file mode 100644
index 00000000..5e37d35e
--- /dev/null
+++ b/src/com/android/camera/ui/OneRowGridView.java
@@ -0,0 +1,43 @@
+/*
+ * 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 com.android.camera.R;
+import com.android.camera.Util;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.widget.GridView;
+
+public class OneRowGridView extends GridView {
+ public OneRowGridView(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ @Override
+ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+ // Once we know the number of children in this view, we have to set
+ // the correct width and height for containing the icons in one row.
+ int n = getChildCount();
+ if (n == 0) {
+ super.onMeasure(widthMeasureSpec, heightMeasureSpec);
+ } else {
+ setMeasuredDimension((n * getChildAt(0).getMeasuredWidth()),
+ getMeasuredHeight());
+ }
+ }
+}
diff --git a/src/com/android/camera/ui/RightAlignedHorizontalScrollView.java b/src/com/android/camera/ui/RightAlignedHorizontalScrollView.java
new file mode 100644
index 00000000..cd4c5f5a
--- /dev/null
+++ b/src/com/android/camera/ui/RightAlignedHorizontalScrollView.java
@@ -0,0 +1,44 @@
+/*
+ * 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.view.View;
+import android.util.AttributeSet;
+import android.widget.HorizontalScrollView;
+
+public class RightAlignedHorizontalScrollView extends HorizontalScrollView {
+
+ public RightAlignedHorizontalScrollView(Context context) {
+ super(context);
+ }
+
+ public RightAlignedHorizontalScrollView(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ @Override
+ protected void onLayout(boolean changed, int l, int t, int r, int b) {
+ super.onLayout(changed, l, t, r, b);
+ if (changed) {
+ // Get the width of the child, i.e. the LinearLayout, and scroll to
+ // the rightmost position.
+ View child = getChildAt(0);
+ if (child != null) scrollTo(child.getWidth(), 0);
+ }
+ }
+}
diff --git a/src/com/android/camera/ui/SecondLevelIndicatorControlBar.java b/src/com/android/camera/ui/SecondLevelIndicatorControlBar.java
index 45bbca8d..1fb9a80f 100644
--- a/src/com/android/camera/ui/SecondLevelIndicatorControlBar.java
+++ b/src/com/android/camera/ui/SecondLevelIndicatorControlBar.java
@@ -73,20 +73,20 @@ public class SecondLevelIndicatorControlBar extends IndicatorControl implements
OnIndicatorEventListener.EVENT_LEAVE_SECOND_LEVEL_INDICATOR_BAR);
}
- private int getTouchViewIndex(int y, int height) {
+ private int getTouchViewIndex(int x, int width) {
// If the current touch location is on close icon and above.
- if (y < mCloseIcon.getBottom()) return indexOfChild(mCloseIcon);
+ if (x > mCloseIcon.getLeft()) return indexOfChild(mCloseIcon);
// Calculate if the touch event is on the indicator buttons.
int count = getChildCount();
if (count == mNonIndicatorButtonCount) return -1;
// The baseline will be the first indicator button's top minus spacing.
View firstIndicatorButton = getChildAt(mNonIndicatorButtonCount);
- int baselineY = firstIndicatorButton.getTop() - (ICON_SPACING / 2);
- if (y < baselineY) return -1;
- int iconHeight = firstIndicatorButton.getMeasuredHeight();
- int buttonRange = iconHeight + ICON_SPACING;
- return (mNonIndicatorButtonCount + (y - baselineY) / buttonRange);
+ int baselineX = firstIndicatorButton.getRight() + (ICON_SPACING / 2);
+ if (x > baselineX) return -1;
+ int iconWidth = firstIndicatorButton.getMeasuredWidth();
+ int buttonRange = iconWidth + ICON_SPACING;
+ return (mNonIndicatorButtonCount + ((baselineX - x) / buttonRange));
}
@Override
@@ -98,12 +98,12 @@ public class SecondLevelIndicatorControlBar extends IndicatorControl implements
double x = (double) event.getX();
double y = (double) event.getY();
- int height = getHeight();
- if (height == 0) return false; // the event is sent before onMeasure()
- if (x > getWidth()) x = getWidth();
- if (y >= height) y = height - 1;
+ int width = getWidth();
+ if (width == 0) return false; // the event is sent before onMeasure()
+ if (x > width) x = width;
+ if (y >= getHeight()) y = getHeight() - 1;
- int index = getTouchViewIndex((int) y, height);
+ int index = getTouchViewIndex((int) x, width);
if (index == -1) return true;
View b = getChildAt(index);
b.dispatchTouchEvent(event);
@@ -163,26 +163,26 @@ public class SecondLevelIndicatorControlBar extends IndicatorControl implements
if (count == 0) return;
int width = right - left;
int height = bottom - top;
- int iconHeight = mCloseIcon.getMeasuredHeight();
- int padding = getPaddingTop();
-
- // The first icon is close button.
- int offsetY = padding;
- mCloseIcon.layout(0, padding, width, (padding + iconHeight));
-
- // And layout the divider line.
- offsetY += (iconHeight + padding);
- mDivider.layout(padding, offsetY,
- (width - padding), (offsetY + mDivider.getMeasuredHeight()));
+ int iconWidth = mCloseIcon.getMeasuredWidth();
+ int padding = getPaddingLeft();
// Layout from the last icon up.
- int startY = height - iconHeight - padding;
- int decrement = iconHeight + ICON_SPACING;
+ int offsetX = padding;
+ int increment = iconWidth + ICON_SPACING;
for (int i = count - 1; i >= mNonIndicatorButtonCount; --i) {
- getChildAt(i).layout(0, startY, width, startY + iconHeight);
- startY -= decrement;
+ getChildAt(i).layout(offsetX, 0, offsetX + iconWidth, height);
+ offsetX += increment;
}
+ // And layout the divider line.
+ offsetX = width - iconWidth - 2 * padding;
+ mDivider.layout(offsetX, padding, (offsetX + mDivider.getMeasuredWidth()),
+ (height - padding));
+
+ offsetX = width - iconWidth - padding;
+ // The first icon is close button.
+ mCloseIcon.layout(offsetX, 0, (offsetX + iconWidth), height);
+
// Hightlight the selected indicator if exists.
if (mPopupedIndicator == null) {
mIndicatorHighlight.setVisibility(View.GONE);
@@ -190,9 +190,9 @@ public class SecondLevelIndicatorControlBar extends IndicatorControl implements
mIndicatorHighlight.setVisibility(View.VISIBLE);
// Keep the top and bottom of the hightlight the same as
// the 'active' indicator button.
- mIndicatorHighlight.layout(0, mPopupedIndicator.getTop(),
- mIndicatorHighlight.getLayoutParams().width,
- mPopupedIndicator.getBottom());
+ mIndicatorHighlight.layout(mPopupedIndicator.getLeft(), 0,
+ mPopupedIndicator.getRight(),
+ mIndicatorHighlight.getLayoutParams().height);
}
}
diff --git a/src/com/android/camera/ui/SharePopup.java b/src/com/android/camera/ui/SharePopup.java
index 384634ac..134b7c05 100644
--- a/src/com/android/camera/ui/SharePopup.java
+++ b/src/com/android/camera/ui/SharePopup.java
@@ -23,6 +23,7 @@ import android.app.Activity;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
+import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.res.Resources;
@@ -38,7 +39,7 @@ import android.view.ViewGroup.LayoutParams;
import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.ImageView;
-import android.widget.ListView;
+import android.widget.GridView;
import android.widget.PopupWindow;
import android.widget.RelativeLayout;
import android.widget.SimpleAdapter;
@@ -65,7 +66,7 @@ public class SharePopup extends PopupWindow implements View.OnClickListener,
// A view that contains a list of application icons and the share view.
private View mRootView;
// The list of the application icons.
- private ListView mShareList;
+ private GridView mShareList;
// A rotated view that contains the thumbnail.
private RotateLayout mThumbnailRotateLayout;
private RotateLayout mGotoGalleryRotate;
@@ -114,8 +115,7 @@ public class SharePopup extends PopupWindow implements View.OnClickListener,
// This is required because popup window is full screen.
sharePopup.setOnTouchListener(this);
mThumbnailRotateLayout = (RotateLayout) sharePopup.findViewById(R.id.thumbnail_rotate_layout);
- mShareList = (ListView) sharePopup.findViewById(R.id.share_list);
- mShareList.setDivider(null);
+ mShareList = (GridView) sharePopup.findViewById(R.id.share_list);
mThumbnail = (ImageView) sharePopup.findViewById(R.id.thumbnail);
mThumbnail.setImageBitmap(bitmap);
mShareView = (ViewGroup) sharePopup.findViewById(R.id.share_view);
@@ -279,10 +279,19 @@ public class SharePopup extends PopupWindow implements View.OnClickListener,
items.add(map);
mComponent.add(component);
}
+
+ // On phone UI, we have to know how many icons in the grid view before
+ // the view is measured.
+ if (((Activity) mContext).getRequestedOrientation()
+ == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) {
+ mShareList.setNumColumns(items.size());
+ }
+
SimpleAdapter listItemAdapter = new MySimpleAdapter(mContext, items,
R.layout.share_icon,
new String[] {ADAPTER_COLUMN_ICON},
new int[] {R.id.icon});
+
listItemAdapter.setViewBinder(mViewBinder);
mShareList.setAdapter(listItemAdapter);
mShareList.setOnItemClickListener(this);
diff --git a/src/com/android/camera/ui/ZoomControlBar.java b/src/com/android/camera/ui/ZoomControlBar.java
index 2e14e53c..4e572cff 100644
--- a/src/com/android/camera/ui/ZoomControlBar.java
+++ b/src/com/android/camera/ui/ZoomControlBar.java
@@ -36,9 +36,9 @@ public class ZoomControlBar extends ZoomControl {
private View mBar;
private boolean mStartChanging;
private int mSliderLength;
- private int mHeight;
- private int mIconHeight;
- private int mTotalIconHeight;
+ private int mWidth;
+ private int mIconWidth;
+ private int mTotalIconWidth;
public ZoomControlBar(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -53,16 +53,16 @@ public class ZoomControlBar extends ZoomControl {
mBar.setActivated(activated);
}
- private int getSliderPosition(int y) {
+ private int getSliderPosition(int x) {
// Calculate the absolute offset of the slider in the zoom control bar.
// For left-hand users, as the device is rotated for 180 degree for
// landscape mode, the zoom-in bottom should be on the top, so the
// position should be reversed.
int pos; // the relative position in the zoom slider bar
- if (mOrientation == 180) {
- pos = y - mTotalIconHeight;
+ if (mOrientation == 90) {
+ pos = mWidth - mTotalIconWidth - x;
} else {
- pos = mHeight - mTotalIconHeight - y;
+ pos = x - mTotalIconWidth;
}
if (pos < 0) pos = 0;
if (pos > mSliderLength) pos = mSliderLength;
@@ -71,15 +71,15 @@ public class ZoomControlBar extends ZoomControl {
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
- mHeight = h;
- mIconHeight = mZoomIn.getMeasuredHeight();
- mTotalIconHeight = mIconHeight + ICON_SPACING;
- mSliderLength = mHeight - (2 * mTotalIconHeight);
+ mWidth = w;
+ mIconWidth = mZoomIn.getMeasuredWidth();
+ mTotalIconWidth = mIconWidth + ICON_SPACING;
+ mSliderLength = mWidth - (2 * mTotalIconWidth);
}
@Override
public boolean dispatchTouchEvent(MotionEvent event) {
- if (!isEnabled() || (mHeight == 0)) return false;
+ if (!isEnabled() || (mWidth == 0)) return false;
int action = event.getAction();
switch (action) {
@@ -94,7 +94,7 @@ public class ZoomControlBar extends ZoomControl {
setActivated(true);
mStartChanging = false;
case MotionEvent.ACTION_MOVE:
- int pos = getSliderPosition((int) event.getY());
+ int pos = getSliderPosition((int) event.getX());
if (!mStartChanging) {
// Make sure the movement is large enough before we start
// changing the zoom.
@@ -116,7 +116,7 @@ public class ZoomControlBar extends ZoomControl {
@Override
public void setOrientation(int orientation) {
// layout for the left-hand camera control
- if ((orientation == 180) || (mOrientation == 180)) requestLayout();
+ if ((orientation == 90) || (mOrientation == 90)) requestLayout();
super.setOrientation(orientation);
}
@@ -124,8 +124,8 @@ public class ZoomControlBar extends ZoomControl {
protected void onLayout(
boolean changed, int left, int top, int right, int bottom) {
if (mZoomMax == 0) return;
- int width = right - left;
- mBar.layout(0, mTotalIconHeight, width, mHeight - mTotalIconHeight);
+ int height = bottom - top;
+ mBar.layout(mTotalIconWidth, 0, mWidth - mTotalIconWidth, height);
// For left-hand users, as the device is rotated for 180 degree,
// the zoom-in button should be on the top.
int pos; // slider position
@@ -135,18 +135,18 @@ public class ZoomControlBar extends ZoomControl {
} else {
sliderPosition = (int) ((double) mSliderLength * mZoomIndex / mZoomMax);
}
- if (mOrientation == 180) {
- mZoomOut.layout(0, 0, width, mIconHeight);
- mZoomIn.layout(0, mHeight - mIconHeight, width, mHeight);
- pos = mBar.getTop() + sliderPosition;
+ if (mOrientation == 90) {
+ mZoomIn.layout(0, 0, mIconWidth, height);
+ mZoomOut.layout(mWidth - mIconWidth, 0, mWidth, height);
+ pos = mBar.getRight() - sliderPosition;
} else {
- mZoomIn.layout(0, 0, width, mIconHeight);
- mZoomOut.layout(0, mHeight - mIconHeight, width, mHeight);
- pos = mBar.getBottom() - sliderPosition;
+ mZoomOut.layout(0, 0, mIconWidth, height);
+ mZoomIn.layout(mWidth - mIconWidth, 0, mWidth, height);
+ pos = mBar.getLeft() + sliderPosition;
}
- int sliderHeight = mZoomSlider.getMeasuredHeight();
- mZoomSlider.layout(0, (pos - sliderHeight / 2),
- width, (pos + sliderHeight / 2));
+ int sliderWidth = mZoomSlider.getMeasuredWidth();
+ mZoomSlider.layout((pos - sliderWidth / 2), 0,
+ (pos + sliderWidth / 2), height);
}
@Override