summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);
+ }
}
});
}