diff options
author | Camera Software Integration <camswint@localhost> | 2016-06-07 22:48:31 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-06-07 22:48:31 -0700 |
commit | e5775d32bd609c94ce3ecbe0ce541d4cf3611f2f (patch) | |
tree | 247c7b7739d922f3d8bf4dccf233f69717eed575 /src/com/android/camera/CameraActivity.java | |
parent | 2c23961728e0fdcadcf7caee0dc14fa4dd6d208f (diff) | |
parent | 0fdbb4a33a2deb480f877b904203c7f04ef507d0 (diff) | |
download | android_packages_apps_Snap-e5775d32bd609c94ce3ecbe0ce541d4cf3611f2f.tar.gz android_packages_apps_Snap-e5775d32bd609c94ce3ecbe0ce541d4cf3611f2f.tar.bz2 android_packages_apps_Snap-e5775d32bd609c94ce3ecbe0ce541d4cf3611f2f.zip |
Merge "SnapdragonCamera: Add SettingsManager, scene, and filter" into camera.lnx.1.0-dev.1.0
Diffstat (limited to 'src/com/android/camera/CameraActivity.java')
-rw-r--r-- | src/com/android/camera/CameraActivity.java | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java index fafb40839..a0bc79904 100644 --- a/src/com/android/camera/CameraActivity.java +++ b/src/com/android/camera/CameraActivity.java @@ -159,8 +159,6 @@ public class CameraActivity extends Activity /** Whether onResume should reset the view to the preview. */ private boolean mResetToPreviewOnResume = true; - public static boolean CAMERA_2_ON = false; - // Supported operations at FilmStripView. Different data has different // set of supported operations. private static final int SUPPORT_DELETE = 1 << 0; @@ -1409,6 +1407,8 @@ public class CameraActivity extends Activity getWindow().requestFeature(Window.FEATURE_ACTION_BAR); + SettingsManager.createInstance(this); + LayoutInflater inflater = getLayoutInflater(); View rootLayout = inflater.inflate(R.layout.camera, null, false); mCameraRootFrame = (FrameLayout)rootLayout.findViewById(R.id.camera_root_frame); @@ -1443,10 +1443,9 @@ public class CameraActivity extends Activity moduleIndex = ModuleSwitcher.PHOTO_MODULE_INDEX; } } - SharedPreferences pref = PreferenceManager - .getDefaultSharedPreferences(this); - CAMERA_2_ON = pref.getBoolean(CameraSettings.KEY_CAMERA2, false); - if (CAMERA_2_ON && moduleIndex == ModuleSwitcher.PHOTO_MODULE_INDEX) + + boolean cam2on = SettingsManager.getInstance().isCamera2On(); + if (cam2on && moduleIndex == ModuleSwitcher.PHOTO_MODULE_INDEX) moduleIndex = ModuleSwitcher.CAPTURE_MODULE_INDEX; mOrientationListener = new MyOrientationEventListener(this); @@ -1811,7 +1810,9 @@ public class CameraActivity extends Activity @Override public void onModuleSelected(int moduleIndex) { - if (moduleIndex == 0 && CAMERA_2_ON) moduleIndex = ModuleSwitcher.CAPTURE_MODULE_INDEX; + boolean cam2on = SettingsManager.getInstance().isCamera2On(); + if (cam2on && moduleIndex == ModuleSwitcher.PHOTO_MODULE_INDEX) + moduleIndex = ModuleSwitcher.CAPTURE_MODULE_INDEX; if (mCurrentModuleIndex == moduleIndex) { if (mCurrentModuleIndex != ModuleSwitcher.CAPTURE_MODULE_INDEX) { return; @@ -1879,6 +1880,8 @@ public class CameraActivity extends Activity if(mCaptureModule == null) { mCaptureModule = new CaptureModule(); mCaptureModule.init(this, mCameraCaptureModuleRootView); + } else { + mCaptureModule.reinit(); } mCurrentModule = mCaptureModule; mCameraCaptureModuleRootView.setVisibility(View.VISIBLE); |