diff options
author | Owen Lin <owenlin@google.com> | 2010-03-03 21:12:40 +0800 |
---|---|---|
committer | Owen Lin <owenlin@google.com> | 2010-03-07 14:30:49 +0800 |
commit | 281be5337852cb4b5d24e0a0440c426cb96bbebd (patch) | |
tree | b4218ea13055f7e9302e432554baf1e12695cef1 /src/com/android/camera/ui/BasicIndicator.java | |
parent | be69d39c4ab8fa93a52ed13a72ba2ad582adf583 (diff) | |
download | LegacyCamera-281be5337852cb4b5d24e0a0440c426cb96bbebd.zip LegacyCamera-281be5337852cb4b5d24e0a0440c426cb96bbebd.tar.gz LegacyCamera-281be5337852cb4b5d24e0a0440c426cb96bbebd.tar.bz2 |
Add pixel density concept to the code. So, it draw about the same size on
mdpi and hdpi devices.
Update the UI assets for mdpi
Fix a issue that GLSurfaceView didn't call onPause and onResume in Camera.
Refactor. Improve the drawing and animation.
Also fix the RawTexture unsupported operation bugs and the NullPointerException
in GLRootView.
Change-Id: I7aeadcad72d64a665828a6bb4f0f73e685fde632
Diffstat (limited to 'src/com/android/camera/ui/BasicIndicator.java')
-rw-r--r-- | src/com/android/camera/ui/BasicIndicator.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/com/android/camera/ui/BasicIndicator.java b/src/com/android/camera/ui/BasicIndicator.java index 0d97ee7..3a5b330 100644 --- a/src/com/android/camera/ui/BasicIndicator.java +++ b/src/com/android/camera/ui/BasicIndicator.java @@ -4,6 +4,7 @@ import android.content.Context; import com.android.camera.IconListPreference; import com.android.camera.R; +import com.android.camera.Util; import com.android.camera.ui.GLListView.OnItemSelectedListener; public class BasicIndicator extends AbstractIndicator { @@ -15,7 +16,8 @@ public class BasicIndicator extends AbstractIndicator { private PreferenceAdapter mModel; private String mOverride; - public BasicIndicator(IconListPreference preference) { + public BasicIndicator(Context context, IconListPreference preference) { + super(context); mPreference = preference; mIcon = new ResourceTexture[preference.getIconIds().length]; mIndex = preference.findIndexOfValue(preference.getValue()); @@ -24,12 +26,16 @@ public class BasicIndicator extends AbstractIndicator { @Override public void overrideSettings(String key, String settings) { IconListPreference pref = mPreference; - if (!pref.getKey().equals(key)) return; + if (Util.equals(mOverride, settings)) return; + mOverride = settings; - mIndex = pref.findIndexOfValue( + int index = pref.findIndexOfValue( settings == null ? pref.getValue() : settings); - invalidate(); + if (mIndex != index) { + mIndex = index; + invalidate(); + } } @Override |