diff options
author | Selim Cinek <cinek@google.com> | 2014-03-21 19:19:08 +0100 |
---|---|---|
committer | Selim Cinek <cinek@google.com> | 2014-03-21 19:19:08 +0100 |
commit | 0fa6c1b146f7ed1aba335c30878e2c1b2bf2a8f1 (patch) | |
tree | 6f014028e49c7fc157fe34f36ebb097aff7bc9fb /packages/WallpaperCropper | |
parent | 863d691efaa92257246598a73af2f581fc991e0a (diff) | |
download | frameworks_base-0fa6c1b146f7ed1aba335c30878e2c1b2bf2a8f1.zip frameworks_base-0fa6c1b146f7ed1aba335c30878e2c1b2bf2a8f1.tar.gz frameworks_base-0fa6c1b146f7ed1aba335c30878e2c1b2bf2a8f1.tar.bz2 |
Disable Set Wallpaper button while loading image
Bug: 13534714
Change-Id: I45ff3436de40ea85fb22d776584d9f30f0795898
Diffstat (limited to 'packages/WallpaperCropper')
-rw-r--r-- | packages/WallpaperCropper/res/layout/actionbar_set_wallpaper.xml | 1 | ||||
-rw-r--r-- | packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/packages/WallpaperCropper/res/layout/actionbar_set_wallpaper.xml b/packages/WallpaperCropper/res/layout/actionbar_set_wallpaper.xml index 1622742..2a0188a 100644 --- a/packages/WallpaperCropper/res/layout/actionbar_set_wallpaper.xml +++ b/packages/WallpaperCropper/res/layout/actionbar_set_wallpaper.xml @@ -20,6 +20,7 @@ <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" style="?android:actionButtonStyle" + android:id="@+id/set_wallpaper_button" android:layout_width="match_parent" android:layout_height="match_parent" > <TextView style="?android:actionBarTabTextStyle" diff --git a/packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java b/packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java index b9b87b1..ae17cf9 100644 --- a/packages/WallpaperCropper/src/com/android/wallpapercropper/WallpaperCropActivity.java +++ b/packages/WallpaperCropper/src/com/android/wallpapercropper/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); } } }; |