diff options
author | Tony Wickham <twickham@google.com> | 2016-03-29 00:01:13 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2016-03-29 00:01:13 +0000 |
commit | 159b638ed8c652b2943e3b05ea70f8b43ee73d72 (patch) | |
tree | d30c270d1078dd4f4da19ff740e80ee349bb487d | |
parent | f2584527086576e1398e643c8a83ace1fd1d02f4 (diff) | |
parent | 87dfda9c26d355b8a3c735c2948608be65165033 (diff) | |
download | android_packages_apps_WallpaperPicker-159b638ed8c652b2943e3b05ea70f8b43ee73d72.tar.gz android_packages_apps_WallpaperPicker-159b638ed8c652b2943e3b05ea70f8b43ee73d72.tar.bz2 android_packages_apps_WallpaperPicker-159b638ed8c652b2943e3b05ea70f8b43ee73d72.zip |
Merge "Disable "Set wallpaper" action bar when no tile is selected." into ub-launcher3-calgary
-rw-r--r-- | res/layout/actionbar_set_wallpaper.xml | 3 | ||||
-rw-r--r-- | src/com/android/wallpaperpicker/WallpaperPickerActivity.java | 10 |
2 files changed, 7 insertions, 6 deletions
diff --git a/res/layout/actionbar_set_wallpaper.xml b/res/layout/actionbar_set_wallpaper.xml index a8f1a6e..459f221 100644 --- a/res/layout/actionbar_set_wallpaper.xml +++ b/res/layout/actionbar_set_wallpaper.xml @@ -28,4 +28,5 @@ android:drawableLeft="@drawable/ic_actionbar_accept" android:drawablePadding="8dp" android:gravity="start|center_vertical" - android:text="@string/wallpaper_instructions" /> + android:text="@string/wallpaper_instructions" + android:enabled="false" /> diff --git a/src/com/android/wallpaperpicker/WallpaperPickerActivity.java b/src/com/android/wallpaperpicker/WallpaperPickerActivity.java index 094d3ce..f303f93 100644 --- a/src/com/android/wallpaperpicker/WallpaperPickerActivity.java +++ b/src/com/android/wallpaperpicker/WallpaperPickerActivity.java @@ -202,7 +202,7 @@ public class WallpaperPickerActivity extends WallpaperCropActivity new View.OnClickListener() { @Override public void onClick(View v) { - // Ensure that a tile is slelected and loaded. + // Ensure that a tile is selected and loaded. if (mSelectedTile != null && mCropView.getTileSource() != null) { // Prevent user from selecting any new tile. mWallpaperStrip.setVisibility(View.GONE); @@ -211,9 +211,9 @@ public class WallpaperPickerActivity extends WallpaperCropActivity WallpaperTileInfo info = (WallpaperTileInfo) mSelectedTile.getTag(); info.onSave(WallpaperPickerActivity.this); } else { - // no tile was selected, so we just finish the activity and go back - setResult(Activity.RESULT_OK); - finish(); + // This case shouldn't be possible, since "Set wallpaper" is disabled + // until user clicks on a title. + Log.w(TAG, "\"Set wallpaper\" was clicked when no tile was selected"); } } }); @@ -232,10 +232,10 @@ public class WallpaperPickerActivity extends WallpaperCropActivity } return; } - setWallpaperButtonEnabled(true); WallpaperTileInfo info = (WallpaperTileInfo) v.getTag(); if (info.isSelectable() && v.getVisibility() == View.VISIBLE) { selectTile(v); + setWallpaperButtonEnabled(true); } info.onClick(this); } |