summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/PhotoUI.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/camera/PhotoUI.java')
-rw-r--r--src/com/android/camera/PhotoUI.java31
1 files changed, 30 insertions, 1 deletions
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java
index f8f30ac0d..e7ab1ff9d 100644
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -69,6 +69,7 @@ import com.android.camera.ui.FaceView;
import com.android.camera.ui.FocusIndicator;
import com.android.camera.ui.ListSubMenu;
import com.android.camera.ui.ModuleSwitcher;
+import com.android.camera.ui.MenuHelp;
import com.android.camera.ui.PieRenderer;
import com.android.camera.ui.PieRenderer.PieListener;
import com.android.camera.ui.RenderOverlay;
@@ -114,6 +115,7 @@ public class PhotoUI implements PieListener,
private PhotoMenu mMenu;
private ModuleSwitcher mSwitcher;
private CameraControls mCameraControls;
+ private MenuHelp mMenuHelp;
private AlertDialog mLocationDialog;
// Small indicators which show the camera settings in the viewfinder.
@@ -322,6 +324,7 @@ public class PhotoUI implements PieListener,
mScreenRatio = CameraUtil.determineRatio(size.x, size.y);
calculateMargins(size);
mCameraControls.setMargins(mTopMargin, mBottomMargin);
+ showFirstTimeHelp();
}
private void calculateMargins(Point size) {
@@ -341,6 +344,19 @@ public class PhotoUI implements PieListener,
mOrientationResize = orientation;
}
+ private void showFirstTimeHelp(int topMargin, int bottomMargin) {
+ mMenuHelp = (MenuHelp) mRootView.findViewById(R.id.menu_help);
+ mMenuHelp.setVisibility(View.VISIBLE);
+ mMenuHelp.setMargins(topMargin, bottomMargin);
+ mMenuHelp.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ mMenuHelp.setVisibility(View.GONE);
+ mMenuHelp = null;
+ }
+ });
+ }
+
public void setAspectRatio(float ratio) {
if (ratio <= 0.0) throw new IllegalArgumentException();
@@ -568,7 +584,7 @@ public class PhotoUI implements PieListener,
mMenuButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
- if(mMenu != null){
+ if (mMenu != null) {
mMenu.openFirstLevel();
}
}
@@ -1335,6 +1351,8 @@ public class PhotoUI implements PieListener,
public void setOrientation(int orientation, boolean animation) {
mOrientation = orientation;
mCameraControls.setOrientation(orientation, animation);
+ if (mMenuHelp != null)
+ mMenuHelp.setOrientation(orientation, animation);
if (mMenuLayout != null)
mMenuLayout.setOrientation(orientation, animation);
if (mSubMenuLayout != null)
@@ -1390,6 +1408,17 @@ public class PhotoUI implements PieListener,
setOrientation(mOrientation, true);
}
+ public void showFirstTimeHelp() {
+ final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mActivity);
+ boolean isMenuShown = prefs.getBoolean(CameraSettings.KEY_SHOW_MENU_HELP, false);
+ if(!isMenuShown) {
+ showFirstTimeHelp(mTopMargin, mBottomMargin);
+ SharedPreferences.Editor editor = prefs.edit();
+ editor.putBoolean(CameraSettings.KEY_SHOW_MENU_HELP, true);
+ editor.apply();
+ }
+ }
+
public void showRefocusDialog() {
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mActivity);
int prompt = prefs.getInt(CameraSettings.KEY_REFOCUS_PROMPT, 1);