aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorge Ruesga <jorge@ruesga.com>2014-09-23 22:25:08 (GMT)
committerJorge Ruesga <jorge@ruesga.com>2014-09-23 22:25:08 (GMT)
commit7df02080e5a533d95dff00695d6945495ea1ea66 (patch)
tree6d1350be61cb2830f37f41a24541aadaef88b4ad
parent9cac29da38337785e97efda5fbce7e70754b3c44 (diff)
downloadandroid_packages_wallpapers_PhotoPhase-7df02080e5a533d95dff00695d6945495ea1ea66.zip
android_packages_wallpapers_PhotoPhase-7df02080e5a533d95dff00695d6945495ea1ea66.tar.gz
android_packages_wallpapers_PhotoPhase-7df02080e5a533d95dff00695d6945495ea1ea66.tar.bz2
photophase: prevent user to operation while album adapter is still in load progress
Change-Id: I783de9a8ec072e4d8d2d27fa9dc9c5c482eb2196 Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
-rw-r--r--src/org/cyanogenmod/wallpapers/photophase/preferences/ChoosePicturesFragment.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/org/cyanogenmod/wallpapers/photophase/preferences/ChoosePicturesFragment.java b/src/org/cyanogenmod/wallpapers/photophase/preferences/ChoosePicturesFragment.java
index 30424a6..f83c392 100644
--- a/src/org/cyanogenmod/wallpapers/photophase/preferences/ChoosePicturesFragment.java
+++ b/src/org/cyanogenmod/wallpapers/photophase/preferences/ChoosePicturesFragment.java
@@ -156,6 +156,13 @@ public class ChoosePicturesFragment extends PreferenceFragment
@Override
protected void onPostExecute(Void result) {
mAlbumAdapter.notifyDataSetChanged();
+
+ if (mRestoreMenuItem != null) {
+ mRestoreMenuItem.setVisible(true);
+ }
+ if (mInvertMenuItem != null) {
+ mInvertMenuItem.setVisible(true);
+ }
}
/**
@@ -279,6 +286,9 @@ public class ChoosePicturesFragment extends PreferenceFragment
boolean mShowingAlbums;
+ MenuItem mRestoreMenuItem;
+ MenuItem mInvertMenuItem;
+
/**
* {@inheritDoc}
*/
@@ -428,6 +438,14 @@ public class ChoosePicturesFragment extends PreferenceFragment
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
inflater.inflate(R.menu.albums, menu);
+ mRestoreMenuItem = menu.findItem(R.id.mnu_restore);
+ mInvertMenuItem = menu.findItem(R.id.mnu_invert);
+ if (mRestoreMenuItem != null) {
+ mRestoreMenuItem.setVisible(false);
+ }
+ if (mInvertMenuItem != null) {
+ mInvertMenuItem.setVisible(false);
+ }
}
/**