summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/CameraActivity.java
diff options
context:
space:
mode:
authorztenghui <ztenghui@google.com>2013-09-12 22:16:39 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-09-12 22:16:39 +0000
commita29a0ad0fa7667177025a26d3043cb601ae17a6c (patch)
treee5b0d1ca6e69cab742db530f3ba0eb431c243f28 /src/com/android/camera/CameraActivity.java
parentd1b0801a2e7f80c5ac047dded1edd0d3806f1e86 (diff)
parent8566dd777cd219254c945240a31ac97de28792a2 (diff)
downloadandroid_packages_apps_Snap-a29a0ad0fa7667177025a26d3043cb601ae17a6c.tar.gz
android_packages_apps_Snap-a29a0ad0fa7667177025a26d3043cb601ae17a6c.tar.bz2
android_packages_apps_Snap-a29a0ad0fa7667177025a26d3043cb601ae17a6c.zip
Merge "When current data is preview, don't show the action bar." into gb-ub-photos-carlsbad
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);
}
}