summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/CameraActivity.java
diff options
context:
space:
mode:
authorztenghui <ztenghui@google.com>2013-09-12 14:56:56 -0700
committerztenghui <ztenghui@google.com>2013-09-12 15:02:44 -0700
commit8566dd777cd219254c945240a31ac97de28792a2 (patch)
treeeddb11f2326b29145303cc0ddf42fa48e9d58460 /src/com/android/camera/CameraActivity.java
parent7b265a6b2f55c6ae7afc30e63ba324c4084a5d8e (diff)
downloadandroid_packages_apps_Snap-8566dd777cd219254c945240a31ac97de28792a2.tar.gz
android_packages_apps_Snap-8566dd777cd219254c945240a31ac97de28792a2.tar.bz2
android_packages_apps_Snap-8566dd777cd219254c945240a31ac97de28792a2.zip
When current data is preview, don't show the action bar.
bug:10678458 Change-Id: Ia48ca694ddca47438338e7223e9fa19c2c65dd5d
Diffstat (limited to 'src/com/android/camera/CameraActivity.java')
-rw-r--r--src/com/android/camera/CameraActivity.java28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index bbe0ebb08..b27c44827 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -232,13 +232,29 @@ public class CameraActivity extends Activity
@Override
public void onDataFullScreenChange(int dataID, boolean full) {
- boolean isCameraID = mDataAdapter.getLocalData(dataID).getLocalDataType() ==
- LocalData.LOCAL_CAMERA_PREVIEW;
+ boolean isCameraID = isCameraPreview(dataID);
if (!isCameraID) {
setActionBarVisibilityAndLightsOut(full);
}
}
+ /**
+ * Check if the local data corresponding to dataID is the camera
+ * preview.
+ *
+ * @param dataID the ID of the local data
+ * @return true if the local data is not null and it is the
+ * camera preview.
+ */
+ private boolean isCameraPreview(int dataID) {
+ LocalData localData = mDataAdapter.getLocalData(dataID);
+ if (localData == null) {
+ Log.w(TAG, "Current data ID not found.");
+ return false;
+ }
+ return localData.getLocalDataType() == LocalData.LOCAL_CAMERA_PREVIEW;
+ }
+
@Override
public void onCurrentDataChanged(final int dataID, final boolean current) {
runOnUiThread(new Runnable() {
@@ -286,13 +302,13 @@ public class CameraActivity extends Activity
}
@Override
- public boolean onToggleActionBarVisibility() {
+ public boolean onToggleActionBarVisibility(int dataID) {
if (mActionBar.isShowing()) {
setActionBarVisibilityAndLightsOut(true);
} else {
- // In the preview, don't show the action bar if that is
- // a capture intent.
- if (!isCaptureIntent()) {
+ // Don't show the action bar if that is the camera preview.
+ boolean isCameraID = isCameraPreview(dataID);
+ if (!isCameraID) {
setActionBarVisibilityAndLightsOut(false);
}
}