summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Guy <romainguy@android.com>2009-11-09 13:46:52 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-11-09 13:46:52 -0800
commit1bdf0bad71ee978dd10c34df9fcde3de650e6eff (patch)
treeb18482a26d8fcc078a3a8eb3b64f6ae44f7b5010
parente3d8bfb157e277c7538e704552b7ff4acbf5b847 (diff)
parent573abdf4e21c40cca2320b939fd50e37a81f032c (diff)
downloadandroid_packages_wallpapers_LivePicker-1bdf0bad71ee978dd10c34df9fcde3de650e6eff.tar.gz
android_packages_wallpapers_LivePicker-1bdf0bad71ee978dd10c34df9fcde3de650e6eff.tar.bz2
android_packages_wallpapers_LivePicker-1bdf0bad71ee978dd10c34df9fcde3de650e6eff.zip
am 573abdf4: am 8cfd0d28: Sort live wallpapers alphabetically and UI tweaks.
Merge commit '573abdf4e21c40cca2320b939fd50e37a81f032c' * commit '573abdf4e21c40cca2320b939fd50e37a81f032c': Sort live wallpapers alphabetically and UI tweaks.
-rw-r--r--res/layout/live_wallpaper_entry.xml1
-rw-r--r--src/com/android/wallpaper/livepicker/LiveWallpaperListActivity.java16
2 files changed, 17 insertions, 0 deletions
diff --git a/res/layout/live_wallpaper_entry.xml b/res/layout/live_wallpaper_entry.xml
index 29be991..ce48242 100644
--- a/res/layout/live_wallpaper_entry.xml
+++ b/res/layout/live_wallpaper_entry.xml
@@ -19,6 +19,7 @@
android:layout_height="wrap_content"
android:paddingLeft="4dip"
+ android:paddingRight="4dip"
android:minHeight="?android:attr/listPreferredItemHeight">
<ImageView
diff --git a/src/com/android/wallpaper/livepicker/LiveWallpaperListActivity.java b/src/com/android/wallpaper/livepicker/LiveWallpaperListActivity.java
index 44493ee..0a680fe 100644
--- a/src/com/android/wallpaper/livepicker/LiveWallpaperListActivity.java
+++ b/src/com/android/wallpaper/livepicker/LiveWallpaperListActivity.java
@@ -43,7 +43,10 @@ import android.text.Html;
import java.util.ArrayList;
import java.util.List;
+import java.util.Collections;
+import java.util.Comparator;
import java.io.IOException;
+import java.text.Collator;
import org.xmlpull.v1.XmlPullParserException;
@@ -90,6 +93,19 @@ public class LiveWallpaperListActivity extends ListActivity implements AdapterVi
Canvas canvas = new Canvas();
+ Collections.sort(list, new Comparator<ResolveInfo>() {
+ final Collator mCollator;
+
+ {
+ mCollator = Collator.getInstance();
+ }
+
+ public int compare(ResolveInfo info1, ResolveInfo info2) {
+ return mCollator.compare(info1.loadLabel(mPackageManager),
+ info2.loadLabel(mPackageManager));
+ }
+ });
+
for (int i = 0; i < listSize; i++) {
ResolveInfo resolveInfo = list.get(i);
ComponentInfo ci = resolveInfo.serviceInfo;