From 12ac236df386266adc05ac2e77cfe39a7d7e1214 Mon Sep 17 00:00:00 2001 From: weijiew Date: Thu, 15 Dec 2016 14:45:48 +0800 Subject: SnapdragonCamera: Dialog display incompletely in landscape mode Create a new layout for landscape mode CRs-Fixed: 1099373 Change-Id: Ie505c6ef8795e0b8a8b3424afde7cb46fc368136 --- src/com/android/camera/PanoCaptureUI.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/com/android/camera/PanoCaptureUI.java') diff --git a/src/com/android/camera/PanoCaptureUI.java b/src/com/android/camera/PanoCaptureUI.java index 5e9692908..a25ff9f94 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); } } -- cgit v1.2.3