diff options
author | Wu-cheng Li <wuchengli@google.com> | 2010-11-29 17:07:07 +0800 |
---|---|---|
committer | Wu-cheng Li <wuchengli@google.com> | 2010-11-29 17:10:40 +0800 |
commit | e747919853dfcbe29969647d7bf83269056d77bc (patch) | |
tree | 6dce6bf005fa3a992290a6ca065c8fe221c00bc8 /src/com/android/camera/IconListPreference.java | |
parent | ee1ce9805a4dba409fbf05457cac7f5991b571c5 (diff) | |
download | LegacyCamera-e747919853dfcbe29969647d7bf83269056d77bc.zip LegacyCamera-e747919853dfcbe29969647d7bf83269056d77bc.tar.gz LegacyCamera-e747919853dfcbe29969647d7bf83269056d77bc.tar.bz2 |
Move scene mode to indicator wheel.
bug:3156671
Change-Id: I8e663f7bfde805eeef06bf4f3d9b883a58e51ce5
Diffstat (limited to 'src/com/android/camera/IconListPreference.java')
-rw-r--r-- | src/com/android/camera/IconListPreference.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/com/android/camera/IconListPreference.java b/src/com/android/camera/IconListPreference.java index 2a01e7e..d0bd441 100644 --- a/src/com/android/camera/IconListPreference.java +++ b/src/com/android/camera/IconListPreference.java @@ -27,7 +27,7 @@ import java.util.List; /** A {@code ListPreference} where each entry has a corresponding icon. */ public class IconListPreference extends ListPreference { - + private int mSingleIconId; private int mIconIds[]; private int mLargeIconIds[]; private int mImageIds[]; @@ -37,16 +37,21 @@ public class IconListPreference extends ListPreference { TypedArray a = context.obtainStyledAttributes( attrs, R.styleable.IconListPreference, 0, 0); Resources res = context.getResources(); + mSingleIconId = a.getResourceId( + R.styleable.IconListPreference_singleIcon, 0); mIconIds = getIds(res, a.getResourceId( R.styleable.IconListPreference_icons, 0)); mLargeIconIds = getIds(res, a.getResourceId( R.styleable.IconListPreference_largeIcons, 0)); mImageIds = getIds(res, a.getResourceId( R.styleable.IconListPreference_images, 0)); - if (mImageIds == null) mImageIds = mLargeIconIds; a.recycle(); } + public int getSingleIcon() { + return mSingleIconId; + } + public int[] getIconIds() { return mIconIds; } @@ -86,17 +91,17 @@ public class IconListPreference extends ListPreference { IntArray largeIconIds = new IntArray(); IntArray imageIds = new IntArray(); - // We allow mIconsIds to be null, but not mLargeIconIds. The reason is that if large icons - // are unspecified, the on screen icons will be blank which is a bug. for (int i = 0, len = entryValues.length; i < len; i++) { if (supported.indexOf(entryValues[i].toString()) >= 0) { if (mIconIds != null) iconIds.add(mIconIds[i]); - largeIconIds.add(mLargeIconIds[i]); + if (mLargeIconIds != null) largeIconIds.add(mLargeIconIds[i]); if (mImageIds != null) imageIds.add(mImageIds[i]); } } if (mIconIds != null) mIconIds = iconIds.toArray(new int[iconIds.size()]); - mLargeIconIds = largeIconIds.toArray(new int[largeIconIds.size()]); + if (mLargeIconIds != null) { + mLargeIconIds = largeIconIds.toArray(new int[largeIconIds.size()]); + } if (mImageIds != null) mImageIds = imageIds.toArray(new int[imageIds.size()]); super.filterUnsupported(supported); } |