summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Bestas <mikeioannina@cyanogenmod.org>2016-08-04 18:28:53 (GMT)
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-08-20 15:01:10 (GMT)
commit46a8831be1f4fde221e790308a555f116d0dbecc (patch)
tree8b08607ef28f4eed7b10644dbfc79c80c67cd7a9
parent6304f00be7a309497a93544ecce5e2d322434967 (diff)
downloadandroid_packages_apps_Snap-46a8831be1f4fde221e790308a555f116d0dbecc.zip
android_packages_apps_Snap-46a8831be1f4fde221e790308a555f116d0dbecc.tar.gz
android_packages_apps_Snap-46a8831be1f4fde221e790308a555f116d0dbecc.tar.bz2
Snap: Make developer menu more accessible
* Not all devices have red eye reduction, which made it impossible to enable advanced options. Move the toggle to max brightness option which is present in all devices. * Allow enabling advanced options through camcorder settings. * Move hardcoded strings to cm_strings for translations. * Close menus when developer mode is toggled so we can see the extra options when the menu is reopened. * Decrease taps to 7, matching Settings tap-to-enable. * Properly reset tap counter. Change-Id: Iac39b9309388b92bf75a49a6091b483b13bd9154
-rw-r--r--res/values/cm_strings.xml4
-rw-r--r--src/com/android/camera/PhotoMenu.java51
-rw-r--r--src/com/android/camera/VideoMenu.java28
3 files changed, 58 insertions, 25 deletions
diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml
index fa90e8b..e82717e 100644
--- a/res/values/cm_strings.xml
+++ b/res/values/cm_strings.xml
@@ -251,4 +251,8 @@
<string name="pref_camera_shutter_speed_entry_30" translatable="false">30</string>
<string name="auto_hdr_enabled">Auto HDR enabled</string>
+
+ <!-- Advanced options -->
+ <string name="developer_menu_enabled">You have enabled advanced camera options</string>
+ <string name="developer_menu_disabled">You have disabled advanced camera options</string>
</resources>
diff --git a/src/com/android/camera/PhotoMenu.java b/src/com/android/camera/PhotoMenu.java
index df278a9..db77b2c 100644
--- a/src/com/android/camera/PhotoMenu.java
+++ b/src/com/android/camera/PhotoMenu.java
@@ -80,7 +80,7 @@ public class PhotoMenu extends MenuController
private static final int PREVIEW_MENU_ON = 2;
private static final int MODE_SCENE = 0;
private static final int MODE_FILTER = 1;
- private static final int DEVELOPER_MENU_TOUCH_COUNT = 10;
+ private static final int DEVELOPER_MENU_TOUCH_COUNT = 7;
private int mSceneStatus;
private View mHdrSwitcher;
private View mFrontBackSwitcher;
@@ -97,7 +97,7 @@ public class PhotoMenu extends MenuController
private String mPrevSavedCDS;
private boolean mIsTNREnabled = false;
private boolean mIsCDSUpdated = false;
- private int privateCounter = 0;
+ private int mPrivateCounter = 0;
private static final int ANIMATION_DURATION = 300;
private int previewMenuSize;
private Rect mTmpRect = new Rect();
@@ -999,28 +999,6 @@ public class PhotoMenu extends MenuController
}
public void onPreferenceClicked(ListPreference pref, int y) {
- // 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();
- 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;
- }
-
LayoutInflater inflater = (LayoutInflater) mActivity.getSystemService(
Context.LAYOUT_INFLATER_SERVICE);
ListSubMenu basic = (ListSubMenu) inflater.inflate(
@@ -1036,6 +1014,31 @@ public class PhotoMenu extends MenuController
mUI.showPopup(mListSubMenu, 2, true);
}
mPopupStatus = POPUP_SECOND_LEVEL;
+
+ // Developer menu
+ if (pref.getKey().equals(CameraSettings.KEY_MAX_BRIGHTNESS)) {
+ mPrivateCounter++;
+ if (mPrivateCounter >= DEVELOPER_MENU_TOUCH_COUNT) {
+ SharedPreferences prefs = PreferenceManager
+ .getDefaultSharedPreferences(mActivity);
+ if (!mActivity.isDeveloperMenuEnabled()) {
+ mActivity.enableDeveloperMenu();
+ prefs.edit().putBoolean(CameraSettings.KEY_DEVELOPER_MENU, true).apply();
+ closeAllView();
+ RotateTextToast.makeText(mActivity,
+ R.string.developer_menu_enabled, Toast.LENGTH_SHORT).show();
+ } else {
+ mActivity.disableDeveloperMenu();
+ prefs.edit().putBoolean(CameraSettings.KEY_DEVELOPER_MENU, false).apply();
+ closeAllView();
+ RotateTextToast.makeText(mActivity,
+ R.string.developer_menu_disabled, Toast.LENGTH_SHORT).show();
+ }
+ mPrivateCounter = 0;
+ }
+ } else {
+ mPrivateCounter = 0;
+ }
}
public void onListMenuTouched() {
diff --git a/src/com/android/camera/VideoMenu.java b/src/com/android/camera/VideoMenu.java
index 0da3e11..054db5d 100644
--- a/src/com/android/camera/VideoMenu.java
+++ b/src/com/android/camera/VideoMenu.java
@@ -76,6 +76,7 @@ public class VideoMenu extends MenuController
private static final int PREVIEW_MENU_IN_ANIMATION = 1;
private static final int PREVIEW_MENU_ON = 2;
private static final int MODE_FILTER = 1;
+ private static final int DEVELOPER_MENU_TOUCH_COUNT = 7;
private int mSceneStatus;
private View mFrontBackSwitcher;
private View mFilterModeSwitcher;
@@ -85,6 +86,7 @@ public class VideoMenu extends MenuController
private String mPrevSavedVideoCDS;
private boolean mIsVideoTNREnabled = false;
private boolean mIsVideoCDSUpdated = false;
+ private int mPrivateCounter = 0;
private static final int ANIMATION_DURATION = 300;
private int previewMenuSize;
private Rect mTmpRect = new Rect();
@@ -734,7 +736,6 @@ public class VideoMenu extends MenuController
public void onPreferenceClicked(ListPreference pref, int y) {
LayoutInflater inflater = (LayoutInflater) mActivity.getSystemService(
Context.LAYOUT_INFLATER_SERVICE);
-
ListSubMenu basic = (ListSubMenu) inflater.inflate(
R.layout.list_sub_menu, null, false);
basic.initialize(pref, y);
@@ -747,6 +748,31 @@ public class VideoMenu extends MenuController
mUI.showPopup(mListSubMenu, 2, true);
}
mPopupStatus = POPUP_SECOND_LEVEL;
+
+ // Developer menu
+ if (pref.getKey().equals(CameraSettings.KEY_MAX_BRIGHTNESS)) {
+ mPrivateCounter++;
+ if (mPrivateCounter >= DEVELOPER_MENU_TOUCH_COUNT) {
+ SharedPreferences prefs = PreferenceManager
+ .getDefaultSharedPreferences(mActivity);
+ if (!mActivity.isDeveloperMenuEnabled()) {
+ mActivity.enableDeveloperMenu();
+ prefs.edit().putBoolean(CameraSettings.KEY_DEVELOPER_MENU, true).apply();
+ closeAllView();
+ RotateTextToast.makeText(mActivity,
+ R.string.developer_menu_enabled, Toast.LENGTH_SHORT).show();
+ } else {
+ mActivity.disableDeveloperMenu();
+ prefs.edit().putBoolean(CameraSettings.KEY_DEVELOPER_MENU, false).apply();
+ closeAllView();
+ RotateTextToast.makeText(mActivity,
+ R.string.developer_menu_disabled, Toast.LENGTH_SHORT).show();
+ }
+ mPrivateCounter = 0;
+ }
+ } else {
+ mPrivateCounter = 0;
+ }
}
public void onListMenuTouched() {