import com.android.gallery3d.ui.TileImageViewAdapter;
import com.android.gallery3d.util.Future;
import com.android.gallery3d.util.FutureListener;
+import com.android.gallery3d.util.LightCycleHelper;
import com.android.gallery3d.util.MediaSetUtils;
import com.android.gallery3d.util.ThreadPool;
import com.android.gallery3d.util.ThreadPool.Job;
}
@Override
+ public boolean usePanoramaViewer(int offset) {
+ MediaItem item = getItem(mCurrentIndex + offset);
+ boolean usePanoramaViewer = false;
+ if (item != null) {
+ usePanoramaViewer = LightCycleHelper.isPanorama(item.getFilePath());
+ }
+ return usePanoramaViewer;
+ }
+
+ @Override
public boolean isDeletable(int offset) {
MediaItem item = getItem(mCurrentIndex + offset);
return (item == null)
import com.android.gallery3d.ui.TileImageViewAdapter;
import com.android.gallery3d.util.Future;
import com.android.gallery3d.util.FutureListener;
+import com.android.gallery3d.util.LightCycleHelper;
import com.android.gallery3d.util.ThreadPool;
public class SinglePhotoDataAdapter extends TileImageViewAdapter
}
@Override
+ public boolean usePanoramaViewer(int offset) {
+ return LightCycleHelper.isPanorama(mItem.getFilePath());
+ }
+
+ @Override
public boolean isDeletable(int offset) {
return (mItem.getSupportedOperations() & MediaItem.SUPPORT_DELETE) != 0;
}
// Returns true if the item is the Panorama.
public boolean isPanorama(int offset);
+ // Returns true if the item uses a special panorama viewer
+ public boolean usePanoramaViewer(int offset);
+
// Returns true if the item is a static image that represents camera
// preview.
public boolean isStaticCamera(int offset);
private int mRotation;
private boolean mIsCamera;
private boolean mIsPanorama;
+ private boolean mUsePanoramaViewer;
private boolean mIsStaticCamera;
private boolean mIsVideo;
private boolean mIsDeletable;
mIsCamera = mModel.isCamera(0);
mIsPanorama = mModel.isPanorama(0);
+ mUsePanoramaViewer = mModel.usePanoramaViewer(0);
mIsStaticCamera = mModel.isStaticCamera(0);
mIsVideo = mModel.isVideo(0);
mIsDeletable = mModel.isDeletable(0);
// Draw the play video icon and the message.
canvas.translate((int) (cx + 0.5f), (int) (cy + 0.5f));
int s = (int) (scale * Math.min(r.width(), r.height()) + 0.5f);
- if (mIsVideo) drawVideoPlayIcon(canvas, s);
+ if (mIsVideo || mUsePanoramaViewer) drawVideoPlayIcon(canvas, s);
if (mLoadingState == Model.LOADING_FAIL) {
drawLoadingFailMessage(canvas);
}
private ScreenNail mScreenNail;
private boolean mIsCamera;
private boolean mIsPanorama;
+ private boolean mUsePanoramaViewer;
private boolean mIsStaticCamera;
private boolean mIsVideo;
private boolean mIsDeletable;
public void reload() {
mIsCamera = mModel.isCamera(mIndex);
mIsPanorama = mModel.isPanorama(mIndex);
+ mUsePanoramaViewer = mModel.usePanoramaViewer(mIndex);
mIsStaticCamera = mModel.isStaticCamera(mIndex);
mIsVideo = mModel.isVideo(mIndex);
mIsDeletable = mModel.isDeletable(mIndex);
invalidate();
}
int s = Math.min(drawW, drawH);
- if (mIsVideo) drawVideoPlayIcon(canvas, s);
+ if (mIsVideo || mUsePanoramaViewer) drawVideoPlayIcon(canvas, s);
if (mLoadingState == Model.LOADING_FAIL) {
drawLoadingFailMessage(canvas);
}