summaryrefslogtreecommitdiffstats
path: root/WallpaperPicker
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2015-05-21 15:54:58 -0700
committerSunny Goyal <sunnygoyal@google.com>2015-05-21 16:14:08 -0700
commit8abbd29ca320fe88d0043a51bc4a4f5914480b00 (patch)
treedb1f216f7f2318c408c94ee170c415f399a43b0f /WallpaperPicker
parent370afe8a04d1d13b03b5dda53a4f542bde016690 (diff)
downloadandroid_packages_apps_Trebuchet-8abbd29ca320fe88d0043a51bc4a4f5914480b00.tar.gz
android_packages_apps_Trebuchet-8abbd29ca320fe88d0043a51bc4a4f5914480b00.tar.bz2
android_packages_apps_Trebuchet-8abbd29ca320fe88d0043a51bc4a4f5914480b00.zip
Enabling setWallpaper button only if the image was loaded successfully
Bug: 20187333 Change-Id: I1b738a06499d20facbc4bccb1e6247086a45b686
Diffstat (limited to 'WallpaperPicker')
-rw-r--r--WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java1
-rw-r--r--WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java12
2 files changed, 9 insertions, 4 deletions
diff --git a/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java b/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java
index ee0d8b0c6..f2bb50944 100644
--- a/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java
+++ b/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java
@@ -263,6 +263,7 @@ public class WallpaperCropActivity extends BaseActivity implements Handler.Callb
if (req.postExecute != null) {
req.postExecute.run();
}
+ mProgressView.setVisibility(View.GONE);
}
public final void setCropViewTileSource(BitmapSource bitmapSource, boolean touchEnabled,
diff --git a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java
index 72cb194d6..3f90203ed 100644
--- a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java
+++ b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java
@@ -196,13 +196,15 @@ public class WallpaperPickerActivity extends WallpaperCropActivity {
@Override
public void onClick(final WallpaperPickerActivity a) {
a.setWallpaperButtonEnabled(false);
- BitmapRegionTileSource.UriBitmapSource bitmapSource =
+ final BitmapRegionTileSource.UriBitmapSource bitmapSource =
new BitmapRegionTileSource.UriBitmapSource(a.getContext(), Uri.fromFile(mFile));
a.setCropViewTileSource(bitmapSource, false, true, null, new Runnable() {
@Override
public void run() {
- a.setWallpaperButtonEnabled(true);
+ if (bitmapSource.getLoadingState() == BitmapSource.State.LOADED) {
+ a.setWallpaperButtonEnabled(true);
+ }
}
});
}
@@ -232,7 +234,7 @@ public class WallpaperPickerActivity extends WallpaperCropActivity {
@Override
public void onClick(final WallpaperPickerActivity a) {
a.setWallpaperButtonEnabled(false);
- BitmapRegionTileSource.ResourceBitmapSource bitmapSource =
+ final BitmapRegionTileSource.ResourceBitmapSource bitmapSource =
new BitmapRegionTileSource.ResourceBitmapSource(mResources, mResId);
a.setCropViewTileSource(bitmapSource, false, false, new CropViewScaleProvider() {
@@ -249,7 +251,9 @@ public class WallpaperPickerActivity extends WallpaperCropActivity {
@Override
public void run() {
- a.setWallpaperButtonEnabled(true);
+ if (bitmapSource.getLoadingState() == BitmapSource.State.LOADED) {
+ a.setWallpaperButtonEnabled(true);
+ }
}
});
}