diff options
| author | John Reck <jreck@google.com> | 2013-01-29 01:35:38 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-01-29 01:35:38 +0000 |
| commit | d0f8807ca66b006e4049e32ad187a808c42e1f00 (patch) | |
| tree | 6aa8b75d1c528b440ad1ce16792214a7c5dae742 /src | |
| parent | 2251adcd841d597eb6673fc6d2810979753ceb73 (diff) | |
| parent | 10dbc7c56452f19fc3f9e54d9d060feea1e6767a (diff) | |
| download | android_packages_apps_Gallery2-d0f8807ca66b006e4049e32ad187a808c42e1f00.tar.gz android_packages_apps_Gallery2-d0f8807ca66b006e4049e32ad187a808c42e1f00.tar.bz2 android_packages_apps_Gallery2-d0f8807ca66b006e4049e32ad187a808c42e1f00.zip | |
Merge "Launching gallery shows browse ui on canvas" into gb-ub-photos-bryce
Diffstat (limited to 'src')
| -rw-r--r-- | src/com/android/gallery3d/app/Gallery.java | 5 | ||||
| -rw-r--r-- | src/com/android/gallery3d/provider/CanvasProvider.java | 16 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/app/Gallery.java b/src/com/android/gallery3d/app/Gallery.java index baef56b44..f847f2f39 100644 --- a/src/com/android/gallery3d/app/Gallery.java +++ b/src/com/android/gallery3d/app/Gallery.java @@ -37,6 +37,7 @@ import com.android.gallery3d.data.MediaItem; import com.android.gallery3d.data.MediaSet; import com.android.gallery3d.data.Path; import com.android.gallery3d.picasasource.PicasaSource; +import com.android.gallery3d.provider.CanvasProvider; import com.android.gallery3d.util.GalleryUtils; public final class Gallery extends AbstractGalleryActivity implements OnCancelListener { @@ -100,6 +101,10 @@ public final class Gallery extends AbstractGalleryActivity implements OnCancelLi } public void startDefaultPage() { + if (CanvasProvider.startBrowseActivity(this)) { + finish(); + return; + } PicasaSource.showSignInReminder(this); Bundle data = new Bundle(); data.putString(AlbumSetPage.KEY_MEDIA_PATH, diff --git a/src/com/android/gallery3d/provider/CanvasProvider.java b/src/com/android/gallery3d/provider/CanvasProvider.java index 86c72fb3c..95c02dc7a 100644 --- a/src/com/android/gallery3d/provider/CanvasProvider.java +++ b/src/com/android/gallery3d/provider/CanvasProvider.java @@ -16,11 +16,14 @@ package com.android.gallery3d.provider; +import android.app.Activity; +import android.content.ActivityNotFoundException; import android.content.ContentProvider; import android.content.ContentResolver; import android.content.ContentValues; import android.content.Intent; import android.content.UriMatcher; +import android.content.res.Configuration; import android.database.Cursor; import android.database.MatrixCursor; import android.graphics.Bitmap; @@ -657,4 +660,17 @@ public class CanvasProvider extends ContentProvider { throw new UnsupportedOperationException("Update not supported"); } + // TODO: Remove once b/8079561 is resolved + public static boolean startBrowseActivity(Activity activity) { + Configuration config = activity.getResources().getConfiguration(); + if (config.touchscreen == Configuration.TOUCHSCREEN_NOTOUCH) { + try { + Intent intent = CanvasContract.getBrowseIntent(BROWSER_ROOT_URI, 0); + activity.startActivity(intent); + return true; + } catch (ActivityNotFoundException ex) {} + } + return false; + } + } |
