From 07c4fba97f4a480295f413668a8c8fdca1f77b15 Mon Sep 17 00:00:00 2001 From: Camera Software Integration Date: Tue, 22 Dec 2015 17:49:23 -0800 Subject: Revert "SnapdragonCamera: Set navigation bar according to flag" This reverts commit 8fce47a5fb0277b3763b94a1fd23ea499d35e4b1. Change-Id: I955f7ad42df89d30b39b8c7c26473ceac69a9c9d --- src/com/android/camera/CameraActivity.java | 22 ++++++++-------------- src/com/android/camera/PhotoUI.java | 4 ++-- src/com/android/camera/VideoUI.java | 4 ++-- 3 files changed, 12 insertions(+), 18 deletions(-) (limited to 'src/com/android/camera') diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java index 437549592..118a2677a 100644 --- a/src/com/android/camera/CameraActivity.java +++ b/src/com/android/camera/CameraActivity.java @@ -223,7 +223,8 @@ public class CameraActivity extends Activity private LocalMediaObserver mLocalImagesObserver; private LocalMediaObserver mLocalVideosObserver; - private final int DEFAULT_SYSTEM_UI_VISIBILITY = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; + private final int DEFAULT_SYSTEM_UI_VISIBILITY = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN + | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION; private boolean mPendingDeletion = false; @@ -639,19 +640,12 @@ public class CameraActivity extends Activity View decorView = getWindow().getDecorView(); int currentSystemUIVisibility = decorView.getSystemUiVisibility(); - boolean hidePreview = getResources().getBoolean(R.bool.hide_navigation_bar); - - int systemUIVisibility = DEFAULT_SYSTEM_UI_VISIBILITY; - if (hidePreview) - systemUIVisibility |= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION; - - int systemUINotVisible = View.SYSTEM_UI_FLAG_LOW_PROFILE | View.SYSTEM_UI_FLAG_FULLSCREEN; - if (hidePreview) - systemUINotVisible |= (View.SYSTEM_UI_FLAG_HIDE_NAVIGATION - | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); - - int newSystemUIVisibility = systemUIVisibility - | (visible ? View.SYSTEM_UI_FLAG_VISIBLE : systemUINotVisible); + int newSystemUIVisibility = DEFAULT_SYSTEM_UI_VISIBILITY + | (visible ? View.SYSTEM_UI_FLAG_VISIBLE : + View.SYSTEM_UI_FLAG_LOW_PROFILE + | View.SYSTEM_UI_FLAG_FULLSCREEN + | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION + | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); if (newSystemUIVisibility != currentSystemUIVisibility) { decorView.setSystemUiVisibility(newSystemUIVisibility); } diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java index 1c09913b9..6e321c535 100644 --- a/src/com/android/camera/PhotoUI.java +++ b/src/com/android/camera/PhotoUI.java @@ -397,14 +397,14 @@ public class PhotoUI implements PieListener, if (width > height) { if(Math.max(width, height * mAspectRatio) > width) { scaledTextureWidth = width; - scaledTextureHeight = height; + scaledTextureHeight = width / mAspectRatio; } else { scaledTextureWidth = height * mAspectRatio; scaledTextureHeight = height; } } else { if(Math.max(height, width * mAspectRatio) > height) { - scaledTextureWidth = width; + scaledTextureWidth = height / mAspectRatio; scaledTextureHeight = height; } else { scaledTextureWidth = width; diff --git a/src/com/android/camera/VideoUI.java b/src/com/android/camera/VideoUI.java index b5e7cc3df..df110118e 100644 --- a/src/com/android/camera/VideoUI.java +++ b/src/com/android/camera/VideoUI.java @@ -407,14 +407,14 @@ public class VideoUI implements PieRenderer.PieListener, if (width > height) { if(Math.max(width, height * mAspectRatio) > width) { scaledTextureWidth = width; - scaledTextureHeight = height; + scaledTextureHeight = width / mAspectRatio; } else { scaledTextureWidth = height * mAspectRatio; scaledTextureHeight = height; } } else { if(Math.max(height, width * mAspectRatio) > height) { - scaledTextureWidth = width; + scaledTextureWidth = height / mAspectRatio; scaledTextureHeight = height; } else { scaledTextureWidth = width; -- cgit v1.2.3