diff options
-rw-r--r-- | res/layout/video_camera.xml | 20 | ||||
-rw-r--r-- | res/xml/video_preferences.xml | 6 | ||||
-rw-r--r-- | src/com/android/camera/VideoCamera.java | 17 |
3 files changed, 38 insertions, 5 deletions
diff --git a/res/layout/video_camera.xml b/res/layout/video_camera.xml index b165d90..9ebdc03 100644 --- a/res/layout/video_camera.xml +++ b/res/layout/video_camera.xml @@ -15,6 +15,7 @@ --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:camera="http://schemas.android.com/apk/res/com.android.camera" android:id="@+id/video_camera" android:background="@drawable/camera_background" android:orientation="horizontal" @@ -35,8 +36,7 @@ <SurfaceView android:id="@+id/camera_preview" android:layout_width="fill_parent" android:layout_height="fill_parent"/> - <ImageView - android:id="@+id/video_frame" + <ImageView android:id="@+id/video_frame" android:layout_width="fill_parent" android:layout_height="fill_parent" android:visibility="gone" /> @@ -61,6 +61,22 @@ android:textSize="23dp" android:textStyle="bold" android:visibility="gone"/> + <LinearLayout android:id="@+id/indicator_bar" + android:orientation="vertical" + android:visibility="visible" + android:gravity="center" + android:layout_gravity="left|bottom" + android:layout_marginBottom="60dp" + android:layout_marginLeft="13dp" + android:layout_width="wrap_content" + android:layout_height="wrap_content"> + <com.android.camera.IconIndicator + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:id="@+id/whitebalance_icon" + camera:modes="@array/pref_camera_whitebalance_entryvalues" + camera:icons="@array/whitebalance_icons"/> + </LinearLayout> </FrameLayout> </com.android.camera.PreviewFrameLayout> </LinearLayout> diff --git a/res/xml/video_preferences.xml b/res/xml/video_preferences.xml index 3617f79..105d1fc 100644 --- a/res/xml/video_preferences.xml +++ b/res/xml/video_preferences.xml @@ -14,7 +14,8 @@ limitations under the License. --> -<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> +<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:camera="http://schemas.android.com/apk/res/com.android.camera"> <PreferenceCategory android:title="@string/pref_camcorder_settings_category"> <ListPreference @@ -31,10 +32,11 @@ android:entries="@array/pref_camera_video_duration_entries" android:entryValues="@array/pref_camera_video_duration_entryvalues" android:dialogTitle="@string/pref_camera_video_duration_dialogtitle" /> - <ListPreference + <com.android.camera.IconListPreference android:key="pref_camera_whitebalance_key" android:defaultValue="@string/pref_camera_whitebalance_default" android:title="@string/pref_camera_whitebalance_title" + camera:icons="@array/pref_camera_whitebalance_icons" android:entries="@array/pref_camera_whitebalance_entries" android:entryValues="@array/pref_camera_whitebalance_entryvalues" android:dialogTitle="@string/pref_camera_whitebalance_dialogtitle" /> diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java index 144c9fb..8ef404c 100644 --- a/src/com/android/camera/VideoCamera.java +++ b/src/com/android/camera/VideoCamera.java @@ -135,6 +135,7 @@ public class VideoCamera extends NoSearchActivity private String mCurrentVideoFilename; private Uri mCurrentVideoUri; private ContentValues mCurrentVideoValues; + private IconIndicator mWhitebalanceIndicator; private MediaRecorderProfile mProfile; @@ -309,6 +310,9 @@ public class VideoCamera extends NoSearchActivity 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(); @@ -1361,8 +1365,9 @@ public class VideoCamera extends NoSearchActivity 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); @@ -1377,6 +1382,16 @@ public class VideoCamera extends NoSearchActivity } 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) { |