summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoris Liu <tianliu@google.com>2013-06-24 15:29:54 -0700
committerDoris Liu <tianliu@google.com>2013-06-24 15:36:18 -0700
commit147e26ab7075f0acd3978f0cd0541cd1da4b50e1 (patch)
tree6d5e2d4ed60b26fc07593c4a79721f7e3557e33e
parentd073915c54e5852e4533c47be287111194e61b2d (diff)
downloadandroid_packages_apps_Snap-147e26ab7075f0acd3978f0cd0541cd1da4b50e1.tar.gz
android_packages_apps_Snap-147e26ab7075f0acd3978f0cd0541cd1da4b50e1.tar.bz2
android_packages_apps_Snap-147e26ab7075f0acd3978f0cd0541cd1da4b50e1.zip
Clean up camera switcher
Change-Id: I9f0495524028528ca02c7ddf94f4698d4e87af14
-rw-r--r--gallerycommon/src/com/android/gallery3d/common/ApiHelper.java3
-rw-r--r--src/com/android/camera/CameraActivity.java12
-rw-r--r--src/com/android/camera/PhotoUI.java2
-rw-r--r--src/com/android/camera/VideoUI.java2
-rw-r--r--src/com/android/camera/ui/CameraSwitcher.java14
5 files changed, 8 insertions, 25 deletions
diff --git a/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java b/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java
index dde4c567a..f58045007 100644
--- a/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java
+++ b/gallerycommon/src/com/android/gallery3d/common/ApiHelper.java
@@ -113,9 +113,6 @@ public class ApiHelper {
public static final boolean HAS_MEDIA_ACTION_SOUND =
Build.VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN;
- public static final boolean HAS_OLD_PANORAMA =
- Build.VERSION.SDK_INT >= VERSION_CODES.ICE_CREAM_SANDWICH;
-
public static final boolean HAS_TIME_LAPSE_RECORDING =
Build.VERSION.SDK_INT >= VERSION_CODES.HONEYCOMB;
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index c5cbb7e8a..07cb6ced7 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -44,6 +44,7 @@ import android.widget.ImageView;
import com.android.camera.data.CameraDataAdapter;
import com.android.camera.data.LocalData;
+import com.android.camera.ui.CameraSwitcher;
import com.android.camera.ui.CameraSwitcher.CameraSwitchListener;
import com.android.camera.ui.FilmStripView;
import com.android.gallery3d.R;
@@ -55,11 +56,6 @@ public class CameraActivity extends Activity
private static final String TAG = "CAM_Activity";
- public static final int PHOTO_MODULE_INDEX = 0;
- public static final int VIDEO_MODULE_INDEX = 1;
- public static final int PANORAMA_MODULE_INDEX = 2;
- public static final int LIGHTCYCLE_MODULE_INDEX = 3;
-
private static final String INTENT_ACTION_STILL_IMAGE_CAMERA_SECURE =
"android.media.action.STILL_IMAGE_CAMERA_SECURE";
public static final String ACTION_IMAGE_CAPTURE_SECURE =
@@ -422,13 +418,13 @@ public class CameraActivity extends Activity
closeModule(mCurrentModule);
mCurrentModuleIndex = i;
switch (i) {
- case VIDEO_MODULE_INDEX:
+ case CameraSwitcher.VIDEO_MODULE_INDEX:
mCurrentModule = new VideoModule();
break;
- case PHOTO_MODULE_INDEX:
+ case CameraSwitcher.PHOTO_MODULE_INDEX:
mCurrentModule = new PhotoModule();
break;
- case LIGHTCYCLE_MODULE_INDEX:
+ case CameraSwitcher.LIGHTCYCLE_MODULE_INDEX:
mCurrentModule = LightCycleHelper.createPanoramaModule();
break;
default:
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java
index b2a9df8cc..96d21f017 100644
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -195,7 +195,7 @@ public class PhotoUI implements PieListener,
mShutterButton = (ShutterButton) mRootView.findViewById(R.id.shutter_button);
mSwitcher = (CameraSwitcher) mRootView.findViewById(R.id.camera_switcher);
- mSwitcher.setCurrentIndex(0);
+ mSwitcher.setCurrentIndex(CameraSwitcher.PHOTO_MODULE_INDEX);
mSwitcher.setSwitchListener((CameraSwitchListener) mActivity);
mMenuButton = mRootView.findViewById(R.id.menu);
if (ApiHelper.HAS_FACE_DETECTION) {
diff --git a/src/com/android/camera/VideoUI.java b/src/com/android/camera/VideoUI.java
index c446b9778..169fc7d54 100644
--- a/src/com/android/camera/VideoUI.java
+++ b/src/com/android/camera/VideoUI.java
@@ -143,7 +143,7 @@ public class VideoUI implements PieRenderer.PieListener,
((CameraRootView) mRootView).setDisplayChangeListener(this);
mShutterButton = (ShutterButton) mRootView.findViewById(R.id.shutter_button);
mSwitcher = (CameraSwitcher) mRootView.findViewById(R.id.camera_switcher);
- mSwitcher.setCurrentIndex(1);
+ mSwitcher.setCurrentIndex(CameraSwitcher.VIDEO_MODULE_INDEX);
mSwitcher.setSwitchListener((CameraSwitchListener) mActivity);
initializeMiscControls();
initializeControlByIntent();
diff --git a/src/com/android/camera/ui/CameraSwitcher.java b/src/com/android/camera/ui/CameraSwitcher.java
index 537577fb5..90d88d29a 100644
--- a/src/com/android/camera/ui/CameraSwitcher.java
+++ b/src/com/android/camera/ui/CameraSwitcher.java
@@ -48,12 +48,10 @@ public class CameraSwitcher extends RotateImageView
public static final int PHOTO_MODULE_INDEX = 0;
public static final int VIDEO_MODULE_INDEX = 1;
- public static final int PANORAMA_MODULE_INDEX = 2;
- public static final int LIGHTCYCLE_MODULE_INDEX = 3;
+ public static final int LIGHTCYCLE_MODULE_INDEX = 2;
private static final int[] DRAW_IDS = {
R.drawable.ic_switch_camera,
R.drawable.ic_switch_video,
- R.drawable.ic_switch_pan,
R.drawable.ic_switch_photosphere
};
public interface CameraSwitchListener {
@@ -98,17 +96,13 @@ public class CameraSwitcher extends RotateImageView
public void initializeDrawables(Context context) {
int totaldrawid = (LightCycleHelper.hasLightCycleCapture(context)
? DRAW_IDS.length : DRAW_IDS.length - 1);
- if (!ApiHelper.HAS_OLD_PANORAMA) totaldrawid--;
int[] drawids = new int[totaldrawid];
int[] moduleids = new int[totaldrawid];
int ix = 0;
for (int i = 0; i < DRAW_IDS.length; i++) {
- if (i == PANORAMA_MODULE_INDEX && !ApiHelper.HAS_OLD_PANORAMA) {
- continue; // not enabled, so don't add to UI
- }
if (i == LIGHTCYCLE_MODULE_INDEX && !LightCycleHelper.hasLightCycleCapture(context)) {
- continue; // not enabled, so don't add to UI
+ continue; // not enabled, so don't add to UI
}
moduleids[ix] = i;
drawids[ix++] = DRAW_IDS[i];
@@ -188,10 +182,6 @@ public class CameraSwitcher extends RotateImageView
item.setContentDescription(getContext().getResources().getString(
R.string.accessibility_switch_to_video));
break;
- case R.drawable.ic_switch_pan:
- item.setContentDescription(getContext().getResources().getString(
- R.string.accessibility_switch_to_panorama));
- break;
case R.drawable.ic_switch_photosphere:
item.setContentDescription(getContext().getResources().getString(
R.string.accessibility_switch_to_new_panorama));