summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/camera/CameraActivity.java22
-rw-r--r--src/com/android/camera/PhotoUI.java4
-rw-r--r--src/com/android/camera/VideoUI.java4
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;