diff options
-rw-r--r-- | res/values/config.xml | 3 | ||||
-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 |
4 files changed, 21 insertions, 12 deletions
diff --git a/res/values/config.xml b/res/values/config.xml index 7ada8d775..25224f73c 100644 --- a/res/values/config.xml +++ b/res/values/config.xml @@ -27,4 +27,7 @@ <!-- This value may be changed to true to enable the warped pano preview overlayed on top of the fullscreen pano preview. --> <bool name="enable_warped_pano_preview">true</bool> + + <!-- This value may be changed to true to hide navigation bar. --> + <bool name="hide_navigation_bar">false</bool> </resources> 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; |