summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/camera/Camera.java28
-rw-r--r--src/com/android/camera/CameraSettings.java1
-rw-r--r--src/com/android/camera/ComboPreferences.java4
-rw-r--r--src/com/android/camera/ui/RotateLayout.java2
4 files changed, 32 insertions, 3 deletions
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java
index fee97cc..5005a1a 100644
--- a/src/com/android/camera/Camera.java
+++ b/src/com/android/camera/Camera.java
@@ -21,6 +21,7 @@ import com.android.camera.ui.FaceView;
import com.android.camera.ui.FocusRectangle;
import com.android.camera.ui.IndicatorControl;
import com.android.camera.ui.RotateImageView;
+import com.android.camera.ui.RotateLayout;
import com.android.camera.ui.SharePopup;
import com.android.camera.ui.ZoomPicker;
@@ -71,6 +72,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
+import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.RelativeLayout;
import android.widget.Toast;
@@ -103,6 +105,7 @@ public class Camera extends ActivityBase implements View.OnClickListener,
private static final int SET_CAMERA_PARAMETERS_WHEN_IDLE = 5;
private static final int CHECK_DISPLAY_ROTATION = 6;
private static final int RESET_TOUCH_FOCUS = 7;
+ private static final int DISMISS_TAP_TO_FOCUS_TOAST = 8;
// The subset of parameters we need to update in setCameraParameters().
private static final int UPDATE_PARAM_INITIALIZE = 1;
@@ -319,6 +322,14 @@ public class Camera extends ActivityBase implements View.OnClickListener,
startFaceDetection();
break;
}
+
+ case DISMISS_TAP_TO_FOCUS_TOAST: {
+ View v = findViewById(R.id.tap_to_focus_prompt);
+ v.setVisibility(View.GONE);
+ v.setAnimation(AnimationUtils.loadAnimation(Camera.this,
+ R.anim.on_screen_hint_exit));
+ break;
+ }
}
}
}
@@ -394,6 +405,7 @@ public class Camera extends ActivityBase implements View.OnClickListener,
initializeFocusTone();
initializeZoom();
startFaceDetection();
+ showTapToFocusToastIfNeeded();
mFirstTimeInitialized = true;
addIdleHandler();
}
@@ -2385,4 +2397,20 @@ public class Camera extends ActivityBase implements View.OnClickListener,
public void onFaceDetection(Face[] faces, android.hardware.Camera camera) {
mFaceView.setFaces(faces);
}
+
+ private void showTapToFocusToastIfNeeded() {
+ if (mParameters.getMaxNumFocusAreas() > 0 &&
+ mPreferences.getBoolean(CameraSettings.KEY_TAP_TO_FOCUS_PROMPT_SHOWN, true)) {
+ // Show the toast.
+ RotateLayout v = (RotateLayout) findViewById(R.id.tap_to_focus_prompt);
+ v.setOrientation(mOrientationCompensation);
+ v.startAnimation(AnimationUtils.loadAnimation(this, R.anim.on_screen_hint_enter));
+ v.setVisibility(View.VISIBLE);
+ mHandler.sendEmptyMessageDelayed(DISMISS_TAP_TO_FOCUS_TOAST, 5000);
+ // Clear the preference.
+ Editor editor = mPreferences.edit();
+ editor.putBoolean(CameraSettings.KEY_TAP_TO_FOCUS_PROMPT_SHOWN, false);
+ editor.apply();
+ }
+ }
}
diff --git a/src/com/android/camera/CameraSettings.java b/src/com/android/camera/CameraSettings.java
index 96f439a..50bd9d8 100644
--- a/src/com/android/camera/CameraSettings.java
+++ b/src/com/android/camera/CameraSettings.java
@@ -49,6 +49,7 @@ public class CameraSettings {
public static final String KEY_SCENE_MODE = "pref_camera_scenemode_key";
public static final String KEY_EXPOSURE = "pref_camera_exposure_key";
public static final String KEY_CAMERA_ID = "pref_camera_id_key";
+ public static final String KEY_TAP_TO_FOCUS_PROMPT_SHOWN = "pref_tap_to_focus_prompt_shown_key";
public static final String EXPOSURE_DEFAULT_VALUE = "0";
diff --git a/src/com/android/camera/ComboPreferences.java b/src/com/android/camera/ComboPreferences.java
index b8705cc..81667a4 100644
--- a/src/com/android/camera/ComboPreferences.java
+++ b/src/com/android/camera/ComboPreferences.java
@@ -18,7 +18,6 @@ package com.android.camera;
import android.content.Context;
import android.content.SharedPreferences;
-import android.content.SharedPreferences.Editor;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.preference.PreferenceManager;
@@ -76,7 +75,8 @@ public class ComboPreferences implements SharedPreferences, OnSharedPreferenceCh
private static boolean isGlobal(String key) {
return key.equals(CameraSettings.KEY_VIDEO_TIME_LAPSE_FRAME_INTERVAL)
|| key.equals(CameraSettings.KEY_CAMERA_ID)
- || key.equals(CameraSettings.KEY_RECORD_LOCATION);
+ || key.equals(CameraSettings.KEY_RECORD_LOCATION)
+ || key.equals(CameraSettings.KEY_TAP_TO_FOCUS_PROMPT_SHOWN);
}
public String getString(String key, String defValue) {
diff --git a/src/com/android/camera/ui/RotateLayout.java b/src/com/android/camera/ui/RotateLayout.java
index c900557..13b475d 100644
--- a/src/com/android/camera/ui/RotateLayout.java
+++ b/src/com/android/camera/ui/RotateLayout.java
@@ -23,7 +23,7 @@ import android.view.ViewGroup;
// A RotateLayout is designed to display a single item and provides the
// capabilities to rotate the item.
-class RotateLayout extends ViewGroup {
+public class RotateLayout extends ViewGroup {
private static final String TAG = "RotateLayout";
private int mOrientation;
private View mChild;