summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/app/Gallery.java
diff options
context:
space:
mode:
authorOwen Lin <owenlin@google.com>2011-11-24 11:59:52 +0800
committerOwen Lin <owenlin@google.com>2011-11-24 21:07:04 +0800
commitc74fa8c2e8aee1649547447d42e523a3fb39c7ec (patch)
tree48d798a1d2fbfacfd17d2033dcd8bf9ece19479f /src/com/android/gallery3d/app/Gallery.java
parentef71b24dbf31f73e6df8ae15ac2a1ad1cbc255f6 (diff)
downloadandroid_packages_apps_Snap-c74fa8c2e8aee1649547447d42e523a3fb39c7ec.tar.gz
android_packages_apps_Snap-c74fa8c2e8aee1649547447d42e523a3fb39c7ec.tar.bz2
android_packages_apps_Snap-c74fa8c2e8aee1649547447d42e523a3fb39c7ec.zip
Show a dialog to require updating PlusOne.
Change-Id: I1ff4f5eca90ade49b0785324b9319ef0b7d751ca fix: 5608342
Diffstat (limited to 'src/com/android/gallery3d/app/Gallery.java')
-rw-r--r--src/com/android/gallery3d/app/Gallery.java28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/com/android/gallery3d/app/Gallery.java b/src/com/android/gallery3d/app/Gallery.java
index ebfa98495..253af2bbb 100644
--- a/src/com/android/gallery3d/app/Gallery.java
+++ b/src/com/android/gallery3d/app/Gallery.java
@@ -16,7 +16,10 @@
package com.android.gallery3d.app;
+import android.app.Dialog;
import android.content.ContentResolver;
+import android.content.DialogInterface;
+import android.content.DialogInterface.OnCancelListener;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
@@ -35,7 +38,7 @@ import com.android.gallery3d.picasasource.PicasaSource;
import com.android.gallery3d.ui.GLRoot;
import com.android.gallery3d.util.GalleryUtils;
-public final class Gallery extends AbstractGalleryActivity {
+public final class Gallery extends AbstractGalleryActivity implements OnCancelListener {
public static final String EXTRA_SLIDESHOW = "slideshow";
public static final String EXTRA_CROP = "crop";
@@ -47,6 +50,7 @@ public final class Gallery extends AbstractGalleryActivity {
private static final String TAG = "Gallery";
private GalleryActionBar mActionBar;
+ private Dialog mVersionCheckDialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -96,6 +100,10 @@ public final class Gallery extends AbstractGalleryActivity {
data.putString(AlbumSetPage.KEY_MEDIA_PATH,
getDataManager().getTopSetPath(DataManager.INCLUDE_ALL));
getStateManager().startState(AlbumSetPage.class, data);
+ mVersionCheckDialog = PicasaSource.getVersionCheckDialog(this);
+ if (mVersionCheckDialog != null) {
+ mVersionCheckDialog.setOnCancelListener(this);
+ }
}
private void startGetContent(Intent intent) {
@@ -243,10 +251,28 @@ public final class Gallery extends AbstractGalleryActivity {
protected void onResume() {
Utils.assertTrue(getStateManager().getStateCount() > 0);
super.onResume();
+ if (mVersionCheckDialog != null) {
+ mVersionCheckDialog.show();
+ }
+ }
+
+ @Override
+ protected void onPause() {
+ super.onPause();
+ if (mVersionCheckDialog != null) {
+ mVersionCheckDialog.dismiss();
+ }
}
@Override
public GalleryActionBar getGalleryActionBar() {
return mActionBar;
}
+
+ @Override
+ public void onCancel(DialogInterface dialog) {
+ if (dialog == mVersionCheckDialog) {
+ mVersionCheckDialog = null;
+ }
+ }
}