summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2015-08-10 11:31:40 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2015-08-10 11:31:40 -0700
commitadd47e7df2e85cd64fb7c4e29a8a935195feee89 (patch)
treede1bba6455873be53bdda58c64b021431abce298 /src
parent26d8a1fb13d7a58f63d6a1032ac7c6c4b625f03f (diff)
parent8fce47a5fb0277b3763b94a1fd23ea499d35e4b1 (diff)
downloadandroid_packages_apps_Snap-add47e7df2e85cd64fb7c4e29a8a935195feee89.tar.gz
android_packages_apps_Snap-add47e7df2e85cd64fb7c4e29a8a935195feee89.tar.bz2
android_packages_apps_Snap-add47e7df2e85cd64fb7c4e29a8a935195feee89.zip
Merge "SnapdragonCamera: Set navigation bar according to flag"
Diffstat (limited to 'src')
-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 99c24ec3f..f8667254a 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;