Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
packages_apps_Gallery2
Commits
f8a39c64
Commit
f8a39c64
authored
12 years ago
by
George Mount
Committed by
Android (Google) Code Review
12 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Add UriImage support for viewing LightCycle panoramas.
Change-Id: I7f61cef39370fd23b9481708dc3c902c17873074
parent
17ac550d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
47 additions
and
11 deletions
+47
-11
src/com/android/gallery3d/app/PhotoDataAdapter.java
src/com/android/gallery3d/app/PhotoDataAdapter.java
+1
-2
src/com/android/gallery3d/app/PhotoPage.java
src/com/android/gallery3d/app/PhotoPage.java
+1
-3
src/com/android/gallery3d/app/SinglePhotoDataAdapter.java
src/com/android/gallery3d/app/SinglePhotoDataAdapter.java
+1
-1
src/com/android/gallery3d/data/LocalImage.java
src/com/android/gallery3d/data/LocalImage.java
+17
-3
src/com/android/gallery3d/data/MediaItem.java
src/com/android/gallery3d/data/MediaItem.java
+4
-0
src/com/android/gallery3d/data/UriImage.java
src/com/android/gallery3d/data/UriImage.java
+19
-0
src_pd/com/android/gallery3d/util/LightCycleHelper.java
src_pd/com/android/gallery3d/util/LightCycleHelper.java
+4
-2
No files found.
src/com/android/gallery3d/app/PhotoDataAdapter.java
View file @
f8a39c64
...
...
@@ -37,7 +37,6 @@ import com.android.gallery3d.ui.SynchronizedHandler;
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
;
...
...
@@ -482,7 +481,7 @@ public class PhotoDataAdapter implements PhotoPage.Model {
MediaItem
item
=
getItem
(
mCurrentIndex
+
offset
);
boolean
usePanoramaViewer
=
false
;
if
(
item
!=
null
)
{
usePanoramaViewer
=
LightCycleHelper
.
isPanorama
(
item
.
getFilePath
()
);
usePanoramaViewer
=
item
.
usePanoramaViewer
(
);
}
return
usePanoramaViewer
;
}
...
...
This diff is collapsed.
Click to expand it.
src/com/android/gallery3d/app/PhotoPage.java
View file @
f8a39c64
...
...
@@ -45,7 +45,6 @@ import com.android.gallery3d.common.ApiHelper;
import
com.android.gallery3d.common.Utils
;
import
com.android.gallery3d.data.DataManager
;
import
com.android.gallery3d.data.FilterDeleteSet
;
import
com.android.gallery3d.data.LocalImage
;
import
com.android.gallery3d.data.MediaDetails
;
import
com.android.gallery3d.data.MediaItem
;
import
com.android.gallery3d.data.MediaObject
;
...
...
@@ -887,8 +886,7 @@ public class PhotoPage extends ActivityState implements
if
(
playVideo
)
{
playVideo
(
mActivity
,
item
.
getPlayUri
(),
item
.
getName
());
}
else
if
(
viewPanorama
)
{
LocalImage
img
=
(
LocalImage
)
item
;
LightCycleHelper
.
viewPanorama
(
mActivity
,
img
.
getFilePath
());
LightCycleHelper
.
viewPanorama
(
mActivity
,
item
.
getContentUri
());
}
else
{
toggleBars
();
}
...
...
This diff is collapsed.
Click to expand it.
src/com/android/gallery3d/app/SinglePhotoDataAdapter.java
View file @
f8a39c64
...
...
@@ -218,7 +218,7 @@ public class SinglePhotoDataAdapter extends TileImageViewAdapter
@Override
public
boolean
usePanoramaViewer
(
int
offset
)
{
return
LightCycleHelper
.
isPanorama
(
mItem
.
getFilePath
()
);
return
mItem
.
usePanoramaViewer
(
);
}
@Override
...
...
This diff is collapsed.
Click to expand it.
src/com/android/gallery3d/data/LocalImage.java
View file @
f8a39c64
...
...
@@ -19,6 +19,7 @@ package com.android.gallery3d.data;
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
;
...
...
@@ -99,6 +100,9 @@ public class LocalImage extends LocalMediaItem {
public
int
rotation
;
private
boolean
mUsePanoramaViewer
;
private
boolean
mUsePanoramaViewerInitialized
;
public
LocalImage
(
Path
path
,
GalleryApp
application
,
Cursor
cursor
)
{
super
(
path
,
nextVersionNumber
());
mApplication
=
application
;
...
...
@@ -241,9 +245,7 @@ public class LocalImage extends LocalMediaItem {
operation
|=
SUPPORT_SHOW_ON_MAP
;
}
if
(
LightCycleHelper
.
isPanorama
(
filePath
)
&&
LightCycleHelper
.
hasLightCycleView
(
mApplication
.
getAndroidContext
()))
{
if
(
usePanoramaViewer
())
{
operation
|=
SUPPORT_VIEW_PANORAMA
;
}
return
operation
;
...
...
@@ -343,4 +345,16 @@ public class LocalImage extends LocalMediaItem {
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
;
}
}
This diff is collapsed.
Click to expand it.
src/com/android/gallery3d/data/MediaItem.java
View file @
f8a39c64
...
...
@@ -107,6 +107,10 @@ public abstract class MediaItem extends MediaObject {
return
""
;
}
public
boolean
usePanoramaViewer
()
{
return
false
;
}
// Returns width and height of the media item.
// Returns 0, 0 if the information is not available.
public
abstract
int
getWidth
();
...
...
This diff is collapsed.
Click to expand it.
src/com/android/gallery3d/data/UriImage.java
View file @
f8a39c64
...
...
@@ -17,6 +17,7 @@
package
com.android.gallery3d.data
;
import
android.content.ContentResolver
;
import
android.content.Context
;
import
android.graphics.Bitmap
;
import
android.graphics.Bitmap.Config
;
import
android.graphics.BitmapFactory.Options
;
...
...
@@ -27,6 +28,7 @@ import android.os.ParcelFileDescriptor;
import
com.android.gallery3d.app.GalleryApp
;
import
com.android.gallery3d.common.BitmapUtils
;
import
com.android.gallery3d.common.Utils
;
import
com.android.gallery3d.util.LightCycleHelper
;
import
com.android.gallery3d.util.ThreadPool.CancelListener
;
import
com.android.gallery3d.util.ThreadPool.Job
;
import
com.android.gallery3d.util.ThreadPool.JobContext
;
...
...
@@ -54,6 +56,8 @@ public class UriImage extends MediaItem {
private
int
mWidth
;
private
int
mHeight
;
private
int
mRotation
;
private
boolean
mUsePanoramaViewer
;
private
boolean
mUsePanoramaViewerInitialized
;
private
GalleryApp
mApplication
;
...
...
@@ -214,6 +218,9 @@ public class UriImage extends MediaItem {
if
(
BitmapUtils
.
isSupportedByRegionDecoder
(
mContentType
))
{
supported
|=
SUPPORT_FULL_IMAGE
;
}
if
(
usePanoramaViewer
())
{
supported
|=
SUPPORT_VIEW_PANORAMA
;
}
return
supported
;
}
...
...
@@ -283,4 +290,16 @@ public class UriImage extends MediaItem {
public
int
getRotation
()
{
return
mRotation
;
}
@Override
public
boolean
usePanoramaViewer
()
{
if
(!
mUsePanoramaViewerInitialized
)
{
Context
context
=
mApplication
.
getAndroidContext
();
mUsePanoramaViewer
=
LightCycleHelper
.
hasLightCycleView
(
context
)
&&
LightCycleHelper
.
isPanorama
(
mApplication
.
getContentResolver
(),
getContentUri
());
mUsePanoramaViewerInitialized
=
true
;
}
return
mUsePanoramaViewer
;
}
}
This diff is collapsed.
Click to expand it.
src_pd/com/android/gallery3d/util/LightCycleHelper.java
View file @
f8a39c64
...
...
@@ -17,8 +17,10 @@
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
;
import
com.android.camera.CameraModule
;
...
...
@@ -36,11 +38,11 @@ public class LightCycleHelper {
return
false
;
}
public
static
void
viewPanorama
(
Activity
activity
,
String
filePath
)
{
public
static
void
viewPanorama
(
Activity
activity
,
Uri
uri
)
{
/* Do nothing */
}
public
static
boolean
isPanorama
(
String
filename
)
{
public
static
boolean
isPanorama
(
ContentResolver
contentResolver
,
Uri
uri
)
{
return
false
;
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment