History log of /frameworks/opt/photoviewer/src/com/android/ex/photo/adapters/PhotoPagerAdapter.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
e36676cf09e0f48164831479a6427f4c9c26a40b 19-Aug-2014 Shri Borde <shri@google.com> Add PhotoPagerAdapter.getContentType api

All the columns are now exposed as an api

Change-Id: I8bdf4f00f8ee8ed9e2d535e49b13399599f74743
/frameworks/opt/photoviewer/src/com/android/ex/photo/adapters/PhotoPagerAdapter.java
bb137c8e2ed363e6f5e2c0f14719483d27e8c062 05-Jun-2014 Mathew Inwood <mathewi@google.com> Move all logic from activity into controller.

Get rid of ControllerCallbacks, and instead create a thin wrapper around
Activity exposing the functionality required from the activity. Do the same
for ActionBar to take care of android.support.v7.app.ActionBar and
android.app.ActionBar (which have an identical interface).

This eliminates a lot of duplicate code between the appcompat activity and
the other activity. The only duplicated code is not boring wrapper code.

To customize the activity now, subclass PhotoViewController and implement
customizations in there. Then subclass the Activity and override
createController to instantiate your controller subclass.

Also allow subclassing of PhotoViewFragment. This is to enable the fragment
to replace the logic of getting the controller from the activity, in the
instance that the activity does not implement ActivityInterface directly
itself.

Bug: 15090270
Change-Id: Ib31ae155b5afabff848624b0721d6eaf96312c12
/frameworks/opt/photoviewer/src/com/android/ex/photo/adapters/PhotoPagerAdapter.java
ca8fdcd23fcc53e0429abf8d4ef80e8d6d8fe6fa 30-Jun-2013 Martin Hibdon <mhibdon@google.com> Update PhotoViewer so that Babel can use it

The photoViewer now supports the needs of the Babel app.
In particular:
1. It allows for applications to extend the PhotoBitmapLoader
for their own needs. Babel needs this because it already
maintains a customized image cache in memory, and we don't
want to have duplicate bitmaps in memory.
2. The photoViewActivity can optionally use an animation
that scales the image up from the image's original location
on screen to the full size.
3. The photoViewActivity can optionally be in fullscreen
mode by default, rather than switching to fullscreen
when tapped.

Change-Id: Id5d62f1961c1ce2b9402c7fb19583baad4d96580
/frameworks/opt/photoviewer/src/com/android/ex/photo/adapters/PhotoPagerAdapter.java
ea8c4b44178e7593870472743bde05d0d079b9ee 21-Feb-2013 Mark Wei <markwei@google.com> Continuously attempt to load thumbnail if it fails the first time. This behavior
is the same as loading the full image.

Bug: 8235723
Change-Id: I2b0786cb7482afe6dd1464be8f54d8f6e810eab8
/frameworks/opt/photoviewer/src/com/android/ex/photo/adapters/PhotoPagerAdapter.java
41db3eb9741a222432b367409c67d2263856a0a7 08-Feb-2013 Vikram Aggarwal <viki@google.com> Let the framework manage fragments

The original crash is deep in the framework. Looking into the code, I
found the following strangeness, which this change fixes:

1. Fragments don't have a public no-arg constructor, which is required
for the framework to restore state.

2. Fragments keep a reference to the adapter, passed through the
constructor. This is a terrible idea: the adapter might get stale,
it might not be tied to the current activity, it can't be parcelled
into a bundle, .... At the very least, the adapter should come
directly via the activity.

3. A lot of computation is happening in onAttach(Activity) which is
too early. At this point, the activity is made, but has not gone
through onCreate() yet, so might be uninitialized. Most of this
code should move to onCreateView() or, even better,
onActivityCreated()

4. The index of the current fragment might still be negative in
onCreate(). This causes problems with the ViewPager when it tries
to load the current fragment from the adapter. We should never set
the current position to -1.

5. The computation for currentPosition is incorrect in
PhotoViewActivity.onCreate(), from a cursory glance at
MessageAttachmentTile.viewAttachment() where both the photo index
and the photo uri are populated at the same time. Once the index
is read, it will be > 0, and the URI won't be set. This is a bug.

These changes ameliorate the original issue, but don't fix it
altogether. The remaining issues will be fixed in a subsequent CL.

Bug: 8143282 PhotoViewerActivity crashes on orientation change

Change-Id: Ia0652b2eea9e976603f0d6686077b9f6a75abb78
/frameworks/opt/photoviewer/src/com/android/ex/photo/adapters/PhotoPagerAdapter.java
934bd9e0b4b3fcf7730325fa416b8c162141f7e9 09-Nov-2012 Martin Hibdon <mhibdon@google.com> Make some members protected

This allows users to extend PhotoViewFragment and
PhotoPagerAdapter.

Change-Id: I7945b33116601fe23f84723f14c76634c2219f52
/frameworks/opt/photoviewer/src/com/android/ex/photo/adapters/PhotoPagerAdapter.java
8746927a945358bb9e515985a37cac7807261026 27-Oct-2012 Martin Hibdon <mhibdon@google.com> Make PhotoViewer use the support library

Now it uses the support library for fragments and loaders,
so it's compatible back to Froyo.

Change-Id: I887dd57760606e22a8376cdfdf3ecf7c99295a61
/frameworks/opt/photoviewer/src/com/android/ex/photo/adapters/PhotoPagerAdapter.java
ae78bbd1c97e702147b29966903ca6e08ed3616f 13-Sep-2012 Adam Copp <adamcopp@google.com> Add option to permenantly show ProgressBar

In order to indicate to the user that more content is loading, the
provider can provide an image with the loading field set and null as it's
url. In this case, we will not try loading any image, and will just show the
ProgressBar.

Something like this is nessecary in Velvet, where we wish to load
infinite images.

Change-Id: Ib26412a579abdbe7fbd338b99ff39f4d1c13f806
/frameworks/opt/photoviewer/src/com/android/ex/photo/adapters/PhotoPagerAdapter.java
91dbfd25cc234de393ae22fc39a832a6335e1bc2 04-Sep-2012 Adam Copp <adamcopp@google.com> Add parameter for max initial scale factor

you can now pass EXTRA_MAX_INITIAL_SCALE into PhotoViewActivity in order
to specify the maximum initial scale of images displayed. This parameter
defaults to 1x if now supplied, so images will not be displayed larger
than their actual size by default.

This allows the gmail team to resolve 7049410 whilst velvet can keep
something like the old behaviour (which is more natural for their app)

Bug: 7049410
Change-Id: I7d230666ca50a4634d8436519ed280cc6e558ee3
/frameworks/opt/photoviewer/src/com/android/ex/photo/adapters/PhotoPagerAdapter.java
e6d03190d2b2ec6ea07a59daa7e687c3c383f9c3 29-Aug-2012 Paul Westbrook <pwestbro@google.com> Fix crash in email with attachments

There isn't a need to call swapCursor in a runnable

Bug: 7072747
Change-Id: I0a0a9b6835acc4a1d1748c94f4d8bec4551638b0
/frameworks/opt/photoviewer/src/com/android/ex/photo/adapters/PhotoPagerAdapter.java
68a16aa04f9b98868f4412e7324b0fc292c9d858 07-Aug-2012 Andrew Sapperstein <asapperstein@google.com> Made title and subtitle not show immediately.

Fixes an issue where we used to show the app title
for an instant before getting the data for the photo.
Now we show nothing until we have the photo data.

Change-Id: I2a77b18af2ec2051848c188e0dad7ca04be4f285
/frameworks/opt/photoviewer/src/com/android/ex/photo/adapters/PhotoPagerAdapter.java
9db663e1e820c3445f57fe11d9a12e9c8777e704 27-Jul-2012 Andrew Sapperstein <asapperstein@google.com> Partial fix of 6890014.

No longer crashing. But the attachment is now
in a very weird state.

Change-Id: If688d9c19a81124cbd1ecd0266821800f76f3c74
/frameworks/opt/photoviewer/src/com/android/ex/photo/adapters/PhotoPagerAdapter.java
928a39fb533255b34145285fabbd4f51961df63a 24-Jul-2012 Andrew Sapperstein <asapperstein@google.com> Support showing previews in the photo viewer.

The photo viewer now supports the notion of a
preview of the full image. The preview is not
pinchable in any manner and displays a circular
progress bar over top of it while we are downloading
the full version of the image.

To enable this functionality, there is a new column
in the PhotoContract API called thumbnailUri. If it is
not set to null and if the attempted load of the contentUri
is unsuccessful, we will attempt to load a thumbnail version
that will show until the contentUri is finished loading.

Change-Id: I5547a5fc6a30ee6a30f137dc1dee76a77fb5b304
/frameworks/opt/photoviewer/src/com/android/ex/photo/adapters/PhotoPagerAdapter.java
0c18e5deef5209d21b527a01feb6b789715eb48e 21-Jul-2012 Andrew Sapperstein <asapperstein@google.com> Reloading bitmaps if cursor updates.

Change-Id: I5624e533d4f35255028cd1a31508dabdb33dfe7f
/frameworks/opt/photoviewer/src/com/android/ex/photo/adapters/PhotoPagerAdapter.java
8122882aaf14820bc2241605b2ab818ad358b9af 27-Jun-2012 Ying Wang <wangying@google.com> Import translations. DO NOT MERGE

Change-Id: Ib683da0aa64c2c63dfc672ea18b7417aded3ec5c
/frameworks/opt/photoviewer/src/com/android/ex/photo/adapters/PhotoPagerAdapter.java