diff options
author | Owen Lin <owenlin@google.com> | 2010-03-06 11:18:18 +0800 |
---|---|---|
committer | Owen Lin <owenlin@google.com> | 2010-03-10 16:19:54 +0800 |
commit | 33be45a1abaf6a8d611fb87b18945c84ab76c229 (patch) | |
tree | 1f17fd3321761df9b3374654315d14cd898d8720 /src/com/android/camera/ui/HeadUpDisplay.java | |
parent | 8e5c4413072e5d69b0f413940f1ae448202949db (diff) | |
download | LegacyCamera-33be45a1abaf6a8d611fb87b18945c84ab76c229.zip LegacyCamera-33be45a1abaf6a8d611fb87b18945c84ab76c229.tar.gz LegacyCamera-33be45a1abaf6a8d611fb87b18945c84ab76c229.tar.bz2 |
Add the new ZoomController UI and also the exposure compensation settings.
Fix the bug that some MotionEvent of some actions should always pass to the
component who accept the DOWN event.
Also fix a bug that nine patch image will be drawn incorrectly after rotation.
Change-Id: I8ab36fb6f958c1967afa11eed5f167842b59cada
Diffstat (limited to 'src/com/android/camera/ui/HeadUpDisplay.java')
-rw-r--r-- | src/com/android/camera/ui/HeadUpDisplay.java | 41 |
1 files changed, 36 insertions, 5 deletions
diff --git a/src/com/android/camera/ui/HeadUpDisplay.java b/src/com/android/camera/ui/HeadUpDisplay.java index 8e71178..0f77336 100644 --- a/src/com/android/camera/ui/HeadUpDisplay.java +++ b/src/com/android/camera/ui/HeadUpDisplay.java @@ -13,11 +13,12 @@ import android.view.View.MeasureSpec; import android.view.animation.AlphaAnimation; import android.view.animation.Animation; +import com.google.android.camera.R; + import com.android.camera.CameraSettings; import com.android.camera.IconListPreference; import com.android.camera.ListPreference; import com.android.camera.PreferenceGroup; -import com.google.android.camera.R; import java.util.ArrayList; import java.util.concurrent.Callable; @@ -41,7 +42,11 @@ public class HeadUpDisplay extends GLView { protected static final String TAG = "HeadUpDisplay"; private IndicatorBar mIndicatorBar; + private OtherSettingsIndicator mOtherSettings; private GpsIndicator mGpsIndicator; + private ZoomIndicator mZoomIndicator; + + private PreferenceGroup mPreferenceGroup; private PopupWindow mPopupWindow; @@ -155,6 +160,7 @@ public class HeadUpDisplay extends GLView { } public void initialize(Context context, PreferenceGroup preferenceGroup) { + mPreferenceGroup = preferenceGroup; initializeIndicatorBar(context, preferenceGroup); } @@ -193,9 +199,9 @@ public class HeadUpDisplay extends GLView { private void scheduleDeactiviateIndicatorBar() { mHandler.removeMessages(HIDE_POPUP_WINDOW); - mHandler.sendEmptyMessageDelayed(HIDE_POPUP_WINDOW, 2000); + mHandler.sendEmptyMessageDelayed(HIDE_POPUP_WINDOW, 3000); mHandler.removeMessages(DEACTIVATE_INDICATOR_BAR); - mHandler.sendEmptyMessageDelayed(DEACTIVATE_INDICATOR_BAR, 3000); + mHandler.sendEmptyMessageDelayed(DEACTIVATE_INDICATOR_BAR, 4000); } public void hidePopupWindow() { @@ -219,6 +225,10 @@ public class HeadUpDisplay extends GLView { mPopupWindow.setOrientation(orientation); } + public void reloadPreferences() { + + } + private void initializePopupWindow(Context context) { mPopupWindow = new PopupWindow(); mPopupWindow.setBackground( @@ -291,15 +301,16 @@ public class HeadUpDisplay extends GLView { mIndicatorBar.setHighlight(new NinePatchTexture( context, R.drawable.ic_viewfinder_iconbar_highlight)); - OtherSettingsIndicator otherSettings = new OtherSettingsIndicator( + mOtherSettings = new OtherSettingsIndicator( context, getListPreferences(group, CameraSettings.KEY_FOCUS_MODE, + CameraSettings.KEY_EXPOSURE, CameraSettings.KEY_SCENE_MODE, CameraSettings.KEY_PICTURE_SIZE, CameraSettings.KEY_JPEG_QUALITY, CameraSettings.KEY_COLOR_EFFECT)); - mIndicatorBar.addComponent(otherSettings); + mIndicatorBar.addComponent(mOtherSettings); GpsIndicator gpsIndicator = new GpsIndicator( context, (IconListPreference) @@ -313,10 +324,21 @@ public class HeadUpDisplay extends GLView { addIndicator(context, mIndicatorBar, group, CameraSettings.KEY_FLASH_MODE); + mZoomIndicator = new ZoomIndicator(context); + mIndicatorBar.addComponent(mZoomIndicator); + addComponent(mIndicatorBar); mIndicatorBar.setOnItemSelectedListener(new IndicatorBarListener()); } + public void setZoomListener(ZoomController.ZoomListener listener) { + mZoomIndicator.setZoomListener(listener); + } + + public void setZoomIndex(int index) { + mZoomIndicator.setZoomIndex(index); + } + public void setGpsHasSignal(final boolean hasSignal) { GLRootView root = getGLRootView(); if (root != null) { @@ -356,4 +378,13 @@ public class HeadUpDisplay extends GLView { mPopupWindow.popoff(); } } + + public void setZoomRatios(float[] zoomRatios) { + mZoomIndicator.setZoomRatios(zoomRatios); + } + + public void collapse() { + mIndicatorBar.setSelectedIndex(IndicatorBar.INDEX_NONE); + mIndicatorBar.setActivated(false); + } } |