summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcodeworkx <codeworkx@cyanogenmod.org>2016-05-01 12:19:41 +0200
committerMichael Bestas <mikeioannina@gmail.com>2017-01-04 21:57:50 +0200
commit4d959eb3d16933b7e876da0a9c1ed278dc56f5b2 (patch)
tree384af9724f7f1147ccb4592c09331ad4c33385e6
parent13a27f2bdcb1ff1d2a7bbb70cdc2ad173c04736c (diff)
downloadandroid_packages_apps_Snap-4d959eb3d16933b7e876da0a9c1ed278dc56f5b2.zip
android_packages_apps_Snap-4d959eb3d16933b7e876da0a9c1ed278dc56f5b2.tar.gz
android_packages_apps_Snap-4d959eb3d16933b7e876da0a9c1ed278dc56f5b2.tar.bz2
Snap: Extend user menu, disable dev menu
Change-Id: Iaa64372e5d196fd0117a32a386686bdb1fd51e45
-rwxr-xr-xsrc/com/android/camera/CameraActivity.java4
-rwxr-xr-xsrc/com/android/camera/PhotoMenu.java42
2 files changed, 31 insertions, 15 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index d210131..f7aa35a 100755
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -391,6 +391,10 @@ public class CameraActivity extends Activity
mDeveloperMenuEnabled = true;
}
+ public void disableDeveloperMenu() {
+ mDeveloperMenuEnabled = false;
+ }
+
private String fileNameFromDataID(int dataID) {
final LocalData localData = mDataAdapter.getLocalData(dataID);
diff --git a/src/com/android/camera/PhotoMenu.java b/src/com/android/camera/PhotoMenu.java
index e8745a9..8d77307 100755
--- a/src/com/android/camera/PhotoMenu.java
+++ b/src/com/android/camera/PhotoMenu.java
@@ -197,7 +197,13 @@ public class PhotoMenu extends MenuController
CameraSettings.KEY_SELFIE_MIRROR,
CameraSettings.KEY_SHUTTER_SOUND,
CameraSettings.KEY_POWER_SHUTTER,
- CameraSettings.KEY_MAX_BRIGHTNESS
+ CameraSettings.KEY_MAX_BRIGHTNESS,
+ CameraSettings.KEY_SATURATION,
+ CameraSettings.KEY_CONTRAST,
+ CameraSettings.KEY_SHARPNESS,
+ CameraSettings.KEY_AUTOEXPOSURE,
+ CameraSettings.KEY_ANTIBANDING,
+ CameraSettings.KEY_DENOISE
};
mOtherKeys2 = new String[] {
@@ -220,6 +226,12 @@ public class PhotoMenu extends MenuController
CameraSettings.KEY_REDEYE_REDUCTION,
CameraSettings.KEY_POWER_SHUTTER,
CameraSettings.KEY_MAX_BRIGHTNESS,
+ CameraSettings.KEY_SATURATION,
+ CameraSettings.KEY_CONTRAST,
+ CameraSettings.KEY_SHARPNESS,
+ CameraSettings.KEY_AUTOEXPOSURE,
+ CameraSettings.KEY_ANTIBANDING,
+ CameraSettings.KEY_DENOISE,
CameraSettings.KEY_AUTO_HDR,
CameraSettings.KEY_HDR_MODE,
CameraSettings.KEY_HDR_NEED_1X,
@@ -232,12 +244,6 @@ public class PhotoMenu extends MenuController
CameraSettings.KEY_TOUCH_AF_AEC,
CameraSettings.KEY_SELECTABLE_ZONE_AF,
CameraSettings.KEY_PICTURE_FORMAT,
- CameraSettings.KEY_SATURATION,
- CameraSettings.KEY_CONTRAST,
- CameraSettings.KEY_SHARPNESS,
- CameraSettings.KEY_AUTOEXPOSURE,
- CameraSettings.KEY_ANTIBANDING,
- CameraSettings.KEY_DENOISE,
CameraSettings.KEY_ADVANCED_FEATURES,
CameraSettings.KEY_AE_BRACKET_HDR,
CameraSettings.KEY_INSTANT_CAPTURE,
@@ -1293,20 +1299,26 @@ public class PhotoMenu extends MenuController
}
public void onPreferenceClicked(ListPreference pref, int y) {
- if (!mActivity.isDeveloperMenuEnabled()) {
- if (pref.getKey().equals(CameraSettings.KEY_REDEYE_REDUCTION)) {
- privateCounter++;
- if (privateCounter >= DEVELOPER_MENU_TOUCH_COUNT) {
+ // Developer menu
+ if (pref.getKey().equals(CameraSettings.KEY_REDEYE_REDUCTION)) {
+ privateCounter++;
+ if (privateCounter >= DEVELOPER_MENU_TOUCH_COUNT) {
+ SharedPreferences prefs = PreferenceManager
+ .getDefaultSharedPreferences(mActivity);
+ if (!mActivity.isDeveloperMenuEnabled()) {
mActivity.enableDeveloperMenu();
- SharedPreferences prefs = PreferenceManager
- .getDefaultSharedPreferences(mActivity);
prefs.edit().putBoolean(CameraSettings.KEY_DEVELOPER_MENU, true).apply();
RotateTextToast.makeText(mActivity,
"Camera developer option is enabled now", Toast.LENGTH_SHORT).show();
+ } else {
+ mActivity.disableDeveloperMenu();
+ prefs.edit().putBoolean(CameraSettings.KEY_DEVELOPER_MENU, false).apply();
+ RotateTextToast.makeText(mActivity,
+ "Camera developer option is disabled now", Toast.LENGTH_SHORT).show();
}
- } else {
- privateCounter = 0;
}
+ } else {
+ privateCounter = 0;
}
LayoutInflater inflater = (LayoutInflater) mActivity.getSystemService(
Context.LAYOUT_INFLATER_SERVICE);