diff options
author | Michael Bestas <mikeioannina@cyanogenmod.org> | 2016-08-04 21:28:53 +0300 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2016-11-21 11:03:32 -0700 |
commit | 17ba73be09dde7318991ee806f83e635256fb471 (patch) | |
tree | 873f8cfb08e1c09e3c291c2451e62f38c1398797 /src/com/android/camera/PhotoMenu.java | |
parent | 51b75610335476b1a40b714848e8cb97921f50dd (diff) | |
download | android_packages_apps_Snap-17ba73be09dde7318991ee806f83e635256fb471.tar.gz android_packages_apps_Snap-17ba73be09dde7318991ee806f83e635256fb471.tar.bz2 android_packages_apps_Snap-17ba73be09dde7318991ee806f83e635256fb471.zip |
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
Diffstat (limited to 'src/com/android/camera/PhotoMenu.java')
-rw-r--r-- | src/com/android/camera/PhotoMenu.java | 50 |
1 files changed, 27 insertions, 23 deletions
diff --git a/src/com/android/camera/PhotoMenu.java b/src/com/android/camera/PhotoMenu.java index 98ae97835..04346ebff 100644 --- a/src/com/android/camera/PhotoMenu.java +++ b/src/com/android/camera/PhotoMenu.java @@ -92,7 +92,7 @@ public class PhotoMenu extends MenuController private static final int MODE_SCENE = 0; private static final int MODE_FILTER = 1; private static final int MODE_MAKEUP = 2; - 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 mTsMakeupSwitcher; @@ -110,7 +110,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 static final int CLICK_THRESHOLD = 200; private int previewMenuSize; @@ -1293,27 +1293,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( @@ -1329,6 +1308,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() { |