From cc12a303ad51063cee73715849a951fb5f383188 Mon Sep 17 00:00:00 2001 From: Cheng-Ru Lin Date: Thu, 12 Nov 2009 11:48:46 +0800 Subject: Add icon-indicators to VideoCamera. Change-Id: Ie5ace8cf1863636ffe94f89d70525483a95b3239 http://b/2247081 --- src/com/android/camera/VideoCamera.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/com/android/camera/VideoCamera.java') diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java index afd4cdd..f065f90 100644 --- a/src/com/android/camera/VideoCamera.java +++ b/src/com/android/camera/VideoCamera.java @@ -136,6 +136,7 @@ public class VideoCamera extends Activity implements View.OnClickListener, private String mCurrentVideoFilename; private Uri mCurrentVideoUri; private ContentValues mCurrentVideoValues; + private IconIndicator mWhitebalanceIndicator; private MediaRecorderProfile mProfile; @@ -311,6 +312,9 @@ public class VideoCamera extends Activity implements View.OnClickListener, mGripper = findViewById(R.id.btn_gripper); mGripper.setOnTouchListener(new GripperTouchListener()); + mWhitebalanceIndicator = + (IconIndicator) findViewById(R.id.whitebalance_icon); + // Make sure preview is started. try { startPreviewThread.join(); @@ -1400,8 +1404,9 @@ public class VideoCamera extends Activity implements View.OnClickListener, mParameters.setPreviewFrameRate(mProfile.mVideoFps); // Set white balance parameter. + String whiteBalance = Parameters.WHITE_BALANCE_AUTO; if (mParameters.getSupportedWhiteBalance() != null) { - String whiteBalance = mPreferences.getString( + whiteBalance = mPreferences.getString( CameraSettings.KEY_WHITE_BALANCE, getString(R.string.pref_camera_whitebalance_default)); mParameters.setWhiteBalance(whiteBalance); @@ -1416,6 +1421,16 @@ public class VideoCamera extends Activity implements View.OnClickListener, } mCameraDevice.setParameters(mParameters); + + final String finalWhiteBalance = whiteBalance; + + // It can be execute from the startPreview thread, so we post it + // to the main UI thread + mHandler.post(new Runnable() { + public void run() { + mWhitebalanceIndicator.setMode(finalWhiteBalance); + } + }); } public boolean onSwitchChanged(Switcher source, boolean onOff) { -- cgit v1.1