<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"
protected CropView mCropView;
protected Uri mUri;
+ private View mSetWallpaperButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
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) {
getString(R.string.wallpaper_load_fail),
Toast.LENGTH_LONG).show();
finish();
+ } else {
+ mSetWallpaperButton.setVisibility(View.VISIBLE);
}
}
};