summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/WallpaperPickerActivity.java
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2013-09-25 07:57:33 -0700
committerMichael Jurka <mikejurka@google.com>2013-09-25 08:08:49 -0700
commit8a34bdba657b5d8d1e919e89c31c81e38846b63c (patch)
tree6e8733eb9e6f7e1e2ab9ec873fae4775b09354ac /src/com/android/launcher3/WallpaperPickerActivity.java
parentb923fb339969c58dc6f6eea51e3e201787126a84 (diff)
downloadandroid_packages_apps_Trebuchet-8a34bdba657b5d8d1e919e89c31c81e38846b63c.tar.gz
android_packages_apps_Trebuchet-8a34bdba657b5d8d1e919e89c31c81e38846b63c.tar.bz2
android_packages_apps_Trebuchet-8a34bdba657b5d8d1e919e89c31c81e38846b63c.zip
Fix bug where no images could be deleted in wallpaper picker
Bug: 10926729 Change-Id: I9392e297d071f1ed12bb6665e591756dfe42009f
Diffstat (limited to 'src/com/android/launcher3/WallpaperPickerActivity.java')
-rw-r--r--src/com/android/launcher3/WallpaperPickerActivity.java13
1 files changed, 10 insertions, 3 deletions
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);
}
}