import android.annotation.TargetApi;
import android.content.ContentResolver;
import android.content.ContentValues;
+import android.content.Context;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
public int rotation;
+ private boolean mUsePanoramaViewer;
+ private boolean mUsePanoramaViewerInitialized;
+
public LocalImage(Path path, GalleryApp application, Cursor cursor) {
super(path, nextVersionNumber());
mApplication = application;
operation |= SUPPORT_SHOW_ON_MAP;
}
- if (LightCycleHelper.isPanorama(filePath) &&
- LightCycleHelper.hasLightCycleView(
- mApplication.getAndroidContext())) {
+ if (usePanoramaViewer()) {
operation |= SUPPORT_VIEW_PANORAMA;
}
return operation;
public String getFilePath() {
return filePath;
}
+
+ @Override
+ public boolean usePanoramaViewer() {
+ if (!mUsePanoramaViewerInitialized) {
+ Context context = mApplication.getAndroidContext();
+ mUsePanoramaViewer = LightCycleHelper.hasLightCycleView(context)
+ && LightCycleHelper.isPanorama(mApplication.getContentResolver(),
+ getContentUri());
+ mUsePanoramaViewerInitialized = true;
+ }
+ return mUsePanoramaViewer;
+ }
}