summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2013-09-25 22:33:56 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-09-25 22:33:56 +0000
commit3727811f5195396f217bea046110747914385b16 (patch)
tree2a84eb00381616ced3f320bb3d549edc12f8bedd /src/com
parentb66773cfb9aee1e99b21e8cbac58043bb1ec32a9 (diff)
parent8a34bdba657b5d8d1e919e89c31c81e38846b63c (diff)
downloadandroid_packages_apps_Trebuchet-3727811f5195396f217bea046110747914385b16.tar.gz
android_packages_apps_Trebuchet-3727811f5195396f217bea046110747914385b16.tar.bz2
android_packages_apps_Trebuchet-3727811f5195396f217bea046110747914385b16.zip
Merge "Fix bug where no images could be deleted in wallpaper picker" into jb-ub-now-indigo-rose
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/launcher3/LiveWallpaperListAdapter.java1
-rw-r--r--src/com/android/launcher3/SavedWallpaperImages.java4
-rw-r--r--src/com/android/launcher3/ThirdPartyWallpaperPickerListAdapter.java1
-rw-r--r--src/com/android/launcher3/WallpaperPickerActivity.java13
4 files changed, 16 insertions, 3 deletions
diff --git a/src/com/android/launcher3/LiveWallpaperListAdapter.java b/src/com/android/launcher3/LiveWallpaperListAdapter.java
index 9d0f48bf0..e9e5e79a8 100644
--- a/src/com/android/launcher3/LiveWallpaperListAdapter.java
+++ b/src/com/android/launcher3/LiveWallpaperListAdapter.java
@@ -116,6 +116,7 @@ public class LiveWallpaperListAdapter extends BaseAdapter implements ListAdapter
mThumbnail = thumbnail;
mInfo = info;
}
+ @Override
public void onClick(WallpaperPickerActivity a) {
Intent preview = new Intent(WallpaperManager.ACTION_CHANGE_LIVE_WALLPAPER);
preview.putExtra(WallpaperManager.EXTRA_LIVE_WALLPAPER_COMPONENT,
diff --git a/src/com/android/launcher3/SavedWallpaperImages.java b/src/com/android/launcher3/SavedWallpaperImages.java
index f00f62ff6..7cd82f075 100644
--- a/src/com/android/launcher3/SavedWallpaperImages.java
+++ b/src/com/android/launcher3/SavedWallpaperImages.java
@@ -57,6 +57,7 @@ public class SavedWallpaperImages extends BaseAdapter implements ListAdapter {
mDbId = dbId;
mThumb = thumb;
}
+ @Override
public void onClick(WallpaperPickerActivity a) {
String imageFilename = a.getSavedImages().getImageFilename(mDbId);
File file = new File(a.getFilesDir(), imageFilename);
@@ -65,14 +66,17 @@ public class SavedWallpaperImages extends BaseAdapter implements ListAdapter {
v.moveToLeft();
v.setTouchEnabled(false);
}
+ @Override
public void onSave(WallpaperPickerActivity a) {
boolean finishActivityWhenDone = true;
String imageFilename = a.getSavedImages().getImageFilename(mDbId);
a.setWallpaper(imageFilename, finishActivityWhenDone);
}
+ @Override
public void onDelete(WallpaperPickerActivity a) {
a.getSavedImages().deleteImage(mDbId);
}
+ @Override
public boolean isSelectable() {
return true;
}
diff --git a/src/com/android/launcher3/ThirdPartyWallpaperPickerListAdapter.java b/src/com/android/launcher3/ThirdPartyWallpaperPickerListAdapter.java
index ab2f5d72a..7ed1c1bfb 100644
--- a/src/com/android/launcher3/ThirdPartyWallpaperPickerListAdapter.java
+++ b/src/com/android/launcher3/ThirdPartyWallpaperPickerListAdapter.java
@@ -46,6 +46,7 @@ public class ThirdPartyWallpaperPickerListAdapter extends BaseAdapter implements
public ThirdPartyWallpaperTile(ResolveInfo resolveInfo) {
mResolveInfo = resolveInfo;
}
+ @Override
public void onClick(WallpaperPickerActivity a) {
final ComponentName itemComponentName = new ComponentName(
mResolveInfo.activityInfo.packageName, mResolveInfo.activityInfo.name);
diff --git a/src/com/android/launcher3/WallpaperPickerActivity.java b/src/com/android/launcher3/WallpaperPickerActivity.java
index 5f35cde21..a7c96f5df 100644
--- a/src/com/android/launcher3/WallpaperPickerActivity.java
+++ b/src/com/android/launcher3/WallpaperPickerActivity.java
@@ -87,11 +87,12 @@ public class WallpaperPickerActivity extends WallpaperCropActivity {
public static abstract class WallpaperTileInfo {
public void onClick(WallpaperPickerActivity a) {}
public void onSave(WallpaperPickerActivity a) {}
- public void onDelete() {}
+ public void onDelete(WallpaperPickerActivity a) {}
public boolean isSelectable() { return false; }
}
public static class PickImageInfo extends WallpaperTileInfo {
+ @Override
public void onClick(WallpaperPickerActivity a) {
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("image/*");
@@ -104,13 +105,14 @@ public class WallpaperPickerActivity extends WallpaperCropActivity {
public UriWallpaperInfo(Uri uri) {
mUri = uri;
}
+ @Override
public void onClick(WallpaperPickerActivity a) {
CropView v = a.getCropView();
v.setTileSource(new BitmapRegionTileSource(
a, mUri, 1024, 0), null);
v.setTouchEnabled(true);
}
-
+ @Override
public void onSave(final WallpaperPickerActivity a) {
boolean finishActivityWhenDone = true;
OnBitmapCroppedHandler h = new OnBitmapCroppedHandler() {
@@ -123,6 +125,7 @@ public class WallpaperPickerActivity extends WallpaperCropActivity {
};
a.cropImageAndSetWallpaper(mUri, h, finishActivityWhenDone);
}
+ @Override
public boolean isSelectable() {
return true;
}
@@ -138,6 +141,7 @@ public class WallpaperPickerActivity extends WallpaperCropActivity {
mResId = resId;
mThumb = thumb;
}
+ @Override
public void onClick(WallpaperPickerActivity a) {
BitmapRegionTileSource source = new BitmapRegionTileSource(
mResources, a, mResId, 1024, 0);
@@ -151,10 +155,12 @@ public class WallpaperPickerActivity extends WallpaperCropActivity {
v.setScale(wallpaperSize.x / crop.width());
v.setTouchEnabled(false);
}
+ @Override
public void onSave(WallpaperPickerActivity a) {
boolean finishActivityWhenDone = true;
a.cropImageAndSetWallpaper(mResources, mResId, finishActivityWhenDone);
}
+ @Override
public boolean isSelectable() {
return true;
}
@@ -361,7 +367,8 @@ public class WallpaperPickerActivity extends WallpaperCropActivity {
CheckableFrameLayout c =
(CheckableFrameLayout) mWallpapersView.getChildAt(i);
if (c.isChecked()) {
- ((WallpaperTileInfo) c.getTag()).onDelete();
+ WallpaperTileInfo info = (WallpaperTileInfo) c.getTag();
+ info.onDelete(WallpaperPickerActivity.this);
viewsToRemove.add(c);
}
}