summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/CameraActivity.java
diff options
context:
space:
mode:
authorByunghun Jeon <bjeon@codeaurora.org>2016-05-10 11:38:21 -0700
committerByunghun Jeon <bjeon@codeaurora.org>2016-05-31 13:18:21 -0700
commit0fdbb4a33a2deb480f877b904203c7f04ef507d0 (patch)
tree42223718b561d86603ef46118c771c617fdba245 /src/com/android/camera/CameraActivity.java
parente8d4ba774d224e5076576ba4c29d1fc248456b40 (diff)
downloadandroid_packages_apps_Snap-0fdbb4a33a2deb480f877b904203c7f04ef507d0.tar.gz
android_packages_apps_Snap-0fdbb4a33a2deb480f877b904203c7f04ef507d0.tar.bz2
android_packages_apps_Snap-0fdbb4a33a2deb480f877b904203c7f04ef507d0.zip
SnapdragonCamera: Add SettingsManager, scene, and filter
Add SettingsManager to work as a database for settings. It will handle all dependencies and populate the values. Add scene mode and filter. Restructure UI and menu by combining them and leave the handling of settings to SettingsManager Change-Id: I185163fdddbffd29434e6a9c41b33be6d3388f88 CRs-Fixed: 1018118
Diffstat (limited to 'src/com/android/camera/CameraActivity.java')
-rw-r--r--src/com/android/camera/CameraActivity.java17
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);