diff options
author | Byunghun Jeon <bjeon@codeaurora.org> | 2015-08-07 14:53:59 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2015-08-07 14:55:40 -0700 |
commit | 8fce47a5fb0277b3763b94a1fd23ea499d35e4b1 (patch) | |
tree | f90514b0045e03c574bd505265fc837fc8ddb965 /src/com | |
parent | f88dd95428f256f3909c288455d4f6d19092c459 (diff) | |
download | android_packages_apps_Snap-8fce47a5fb0277b3763b94a1fd23ea499d35e4b1.tar.gz android_packages_apps_Snap-8fce47a5fb0277b3763b94a1fd23ea499d35e4b1.tar.bz2 android_packages_apps_Snap-8fce47a5fb0277b3763b94a1fd23ea499d35e4b1.zip |
SnapdragonCamera: Set navigation bar according to flag
Set navigation bar according to flag and set it to show by default
Change-Id: I5ddb9d5f8150d7fd1d182bacb25cd02651a2db5b
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/camera/CameraActivity.java | 22 | ||||
-rw-r--r-- | src/com/android/camera/PhotoUI.java | 4 | ||||
-rw-r--r-- | src/com/android/camera/VideoUI.java | 4 |
3 files changed, 18 insertions, 12 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java index 3f845db05..6c5ec2dff 100644 --- a/src/com/android/camera/CameraActivity.java +++ b/src/com/android/camera/CameraActivity.java @@ -224,8 +224,7 @@ public class CameraActivity extends Activity private LocalMediaObserver mLocalImagesObserver; private LocalMediaObserver mLocalVideosObserver; - private final int DEFAULT_SYSTEM_UI_VISIBILITY = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN - | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION; + private final int DEFAULT_SYSTEM_UI_VISIBILITY = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; private boolean mPendingDeletion = false; @@ -640,12 +639,19 @@ public class CameraActivity extends Activity View decorView = getWindow().getDecorView(); int currentSystemUIVisibility = decorView.getSystemUiVisibility(); - 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); + 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); if (newSystemUIVisibility != currentSystemUIVisibility) { decorView.setSystemUiVisibility(newSystemUIVisibility); } diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java index 837fd0e4f..5707f7b62 100644 --- a/src/com/android/camera/PhotoUI.java +++ b/src/com/android/camera/PhotoUI.java @@ -387,14 +387,14 @@ public class PhotoUI implements PieListener, if (width > height) { if(Math.max(width, height * mAspectRatio) > width) { scaledTextureWidth = width; - scaledTextureHeight = width / mAspectRatio; + scaledTextureHeight = height; } else { scaledTextureWidth = height * mAspectRatio; scaledTextureHeight = height; } } else { if(Math.max(height, width * mAspectRatio) > height) { - scaledTextureWidth = height / mAspectRatio; + scaledTextureWidth = width; scaledTextureHeight = height; } else { scaledTextureWidth = width; diff --git a/src/com/android/camera/VideoUI.java b/src/com/android/camera/VideoUI.java index 82d6e2987..5f2c7cd08 100644 --- a/src/com/android/camera/VideoUI.java +++ b/src/com/android/camera/VideoUI.java @@ -386,14 +386,14 @@ public class VideoUI implements PieRenderer.PieListener, if (width > height) { if(Math.max(width, height * mAspectRatio) > width) { scaledTextureWidth = width; - scaledTextureHeight = width / mAspectRatio; + scaledTextureHeight = height; } else { scaledTextureWidth = height * mAspectRatio; scaledTextureHeight = height; } } else { if(Math.max(height, width * mAspectRatio) > height) { - scaledTextureWidth = height / mAspectRatio; + scaledTextureWidth = width; scaledTextureHeight = height; } else { scaledTextureWidth = width; |