summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamera Software Integration <camswint@localhost>2016-12-22 22:55:38 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2016-12-22 22:55:38 -0800
commit53e1bd77af1c1c0e203d536c0e52ce9e03316a65 (patch)
tree3d099009d18b6ca3b3e567e725a2f8023168d89b
parente305c4768a9c7c030fa5bb935b0776d80a1e1ebd (diff)
parent12ac236df386266adc05ac2e77cfe39a7d7e1214 (diff)
downloadandroid_packages_apps_Snap-53e1bd77af1c1c0e203d536c0e52ce9e03316a65.zip
android_packages_apps_Snap-53e1bd77af1c1c0e203d536c0e52ce9e03316a65.tar.gz
android_packages_apps_Snap-53e1bd77af1c1c0e203d536c0e52ce9e03316a65.tar.bz2
Merge "SnapdragonCamera: Dialog display incompletely in landscape mode" into camera.lnx.1.0-dev.1.0
-rw-r--r--res/layout/scene_mode_instructional.xml5
-rw-r--r--res/layout/scene_mode_instructional_landscape.xml97
-rw-r--r--res/layout/scene_mode_label.xml3
-rw-r--r--src/com/android/camera/CaptureUI.java15
-rw-r--r--src/com/android/camera/PanoCaptureUI.java15
5 files changed, 115 insertions, 20 deletions
diff --git a/res/layout/scene_mode_instructional.xml b/res/layout/scene_mode_instructional.xml
index 588dc35..2181e31 100644
--- a/res/layout/scene_mode_instructional.xml
+++ b/res/layout/scene_mode_instructional.xml
@@ -45,15 +45,13 @@
<ImageView
android:id="@+id/scene_mode_icon"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:src="@drawable/chroma_flash"/>
+ android:layout_height="wrap_content" />
<TextView
android:id="@+id/scene_mode_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_toRightOf="@id/scene_mode_icon"
- android:text="@string/pref_camera_scenemode_entry_chromaflash"
android:textColor="@android:color/black"
android:textAppearance="?android:attr/textAppearanceMedium" />
@@ -66,7 +64,6 @@
android:layout_marginTop="15dp"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
- android:text="@string/pref_camera2_scene_mode_chroma_flash_instructional_content"
android:textColor="@android:color/black"
android:layout_below="@id/title" />
<CheckBox
diff --git a/res/layout/scene_mode_instructional_landscape.xml b/res/layout/scene_mode_instructional_landscape.xml
new file mode 100644
index 0000000..c5f89f5
--- /dev/null
+++ b/res/layout/scene_mode_instructional_landscape.xml
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--Copyright (c) 2016, The Linux Foundation. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ -->
+
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/mode_layout_rect"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:background="@android:color/transparent"
+ android:gravity="center">
+ <LinearLayout
+ android:id="@+id/title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="25dp"
+ android:orientation="horizontal"
+ android:gravity="center">
+ <ImageView
+ android:id="@+id/scene_mode_icon"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
+ <TextView
+ android:id="@+id/scene_mode_name"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center_vertical"
+ android:layout_toRightOf="@id/scene_mode_icon"
+ android:textColor="@android:color/black"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
+
+ </LinearLayout>
+
+ <TextView
+ android:id="@+id/scene_mode_instructional"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="25dp"
+ android:layout_marginTop="30dp"
+ android:layout_marginRight="15dp"
+ android:textColor="@android:color/black"
+ android:layout_below="@id/title" />
+ <CheckBox
+ android:id="@+id/remember_selected"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="15dp"
+ android:layout_marginLeft="25dp"
+ android:layout_below="@id/scene_mode_instructional"
+ android:text="@string/pref_camera2_not_show_again"
+ android:textColor="@android:color/black"/>
+
+ <View
+ android:id="@+id/separator"
+ android:layout_width="wrap_content"
+ android:layout_height="1dp"
+ android:layout_marginTop="15dp"
+ android:layout_marginBottom="15dp"
+ android:layout_below="@id/remember_selected"
+ android:background="#c0c0c0" />
+
+ <Button
+ android:id="@+id/scene_mode_instructional_ok"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_below="@id/separator"
+ android:background="@android:color/transparent"
+ android:layout_marginRight="30dp"
+ android:layout_alignParentRight="true"
+ android:text="@string/pref_camera2_scene_mode_instructional_ok"
+ android:textColor="@android:color/black"/>
+</RelativeLayout>
+
diff --git a/res/layout/scene_mode_label.xml b/res/layout/scene_mode_label.xml
index e0d8d43..652a1c1 100644
--- a/res/layout/scene_mode_label.xml
+++ b/res/layout/scene_mode_label.xml
@@ -38,7 +38,6 @@
<TextView
android:id="@+id/scene_mode_label"
android:singleLine="true"
- android:text="@string/pref_camera_scenemode_entry_chromaflash"
android:textColor="@android:color/white"
android:textSize="16dp"
style="@style/OnViewfinderSceneLabel" />
@@ -53,4 +52,4 @@
android:src="@drawable/x" />
</LinearLayout>
</com.android.camera.ui.RotateLayout>
-</LinearLayout> \ No newline at end of file
+</LinearLayout>
diff --git a/src/com/android/camera/CaptureUI.java b/src/com/android/camera/CaptureUI.java
index 1bb20e9..1cb7d75 100644
--- a/src/com/android/camera/CaptureUI.java
+++ b/src/com/android/camera/CaptureUI.java
@@ -655,9 +655,13 @@ public class CaptureUI implements FocusOverlayManager.FocusUI,
}
private void showSceneInstructionalDialog(int orientation) {
+ int layoutId = R.layout.scene_mode_instructional;
+ if ( orientation == 90 || orientation == 270 ) {
+ layoutId = R.layout.scene_mode_instructional_landscape;
+ }
LayoutInflater inflater =
(LayoutInflater)mActivity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- View view = inflater.inflate(R.layout.scene_mode_instructional, null);
+ View view = inflater.inflate(layoutId, null);
final int index = mSettingsManager.getValueIndex(SettingsManager.KEY_SCENE_MODE);
TextView name = (TextView)view.findViewById(R.id.scene_mode_name);
@@ -728,12 +732,9 @@ public class CaptureUI implements FocusOverlayManager.FocusUI,
dialogWindow.setGravity(Gravity.CENTER);
lp.width = lp.height = dialogSize;
dialogWindow.setAttributes(lp);
- if ( orientation == 180 ) {
- dialogSize -= 40;
- RelativeLayout layout = (RelativeLayout)view.findViewById(R.id.mode_layout_rect);
- FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(dialogSize, dialogSize);
- layout.setLayoutParams(params);
- }
+ RelativeLayout layout = (RelativeLayout)view.findViewById(R.id.mode_layout_rect);
+ FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(dialogSize, dialogSize);
+ layout.setLayoutParams(params);
}
private void showSceneModeLabel() {
diff --git a/src/com/android/camera/PanoCaptureUI.java b/src/com/android/camera/PanoCaptureUI.java
index 5e96929..a25ff9f 100644
--- a/src/com/android/camera/PanoCaptureUI.java
+++ b/src/com/android/camera/PanoCaptureUI.java
@@ -455,9 +455,13 @@ public class PanoCaptureUI implements
}
private void showSceneInstructionalDialog(int orientation) {
+ int layoutId = R.layout.scene_mode_instructional;
+ if ( orientation == 90 || orientation == 270 ) {
+ layoutId = R.layout.scene_mode_instructional_landscape;
+ }
LayoutInflater inflater =
(LayoutInflater)mActivity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- View view = inflater.inflate(R.layout.scene_mode_instructional, null);
+ View view = inflater.inflate(layoutId, null);
TextView name = (TextView)view.findViewById(R.id.scene_mode_name);
name.setText(R.string.pref_camera_scenemode_entry_panorama);
@@ -516,11 +520,8 @@ public class PanoCaptureUI implements
dialogWindow.setGravity(Gravity.CENTER);
lp.width = lp.height = dialogSize;
dialogWindow.setAttributes(lp);
- if ( orientation == 180 ) {
- dialogSize -= 40;
- RelativeLayout layout = (RelativeLayout)view.findViewById(R.id.mode_layout_rect);
- FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(dialogSize, dialogSize);
- layout.setLayoutParams(params);
- }
+ RelativeLayout layout = (RelativeLayout)view.findViewById(R.id.mode_layout_rect);
+ FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(dialogSize, dialogSize);
+ layout.setLayoutParams(params);
}
}