diff options
-rw-r--r-- | res/values/cm_strings.xml | 4 | ||||
-rw-r--r-- | src/com/android/camera/PhotoMenu.java | 50 | ||||
-rw-r--r-- | src/com/android/camera/VideoMenu.java | 31 |
3 files changed, 61 insertions, 24 deletions
diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml index 410fa0b99..691358a4c 100644 --- a/res/values/cm_strings.xml +++ b/res/values/cm_strings.xml @@ -145,4 +145,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 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() { diff --git a/src/com/android/camera/VideoMenu.java b/src/com/android/camera/VideoMenu.java index 82d8c8afc..cd0f85102 100644 --- a/src/com/android/camera/VideoMenu.java +++ b/src/com/android/camera/VideoMenu.java @@ -21,7 +21,9 @@ import android.animation.Animator; import android.animation.Animator.AnimatorListener; import android.content.Context; import android.content.res.Resources; +import android.content.SharedPreferences; import android.graphics.Rect; +import android.preference.PreferenceManager; import android.text.TextUtils; import android.view.Display; import android.view.LayoutInflater; @@ -73,6 +75,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; @@ -82,6 +85,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 static final int CLICK_THRESHOLD = 200; private int previewMenuSize; @@ -576,6 +580,7 @@ public class VideoMenu extends MenuController LayoutInflater inflater = (LayoutInflater) mActivity.getSystemService( Context.LAYOUT_INFLATER_SERVICE); + FrameLayout basic = (FrameLayout) inflater.inflate( gridRes, null, false); @@ -823,7 +828,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); @@ -836,6 +840,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() { |