aboutsummaryrefslogtreecommitdiff
path: root/apps/TestingCamera/src/com/android/testingcamera/TestingCamera.java
diff options
context:
space:
mode:
Diffstat (limited to 'apps/TestingCamera/src/com/android/testingcamera/TestingCamera.java')
-rw-r--r--apps/TestingCamera/src/com/android/testingcamera/TestingCamera.java35
1 files changed, 35 insertions, 0 deletions
diff --git a/apps/TestingCamera/src/com/android/testingcamera/TestingCamera.java b/apps/TestingCamera/src/com/android/testingcamera/TestingCamera.java
index 70e8835..e5ecd0c 100644
--- a/apps/TestingCamera/src/com/android/testingcamera/TestingCamera.java
+++ b/apps/TestingCamera/src/com/android/testingcamera/TestingCamera.java
@@ -89,6 +89,7 @@ public class TestingCamera extends Activity
private Spinner mPreviewSizeSpinner;
private Spinner mPreviewFrameRateSpinner;
private ToggleButton mPreviewToggle;
+ private ToggleButton mHDRToggle;
private Spinner mAutofocusModeSpinner;
private Button mAutofocusButton;
private Button mCancelAutofocusButton;
@@ -205,6 +206,10 @@ public class TestingCamera extends Activity
mPreviewFrameRateSpinner.setOnItemSelectedListener(mPreviewFrameRateListener);
mOpenOnlyControls.add(mPreviewFrameRateSpinner);
+ mHDRToggle = (ToggleButton) findViewById(R.id.hdr_mode);
+ mHDRToggle.setOnClickListener(mHDRToggleListener);
+ mOpenOnlyControls.add(mHDRToggle);
+
mPreviewToggle = (ToggleButton) findViewById(R.id.start_preview);
mPreviewToggle.setOnClickListener(mPreviewToggleListener);
mOpenOnlyControls.add(mPreviewToggle);
@@ -536,6 +541,26 @@ public class TestingCamera extends Activity
}
};
+ private View.OnClickListener mHDRToggleListener =
+ new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (mState == CAMERA_TAKE_PICTURE) {
+ logE("Can't change preview state while taking picture!");
+ return;
+ }
+
+ if (mHDRToggle.isChecked()) {
+ log("Turning on HDR");
+ mParams.setSceneMode(Camera.Parameters.SCENE_MODE_HDR);
+ } else {
+ log("Turning off HDR");
+ mParams.setSceneMode(Camera.Parameters.SCENE_MODE_AUTO);
+ }
+ mCamera.setParameters(mParams);
+ }
+ };
+
private View.OnClickListener mPreviewToggleListener =
new View.OnClickListener() {
@Override
@@ -936,6 +961,16 @@ public class TestingCamera extends Activity
setCameraDisplayOrientation();
mParams = mCamera.getParameters();
+ if (mParams != null) {
+ List<String> sceneModes = mParams.getSupportedSceneModes();
+ for (String mode : sceneModes) {
+ if (Camera.Parameters.SCENE_MODE_HDR.equals(mode)){
+ mHDRToggle.setEnabled(true);
+ } else {
+ mHDRToggle.setEnabled(false);
+ }
+ }
+ }
// Set up preview size selection