summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Haeberling <haeberling@google.com>2012-10-15 18:28:42 -0700
committerSascha Haeberling <haeberling@google.com>2012-10-17 11:22:03 -0700
commite3b50f1bfcfa5c8729f31788eac1a6109a88988b (patch)
tree5c1a337a023de93b78b647493953f82d7351ab0e
parent3038d014b7ade998d1820c997242b9d9d8bc7ccf (diff)
downloadandroid_packages_apps_Gallery2-e3b50f1bfcfa5c8729f31788eac1a6109a88988b.tar.gz
android_packages_apps_Gallery2-e3b50f1bfcfa5c8729f31788eac1a6109a88988b.tar.bz2
android_packages_apps_Gallery2-e3b50f1bfcfa5c8729f31788eac1a6109a88988b.zip
Adds GMS Core PanoramaClient to Gallery
Bug: 7319099 Also updates the API call to LightCycleHelper. This depends on http://go/ag/#/c/239523/ Change-Id: Ie951e44e3a474599d1da6fea52609fbb9f8dc9bc
-rw-r--r--src/com/android/gallery3d/app/AbstractGalleryActivity.java10
-rw-r--r--src/com/android/gallery3d/app/PhotoPage.java9
-rw-r--r--src_pd/com/android/gallery3d/util/LightCycleHelper.java28
3 files changed, 40 insertions, 7 deletions
diff --git a/src/com/android/gallery3d/app/AbstractGalleryActivity.java b/src/com/android/gallery3d/app/AbstractGalleryActivity.java
index cb3aa9d0a..76649cab4 100644
--- a/src/com/android/gallery3d/app/AbstractGalleryActivity.java
+++ b/src/com/android/gallery3d/app/AbstractGalleryActivity.java
@@ -41,6 +41,7 @@ import com.android.gallery3d.data.MediaItem;
import com.android.gallery3d.ui.GLRoot;
import com.android.gallery3d.ui.GLRootView;
import com.android.gallery3d.util.ThreadPool;
+import com.android.gallery3d.util.LightCycleHelper.PanoramaViewHelper;
public class AbstractGalleryActivity extends Activity implements GalleryContext {
@SuppressWarnings("unused")
@@ -51,6 +52,7 @@ public class AbstractGalleryActivity extends Activity implements GalleryContext
private OrientationManager mOrientationManager;
private TransitionStore mTransitionStore = new TransitionStore();
private boolean mDisableToggleStatusBar;
+ private PanoramaViewHelper mPanoramaViewHelper;
private AlertDialog mAlertDialog = null;
private BroadcastReceiver mMountReceiver = new BroadcastReceiver() {
@@ -67,6 +69,8 @@ public class AbstractGalleryActivity extends Activity implements GalleryContext
mOrientationManager = new OrientationManager(this);
toggleStatusBarByOrientation();
getWindow().setBackgroundDrawable(null);
+ mPanoramaViewHelper = new PanoramaViewHelper(this);
+ mPanoramaViewHelper.onCreate();
}
@Override
@@ -168,6 +172,7 @@ public class AbstractGalleryActivity extends Activity implements GalleryContext
mAlertDialog = builder.show();
registerReceiver(mMountReceiver, mMountFilter);
}
+ mPanoramaViewHelper.onStart();
}
@TargetApi(ApiHelper.VERSION_CODES.HONEYCOMB)
@@ -184,6 +189,7 @@ public class AbstractGalleryActivity extends Activity implements GalleryContext
mAlertDialog.dismiss();
mAlertDialog = null;
}
+ mPanoramaViewHelper.onStop();
}
@Override
@@ -293,4 +299,8 @@ public class AbstractGalleryActivity extends Activity implements GalleryContext
public TransitionStore getTransitionStore() {
return mTransitionStore;
}
+
+ public PanoramaViewHelper getPanoramaViewHelper() {
+ return mPanoramaViewHelper;
+ }
}
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java
index 413167fbb..169303c66 100644
--- a/src/com/android/gallery3d/app/PhotoPage.java
+++ b/src/com/android/gallery3d/app/PhotoPage.java
@@ -72,8 +72,8 @@ import com.android.gallery3d.ui.PhotoFallbackEffect;
import com.android.gallery3d.ui.PhotoView;
import com.android.gallery3d.ui.SelectionManager;
import com.android.gallery3d.ui.SynchronizedHandler;
+import com.android.gallery3d.ui.TiledScreenNail;
import com.android.gallery3d.util.GalleryUtils;
-import com.android.gallery3d.util.LightCycleHelper;
public class PhotoPage extends ActivityState implements
PhotoView.Listener, OrientationManager.Listener, AppBridge.Server,
@@ -527,6 +527,7 @@ public class PhotoPage extends ActivityState implements
}
}
+ @Override
public void onPictureCenter(boolean isCamera) {
mPhotoView.setWantPictureCenterCallbacks(false);
mHandler.removeMessages(MSG_ON_CAMERA_CENTER);
@@ -534,10 +535,12 @@ public class PhotoPage extends ActivityState implements
mHandler.sendEmptyMessage(isCamera ? MSG_ON_CAMERA_CENTER : MSG_ON_PICTURE_CENTER);
}
+ @Override
public boolean canDisplayBottomControls() {
return mIsActive && !mPhotoView.getFilmMode();
}
+ @Override
public boolean canDisplayBottomControl(int control) {
if (mCurrentPhoto == null) return false;
switch(control) {
@@ -555,6 +558,7 @@ public class PhotoPage extends ActivityState implements
}
}
+ @Override
public void onBottomControlClicked(int control) {
switch(control) {
case R.id.photopage_bottom_control_edit:
@@ -562,7 +566,8 @@ public class PhotoPage extends ActivityState implements
return;
case R.id.photopage_bottom_control_panorama:
mRecenterCameraOnResume = false;
- LightCycleHelper.viewPanorama(mActivity, mCurrentPhoto.getContentUri());
+ mActivity.getPanoramaViewHelper()
+ .showPanorama(mCurrentPhoto.getContentUri());
return;
default:
return;
diff --git a/src_pd/com/android/gallery3d/util/LightCycleHelper.java b/src_pd/com/android/gallery3d/util/LightCycleHelper.java
index 995eac8b1..6ebd9eca2 100644
--- a/src_pd/com/android/gallery3d/util/LightCycleHelper.java
+++ b/src_pd/com/android/gallery3d/util/LightCycleHelper.java
@@ -17,7 +17,6 @@
package com.android.gallery3d.util;
import android.app.Activity;
-import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
@@ -39,6 +38,29 @@ public class LightCycleHelper {
}
}
+ public static class PanoramaViewHelper {
+
+ public PanoramaViewHelper(Activity activity) {
+ /* Do nothing */
+ }
+
+ public void onStart() {
+ /* Do nothing */
+ }
+
+ public void onCreate() {
+ /* Do nothing */
+ }
+
+ public void onStop() {
+ /* Do nothing */
+ }
+
+ public void showPanorama(Uri uri) {
+ /* Do nothing */
+ }
+ }
+
public static void setupCaptureIntent(Context context, Intent it, String outputDir) {
/* Do nothing */
}
@@ -47,10 +69,6 @@ public class LightCycleHelper {
return false;
}
- public static void viewPanorama(Activity activity, Uri uri) {
- /* Do nothing */
- }
-
public static PanoramaMetadata getPanoramaMetadata(Context context, Uri uri) {
return null;
}