diff options
-rw-r--r-- | res/drawable-hdpi/btn_close_settings.png | bin | 3655 -> 522 bytes | |||
-rw-r--r-- | res/drawable-hdpi/btn_zoom_control.png | bin | 16386 -> 1572 bytes | |||
-rw-r--r-- | res/drawable-mdpi/btn_close_settings.png | bin | 0 -> 446 bytes | |||
-rw-r--r-- | res/drawable-mdpi/btn_zoom_control.png | bin | 0 -> 1024 bytes | |||
-rw-r--r-- | res/drawable-xhdpi/btn_close_settings.png | bin | 0 -> 656 bytes | |||
-rw-r--r-- | res/drawable-xhdpi/btn_zoom_control.png | bin | 0 -> 2218 bytes | |||
-rw-r--r-- | res/layout-w1024dp/camera_control.xml | 5 | ||||
-rw-r--r-- | res/layout/camera_control.xml | 10 | ||||
-rw-r--r-- | res/layout/indicator_bar.xml | 2 | ||||
-rw-r--r-- | src/com/android/camera/Camera.java | 20 | ||||
-rw-r--r-- | src/com/android/camera/VideoCamera.java | 20 | ||||
-rw-r--r-- | src/com/android/camera/ui/IndicatorBar.java | 18 | ||||
-rw-r--r-- | src/com/android/camera/ui/IndicatorControl.java | 20 | ||||
-rw-r--r-- | src/com/android/camera/ui/IndicatorWheel.java | 9 | ||||
-rw-r--r-- | src/com/android/camera/ui/SecondLevelIndicatorBar.java | 4 |
15 files changed, 32 insertions, 76 deletions
diff --git a/res/drawable-hdpi/btn_close_settings.png b/res/drawable-hdpi/btn_close_settings.png Binary files differindex 3774aea..96e65bc 100644 --- a/res/drawable-hdpi/btn_close_settings.png +++ b/res/drawable-hdpi/btn_close_settings.png diff --git a/res/drawable-hdpi/btn_zoom_control.png b/res/drawable-hdpi/btn_zoom_control.png Binary files differindex b9c1c98..3229530 100644 --- a/res/drawable-hdpi/btn_zoom_control.png +++ b/res/drawable-hdpi/btn_zoom_control.png diff --git a/res/drawable-mdpi/btn_close_settings.png b/res/drawable-mdpi/btn_close_settings.png Binary files differnew file mode 100644 index 0000000..4a04aa5 --- /dev/null +++ b/res/drawable-mdpi/btn_close_settings.png diff --git a/res/drawable-mdpi/btn_zoom_control.png b/res/drawable-mdpi/btn_zoom_control.png Binary files differnew file mode 100644 index 0000000..001793e --- /dev/null +++ b/res/drawable-mdpi/btn_zoom_control.png diff --git a/res/drawable-xhdpi/btn_close_settings.png b/res/drawable-xhdpi/btn_close_settings.png Binary files differnew file mode 100644 index 0000000..d252c65 --- /dev/null +++ b/res/drawable-xhdpi/btn_close_settings.png diff --git a/res/drawable-xhdpi/btn_zoom_control.png b/res/drawable-xhdpi/btn_zoom_control.png Binary files differnew file mode 100644 index 0000000..4287fd4 --- /dev/null +++ b/res/drawable-xhdpi/btn_zoom_control.png diff --git a/res/layout-w1024dp/camera_control.xml b/res/layout-w1024dp/camera_control.xml index 8008adb..2ce91b6 100644 --- a/res/layout-w1024dp/camera_control.xml +++ b/res/layout-w1024dp/camera_control.xml @@ -53,11 +53,6 @@ android:layout_height="wrap_content" android:src="@drawable/btn_zoom_out" android:visibility="gone" /> - - <com.android.camera.ui.CameraPicker android:id="@+id/camera_picker" - android:clickable="true" - android:layout_width="wrap_content" - android:layout_height="wrap_content" /> </com.android.camera.ui.IndicatorWheel> <com.android.camera.ui.ZoomPicker diff --git a/res/layout/camera_control.xml b/res/layout/camera_control.xml index ea9c3fe..801b173 100644 --- a/res/layout/camera_control.xml +++ b/res/layout/camera_control.xml @@ -23,16 +23,6 @@ <include layout="@layout/review_thumbnail"/> - <com.android.camera.ui.CameraPicker android:id="@+id/camera_picker" - android:clickable="true" - android:layout_centerVertical="true" - android:layout_centerHorizontal="true" - android:layout_below="@+id/share_button" - android:layout_above="@+id/shutter_button" - android:layout_width="36dp" - android:layout_height="36dp" /> - <!-- need fixed size of the view since the source icon(HDPI) will be too large for phones --> - <com.android.camera.ShutterButton android:id="@+id/shutter_button" android:layout_width="wrap_content" android:layout_height="wrap_content" diff --git a/res/layout/indicator_bar.xml b/res/layout/indicator_bar.xml index b3d8c09..e57cf45 100644 --- a/res/layout/indicator_bar.xml +++ b/res/layout/indicator_bar.xml @@ -17,9 +17,7 @@ android:id="@+id/indicator_control" android:layout_width="48dp" android:layout_height="match_parent" - android:layout_marginTop="6dp" android:layout_marginRight="6dp" - android:layout_marginBottom="6dp" android:clickable="true" android:layout_alignParentRight="true"> <com.android.camera.ui.IndicatorBar diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java index 52997f7..50b5165 100644 --- a/src/com/android/camera/Camera.java +++ b/src/com/android/camera/Camera.java @@ -16,7 +16,6 @@ package com.android.camera; -import com.android.camera.ui.CameraPicker; import com.android.camera.ui.FaceView; import com.android.camera.ui.FocusRectangle; import com.android.camera.ui.IndicatorControl; @@ -183,9 +182,6 @@ public class Camera extends ActivityBase implements View.OnClickListener, private View mGpsNoSignalView; private View mGpsHasSignalView; - // front/back camera switch. - private CameraPicker mCameraPicker; - /** * An unpublished intent flag requesting to return as soon as capturing * is completed. @@ -621,19 +617,6 @@ public class Camera extends ActivityBase implements View.OnClickListener, } }; - private void initializeCameraPicker() { - mCameraPicker = (CameraPicker) findViewById(R.id.camera_picker); - if (mCameraPicker != null) { - ListPreference pref = mPreferenceGroup.findPreference( - CameraSettings.KEY_CAMERA_ID); - if (pref != null) { - mCameraPicker.initialize(pref); - mCameraPicker.setListener(this); - } - mCameraPicker.setCameraPickerIcon(); - } - } - private void initGpsOnScreenIndicator() { mGpsNoSignalView = findViewById(R.id.onscreen_gps_indicator_no_signal); mGpsHasSignalView = findViewById(R.id.onscreen_gps_indicator_on); @@ -1088,7 +1071,6 @@ public class Camera extends ActivityBase implements View.OnClickListener, // parameters. initializeZoomControl(); initializeIndicatorControl(); - initializeCameraPicker(); } private void overrideCameraSettings(final String flashMode, @@ -1158,7 +1140,6 @@ public class Camera extends ActivityBase implements View.OnClickListener, private void enableCameraControls(boolean enable) { if (mIndicatorControl != null) mIndicatorControl.setEnabled(enable); - if (mCameraPicker != null) mCameraPicker.setEnabled(enable); if (mModePicker != null) mModePicker.setEnabled(enable); if (mZoomControl != null) mZoomControl.setEnabled(enable); } @@ -1202,7 +1183,6 @@ public class Camera extends ActivityBase implements View.OnClickListener, if (mModePicker != null) mModePicker.setDegree(degree); if (mSharePopup != null) mSharePopup.setOrientation(degree); if (mIndicatorControl != null) mIndicatorControl.setDegree(degree); - if (mCameraPicker != null) mCameraPicker.setDegree(degree); if (mZoomControl != null) mZoomControl.setDegree(degree); } diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java index 62f84b1..e023c6c 100644 --- a/src/com/android/camera/VideoCamera.java +++ b/src/com/android/camera/VideoCamera.java @@ -16,7 +16,6 @@ package com.android.camera; -import com.android.camera.ui.CameraPicker; import com.android.camera.ui.IndicatorControl; import com.android.camera.ui.IndicatorWheel; import com.android.camera.ui.RotateImageView; @@ -242,9 +241,6 @@ public class VideoCamera extends ActivityBase private ZoomControl mZoomControl; private final ZoomListener mZoomListener = new ZoomListener(); - // front/back camera switch. - private CameraPicker mCameraPicker; - // This Handler is used to post message back onto the main thread of the // application private class MainHandler extends Handler { @@ -451,20 +447,6 @@ public class VideoCamera extends ActivityBase // Initialize after startPreview becuase this need mParameters. initializeZoomControl(); initializeIndicatorControl(); - initializeCameraPicker(); - } - - private void initializeCameraPicker() { - mCameraPicker = (CameraPicker) findViewById(R.id.camera_picker); - if (mCameraPicker != null) { - ListPreference pref = mPreferenceGroup.findPreference( - CameraSettings.KEY_CAMERA_ID); - if (pref != null) { - mCameraPicker.initialize(pref); - mCameraPicker.setListener(this); - } - mCameraPicker.setCameraPickerIcon(); - } } private void loadCameraPreferences() { @@ -483,7 +465,6 @@ public class VideoCamera extends ActivityBase private void enableCameraControls(boolean enable) { if (mIndicatorControl != null) mIndicatorControl.setEnabled(enable); if (mModePicker != null) mModePicker.setEnabled(enable); - if (mCameraPicker != null) mCameraPicker.setEnabled(enable); } private void initializeIndicatorControl() { @@ -547,7 +528,6 @@ public class VideoCamera extends ActivityBase if (mModePicker != null) mModePicker.setDegree(degree); if (mSharePopup != null) mSharePopup.setOrientation(degree); if (mIndicatorControl != null) mIndicatorControl.setDegree(degree); - if (mCameraPicker != null) mCameraPicker.setDegree(degree); } private void startPlayVideoActivity() { diff --git a/src/com/android/camera/ui/IndicatorBar.java b/src/com/android/camera/ui/IndicatorBar.java index e470b4e..5c6a8be 100644 --- a/src/com/android/camera/ui/IndicatorBar.java +++ b/src/com/android/camera/ui/IndicatorBar.java @@ -20,7 +20,6 @@ import com.android.camera.CameraPreference.OnPreferenceChangedListener; import com.android.camera.CameraSettings; import com.android.camera.PreferenceGroup; import com.android.camera.R; -import com.android.camera.Util; import android.content.Context; import android.util.AttributeSet; @@ -38,10 +37,6 @@ public class IndicatorBar extends IndicatorControl implements private ImageView mZoomIcon; private ImageView mSecondLevelIcon; - public IndicatorBar(Context context) { - super(context); - } - public IndicatorBar(Context context, AttributeSet attrs) { super(context, attrs); } @@ -51,6 +46,9 @@ public class IndicatorBar extends IndicatorControl implements // From UI spec, we have camera_flash setting on the first level. super.initialize(context, group, new String[] {flashSetting}, null); + // Add CameraPicker control. + initializeCameraPicker(context, group); + // add Zoom Icon. if (zoomSupported) { mZoomIcon = (ImageView) findViewById(R.id.zoom_control_icon); @@ -83,13 +81,15 @@ public class IndicatorBar extends IndicatorControl implements int count = getChildCount(); if (count == 0) return; int width = right - left; - View view; + int offset = 0; + for (int i = 0 ; i < count ; i++) { - view = getChildAt(i); + View view = getChildAt(i); if (view instanceof IndicatorButton) { - view.layout(0, 0, width, width); - return; + view.layout(0, offset, width, offset + width); + offset += width; } } + if (mCameraPicker != null) mCameraPicker.layout(0, offset, width, offset + width); } } diff --git a/src/com/android/camera/ui/IndicatorControl.java b/src/com/android/camera/ui/IndicatorControl.java index 57ec318..1bcd5e7 100644 --- a/src/com/android/camera/ui/IndicatorControl.java +++ b/src/com/android/camera/ui/IndicatorControl.java @@ -42,6 +42,7 @@ public abstract class IndicatorControl extends RelativeLayout implements private Context mContext; private OnPreferenceChangedListener mListener; protected OnIndicatorEventListener mOnIndicatorEventListener; + protected CameraPicker mCameraPicker; private PreferenceGroup mPreferenceGroup; private int mDegree = 0; @@ -51,11 +52,7 @@ public abstract class IndicatorControl extends RelativeLayout implements public void setListener(OnPreferenceChangedListener listener) { mListener = listener; - } - - public IndicatorControl(Context context) { - super(context); - mContext = context; + if (mCameraPicker != null) mCameraPicker.setListener(listener); } public IndicatorControl(Context context, AttributeSet attrs) { @@ -78,7 +75,7 @@ public abstract class IndicatorControl extends RelativeLayout implements mOnIndicatorEventListener = listener; } - // For the initialization of first-level indicator bar. + // For the initialization of first-level indicator control. public void initialize(Context context, PreferenceGroup group, String flashSetting, String[] keys, String[] otherSettingKeys) { initialize(context, group, keys, otherSettingKeys); @@ -106,6 +103,16 @@ public abstract class IndicatorControl extends RelativeLayout implements requestLayout(); } + public void initializeCameraPicker(Context context, PreferenceGroup group) { + ListPreference pref = group.findPreference( + CameraSettings.KEY_CAMERA_ID); + if (pref == null) return; + mCameraPicker = new CameraPicker(context); + mCameraPicker.initialize(pref); + mCameraPicker.setCameraPickerIcon(); + addView(mCameraPicker); + } + private void removeIndicators() { for (View v: mIndicators) { removeView(v); @@ -196,5 +203,6 @@ public abstract class IndicatorControl extends RelativeLayout implements v.setEnabled(enabled); } } + if (mCameraPicker != null) mCameraPicker.setEnabled(enabled); } } diff --git a/src/com/android/camera/ui/IndicatorWheel.java b/src/com/android/camera/ui/IndicatorWheel.java index 3ee3f5c..6235cb1 100644 --- a/src/com/android/camera/ui/IndicatorWheel.java +++ b/src/com/android/camera/ui/IndicatorWheel.java @@ -16,6 +16,7 @@ package com.android.camera.ui; +import com.android.camera.PreferenceGroup; import com.android.camera.R; import com.android.camera.Util; @@ -81,6 +82,14 @@ public class IndicatorWheel extends IndicatorControl { } @Override + public void initialize(Context context, PreferenceGroup group, + String flashSetting, String[] keys, String[] otherSettingKeys) { + // Add CameraPicker control. + initializeCameraPicker(context, group); + super.initialize(context, group, flashSetting, keys, otherSettingKeys); + } + + @Override public boolean dispatchTouchEvent(MotionEvent event) { if (!onFilterTouchEventForSecurity(event)) return false; diff --git a/src/com/android/camera/ui/SecondLevelIndicatorBar.java b/src/com/android/camera/ui/SecondLevelIndicatorBar.java index 9a697fe..1ba74a9 100644 --- a/src/com/android/camera/ui/SecondLevelIndicatorBar.java +++ b/src/com/android/camera/ui/SecondLevelIndicatorBar.java @@ -36,10 +36,6 @@ public class SecondLevelIndicatorBar extends IndicatorControl implements int mDegree = 0; int mSelectedIndex = -1; - public SecondLevelIndicatorBar(Context context) { - super(context); - } - public SecondLevelIndicatorBar(Context context, AttributeSet attrs) { super(context, attrs); } |