summaryrefslogtreecommitdiffstats
path: root/WallpaperPicker/src/com
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2014-01-16 14:58:00 +0100
committerDanesh M <daneshm90@gmail.com>2014-06-06 22:54:27 -0700
commit96985337f31b818aab7b0ec23a0751bc06c3f622 (patch)
tree0b7ee32884ddfc997b49a9dfc824cab992ac55d1 /WallpaperPicker/src/com
parent4aa39f0056f6749e73bfedb486cc713025a6e5ba (diff)
downloadandroid_packages_apps_Trebuchet-96985337f31b818aab7b0ec23a0751bc06c3f622.zip
android_packages_apps_Trebuchet-96985337f31b818aab7b0ec23a0751bc06c3f622.tar.gz
android_packages_apps_Trebuchet-96985337f31b818aab7b0ec23a0751bc06c3f622.tar.bz2
Disable Set Wallpaper button while loading image
Bug: 12472111 Change-Id: I2a0cba47f31af2416b0dd062929f277fcbf80481
Diffstat (limited to 'WallpaperPicker/src/com')
-rw-r--r--WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java5
-rw-r--r--WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java4
2 files changed, 9 insertions, 0 deletions
diff --git a/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java b/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java
index ee7b819..96c9723 100644
--- a/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java
+++ b/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java
@@ -75,6 +75,7 @@ public class WallpaperCropActivity extends Activity {
protected CropView mCropView;
protected Uri mUri;
+ private View mSetWallpaperButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -111,10 +112,12 @@ public class WallpaperCropActivity extends Activity {
cropImageAndSetWallpaper(imageUri, null, finishActivityWhenDone);
}
});
+ mSetWallpaperButton = findViewById(R.id.set_wallpaper_button);
// Load image in background
final BitmapRegionTileSource.UriBitmapSource bitmapSource =
new BitmapRegionTileSource.UriBitmapSource(this, imageUri, 1024);
+ mSetWallpaperButton.setVisibility(View.INVISIBLE);
Runnable onLoad = new Runnable() {
public void run() {
if (bitmapSource.getLoadingState() != BitmapSource.State.LOADED) {
@@ -122,6 +125,8 @@ public class WallpaperCropActivity extends Activity {
getString(R.string.wallpaper_load_fail),
Toast.LENGTH_LONG).show();
finish();
+ } else {
+ mSetWallpaperButton.setVisibility(View.VISIBLE);
}
}
};
diff --git a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java
index 5f4e2fc..2879665 100644
--- a/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java
+++ b/WallpaperPicker/src/com/android/launcher3/WallpaperPickerActivity.java
@@ -94,6 +94,7 @@ public class WallpaperPickerActivity extends WallpaperCropActivity {
private View mSelectedTile;
+ private View mSetWallpaperButton;
private boolean mIgnoreNextTap;
private OnClickListener mThumbnailOnClickListener;
@@ -150,11 +151,13 @@ public class WallpaperPickerActivity extends WallpaperCropActivity {
onLoad = null;
} else {
mFirstClick = false;
+ a.mSetWallpaperButton.setVisibility(View.INVISIBLE);
onLoad = new Runnable() {
public void run() {
if (mBitmapSource != null &&
mBitmapSource.getLoadingState() == BitmapSource.State.LOADED) {
a.selectTile(mView);
+ a.mSetWallpaperButton.setVisibility(View.VISIBLE);
} else {
ViewGroup parent = (ViewGroup) mView.getParent();
if (parent != null) {
@@ -470,6 +473,7 @@ public class WallpaperPickerActivity extends WallpaperCropActivity {
}
}
});
+ mSetWallpaperButton = findViewById(R.id.set_wallpaper_button);
// CAB for deleting items
mActionModeCallback = new ActionMode.Callback() {