summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/ThirdPartyWallpaperPickerListAdapter.java
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2013-09-23 23:02:05 +0100
committerMichael Jurka <mikejurka@google.com>2013-09-24 12:09:34 +0100
commit1e4e6ddb38d0b867d0564be834f3425ed53d46e1 (patch)
treeba55e26da26ea808689c2ea9fa45f8ef1967fe40 /src/com/android/launcher3/ThirdPartyWallpaperPickerListAdapter.java
parenta64bdf433b64fa914ab9338cd8f43a4149a97d9c (diff)
downloadandroid_packages_apps_Trebuchet-1e4e6ddb38d0b867d0564be834f3425ed53d46e1.tar.gz
android_packages_apps_Trebuchet-1e4e6ddb38d0b867d0564be834f3425ed53d46e1.tar.bz2
android_packages_apps_Trebuchet-1e4e6ddb38d0b867d0564be834f3425ed53d46e1.zip
Refactoring to better support mixed wallpaper sources
Change-Id: I3b47a8f56d418c6f2e7b9fd469427c3056def8d8
Diffstat (limited to 'src/com/android/launcher3/ThirdPartyWallpaperPickerListAdapter.java')
-rw-r--r--src/com/android/launcher3/ThirdPartyWallpaperPickerListAdapter.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/com/android/launcher3/ThirdPartyWallpaperPickerListAdapter.java b/src/com/android/launcher3/ThirdPartyWallpaperPickerListAdapter.java
index 9fd0d0a5f..ab2f5d72a 100644
--- a/src/com/android/launcher3/ThirdPartyWallpaperPickerListAdapter.java
+++ b/src/com/android/launcher3/ThirdPartyWallpaperPickerListAdapter.java
@@ -41,6 +41,21 @@ public class ThirdPartyWallpaperPickerListAdapter extends BaseAdapter implements
private List<ResolveInfo> mThirdPartyWallpaperPickers = new ArrayList<ResolveInfo>();
+ public static class ThirdPartyWallpaperTile extends WallpaperPickerActivity.WallpaperTileInfo {
+ private ResolveInfo mResolveInfo;
+ public ThirdPartyWallpaperTile(ResolveInfo resolveInfo) {
+ mResolveInfo = resolveInfo;
+ }
+ public void onClick(WallpaperPickerActivity a) {
+ final ComponentName itemComponentName = new ComponentName(
+ mResolveInfo.activityInfo.packageName, mResolveInfo.activityInfo.name);
+ Intent launchIntent = new Intent(Intent.ACTION_SET_WALLPAPER);
+ launchIntent.setComponent(itemComponentName);
+ Utilities.startActivityForResultSafely(
+ a, launchIntent, WallpaperPickerActivity.PICK_WALLPAPER_THIRD_PARTY_ACTIVITY);
+ }
+ }
+
public ThirdPartyWallpaperPickerListAdapter(Context context) {
mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mPackageManager = context.getPackageManager();
@@ -88,7 +103,7 @@ public class ThirdPartyWallpaperPickerListAdapter extends BaseAdapter implements
return mThirdPartyWallpaperPickers.size();
}
- public Object getItem(int position) {
+ public ResolveInfo getItem(int position) {
return mThirdPartyWallpaperPickers.get(position);
}