summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2017-01-09 11:51:34 +0100
committerDanny Baumann <dannybaumann@web.de>2017-01-23 07:38:01 +0000
commite0a3c03cf912c6b437dd2bf96f486b88c699fb9c (patch)
tree9c15ada26d2820f0ac1744d9b244410f366520f9
parent32825fcb82af7a0eff35be365b82da675b49c340 (diff)
downloadandroid_packages_apps_Snap-e0a3c03cf912c6b437dd2bf96f486b88c699fb9c.zip
android_packages_apps_Snap-e0a3c03cf912c6b437dd2bf96f486b88c699fb9c.tar.gz
android_packages_apps_Snap-e0a3c03cf912c6b437dd2bf96f486b88c699fb9c.tar.bz2
Correctly return to film strip after editing a picture.
Change-Id: Icd4e47474f871d427d10ab2575e0d9622f1b4369
-rw-r--r--src/com/android/camera/CameraActivity.java19
-rw-r--r--src/com/android/camera/CaptureModule.java4
-rw-r--r--src/com/android/camera/PhotoModule.java4
-rw-r--r--src/com/android/camera/VideoModule.java4
-rw-r--r--src/com/android/camera/WideAnglePanoramaModule.java4
-rw-r--r--src/com/android/camera/ui/CameraControls.java6
6 files changed, 24 insertions, 17 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index 250e49e..d18a4a4 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -1698,13 +1698,6 @@ public class CameraActivity extends Activity
}
}
- @Override
- public void onWindowFocusChanged(boolean focus) {
- // Hide action bar first since we are in full screen mode first, and
- // switch the system UI to lights-out mode.
- if (focus) this.setSystemBarsVisibility(false);
- }
-
/**
* Checks if any of the needed Android runtime permissions are missing.
* If they are, then launch the permissions activity under one of the following conditions:
@@ -1750,9 +1743,6 @@ public class CameraActivity extends Activity
finish();
return;
}
- // Hide action bar first since we are in full screen mode first, and
- // switch the system UI to lights-out mode.
- this.setSystemBarsVisibility(false);
UsageStatistics.onEvent(UsageStatistics.COMPONENT_CAMERA,
UsageStatistics.ACTION_FOREGROUNDED, this.getClass().getSimpleName());
@@ -1762,14 +1752,21 @@ public class CameraActivity extends Activity
super.onResume();
mPaused = false;
mCurrentModule.onResumeAfterSuper();
- mCurrentModule.animateControls(0);
setSwipingEnabled(true);
if (mResetToPreviewOnResume) {
+ // Hide action bar first since we are in full screen mode first, and
+ // switch the system UI to lights-out mode.
+ setSystemBarsVisibility(false);
// Go to the preview on resume.
+ mCurrentModule.animateControls(0);
mFilmStripView.getController().goToFirstItem();
+ } else {
+ setSystemBarsVisibility(true);
+ mCurrentModule.animateControls(1);
}
+
// Default is showing the preview, unless disabled by explicitly
// starting an activity we want to return from to the filmstrip rather
// than the preview.
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index 9ccfc6e..b9eca0c 100644
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -429,7 +429,9 @@ public class CaptureModule extends BaseModule<CaptureUI> implements PhotoControl
mActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
- mUI.hidePreviewCover();
+ if (arePreviewControlsVisible()) {
+ mUI.hidePreviewCover();
+ }
}
});
mFirstPreviewLoaded = true;
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index e41c777..590a112 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -2997,7 +2997,9 @@ public class PhotoModule extends BaseModule<PhotoUI> implements
new CameraManager.CameraPreviewDataCallback() {
@Override
public void onPreviewFrame(byte[] data, CameraProxy camera) {
- mUI.hidePreviewCover();
+ if (arePreviewControlsVisible()) {
+ mUI.hidePreviewCover();
+ }
}
});
mCameraDevice.startPreview();
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index ea78bb4..b72cc1c 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -1356,7 +1356,9 @@ public class VideoModule extends BaseModule<VideoUI> implements
new CameraManager.CameraPreviewDataCallback() {
@Override
public void onPreviewFrame(byte[] data, CameraProxy camera) {
- mUI.hidePreviewCover();
+ if (arePreviewControlsVisible()) {
+ mUI.hidePreviewCover();
+ }
}
});
mCameraDevice.startPreview();
diff --git a/src/com/android/camera/WideAnglePanoramaModule.java b/src/com/android/camera/WideAnglePanoramaModule.java
index 59b71e0..e7c95c0 100644
--- a/src/com/android/camera/WideAnglePanoramaModule.java
+++ b/src/com/android/camera/WideAnglePanoramaModule.java
@@ -1167,7 +1167,9 @@ public class WideAnglePanoramaModule extends BaseModule<WideAnglePanoramaUI> imp
new CameraManager.CameraPreviewDataCallback() {
@Override
public void onPreviewFrame(byte[] data, CameraProxy camera) {
- mUI.hidePreviewCover();
+ if (arePreviewControlsVisible()) {
+ mUI.hidePreviewCover();
+ }
}
});
mCameraDevice.startPreview();
diff --git a/src/com/android/camera/ui/CameraControls.java b/src/com/android/camera/ui/CameraControls.java
index f06c14d..c57c538 100644
--- a/src/com/android/camera/ui/CameraControls.java
+++ b/src/com/android/camera/ui/CameraControls.java
@@ -468,7 +468,9 @@ public class CameraControls extends RotatableLayout {
} else {
mRemainingPhotosText.setText(remaining + " ");
}
- mRemainingPhotos.setVisibility(View.VISIBLE);
+ if (mAnimationHelper.areControlsVisible()) {
+ mRemainingPhotos.setVisibility(View.VISIBLE);
+ }
}
mCurrentRemaining = remaining;
}
@@ -489,7 +491,6 @@ public class CameraControls extends RotatableLayout {
} else {
mBottomBar.setBackgroundResource(R.drawable.camera_controls_bg_translucent);
}
- mAnimationHelper.reset();
}
public void showRefocusToast(boolean show) {
@@ -636,6 +637,7 @@ public class CameraControls extends RotatableLayout {
}
public void reset() {
+ dump("reset");
if (mAnimator != null) {
mAnimator.cancel();
}