History log of /frameworks/opt/photoviewer/src/com/android/ex/photo/PhotoViewActivity.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
efd51fc103301ca5e6e6eb3825623f50d0497b62 18-Mar-2013 Adam Copp <adamcopp@google.com> Always set ViewPager adapter immediately.

This appears to be an oversight and may be causing b/8270164.

Change-Id: I840a79d28c55d478a1182059b057da092947720b
/frameworks/opt/photoviewer/src/com/android/ex/photo/PhotoViewActivity.java
8e97065f7cfb2ff7c6b3bde13bf19c23b0358ee4 15-Feb-2013 Paul Westbrook <pwestbro@google.com> Merge branch 'goog/jb-ub-mail-ur8' into master

Change-Id: Ie28475b31bb0d5d214c948c498d88e540d6f93a9
b98521a8db7157b8982515670345bec69c10e0e2 08-Feb-2013 Vikram Aggarwal <viki@google.com> Merge "Let the framework manage fragments" into jb-ub-mail-ur8
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/PhotoViewActivity.java
7b2d2778159adf9d01e5e7fc5371e49850b2e084 06-Feb-2013 Vikram Aggarwal <viki@google.com> Save/Restore Actionbar title

In rare cases, we cannot restore the actionbar title in the photo
viewer because we require the fragment to be visible on the screen to
update the title.

Since this is a rather rare problem, the easiest fix is to save the
actionbar title to a bundle and restore it on orientation changes.

Bug: 8124251 Action bar text for the attachment disappears on
orientation change

Change-Id: I27b2768b3e7edb18e1ddd272f48a3ad8ebdd408a
/frameworks/opt/photoviewer/src/com/android/ex/photo/PhotoViewActivity.java
79bc0d5ba2f06b25052fe95fac1593ebde234d9a 23-Jan-2013 Mark Wei <markwei@google.com> Starts a pending download immediately when swiping to that image.

Add a new Attachment state, PAUSED, for when we've queued the attachment in the
DownloadManager, but it hasn't started yet.

Modified onViewActivated() so it would only get triggered once when you swipe to
that fragment.

Bug: 8023818
Change-Id: I319f12235559feb1f716515155881188894d6f05
/frameworks/opt/photoviewer/src/com/android/ex/photo/PhotoViewActivity.java
f766f358fa68de426e013df10930701682ae356c 24-Jan-2013 Martin Hibdon <mhibdon@google.com> Allow the use of any fragment instead of a PhotoViewFragment

This lets other users build their own photoViewFragment

Change-Id: I7c915b7ed3ccdadf00bc9e46c7a686cb0146188f
/frameworks/opt/photoviewer/src/com/android/ex/photo/PhotoViewActivity.java
0bf849421d303e05c600cdcd7dab73cc84809a36 17-Jan-2013 Mark Wei <markwei@google.com> Modify image attachments previews to conform to UX specs

Thumbnail and full image start loading at the same time.

Once thumbnail is shown, we display a determinate progress bar while downloading
the full image.

Remove progress bar from image tiles in ConversationView.

Bug: 8021747
Change-Id: Ic1c7e7fcdc5683ad9e899c82b6bbdb5861d16a55
/frameworks/opt/photoviewer/src/com/android/ex/photo/PhotoViewActivity.java
40a26567ebaf6311bd7a102491d669abd1d68646 20-Dec-2012 Paul Westbrook <pwestbro@google.com> Set the fullscreen timeout, even with no actionbar

We need to set the timeout even when there is no action bar, as it
still will affect lights out mode.

Renamed the variable & methods to better names

Change-Id: I1752a5c9a1f2212f3a17af2e8aa2d78a2377e1fa
/frameworks/opt/photoviewer/src/com/android/ex/photo/PhotoViewActivity.java
29e47d946fd19443c12ebad9f94e83741c7d9120 19-Dec-2012 Paul Westbrook <pwestbro@google.com> Fix some build errors

These need to be fixed before switching to the photoviewer library
in frameworks/opt

Change-Id: Ie02e759edecfb3c47c2db7534ae881761ecc2d95
/frameworks/opt/photoviewer/src/com/android/ex/photo/PhotoViewActivity.java
8f359e98b9f18064a75c80b9c9ad8bda2713c612 19-Dec-2012 Paul Westbrook <pwestbro@google.com> Merge "Fix for panorama icon not always showing up in photo viewer"

Merge CL: https://googleplex-android-review.googlesource.com/#/c/246161

Change-Id: I8cc5f339b4ffde31eadc2412aa6389354cfea45b
/frameworks/opt/photoviewer/src/com/android/ex/photo/PhotoViewActivity.java
fd925449925f3eb6e2ab6e1c50203c4a4bc165b2 19-Dec-2012 Paul Westbrook <pwestbro@google.com> Merge "Fix problem where part of wrong photo shows"

This is a manual merge of:
https://googleplex-android-review.googlesource.com/#/c/260544/1

Change-Id: Id872c4dd23db5c0d4e107a52a50a43c4b12a291d
/frameworks/opt/photoviewer/src/com/android/ex/photo/PhotoViewActivity.java
d4f7888c44dbc6808c20db3605bc48cc42f0b350 19-Dec-2012 Paul Westbrook <pwestbro@google.com> Merge photo viewer changes from master

Change-Id: I3d4835aa10bbcccc8cf07ba53182da2ca017a1b9
/frameworks/opt/photoviewer/src/com/android/ex/photo/PhotoViewActivity.java
99f6f3ea0e43d5ac96344a987735fc39485f8f05 18-Dec-2012 Martin Hibdon <mhibdon@google.com> Performance improvement for photoViewer

I noticed that when we bring up the photoViewer,
it always initializes the first two fragments, and
then switches to whatever fragments we actually
want to look at based upon the intent parameters.
This issue is that we were assigning the adapter
to the ViewPager before we had any cursor at all.
If we hold off on setting the adpater until we have
a cursor, then this doesn't happen. This improves
startup time of the PhotoViewActivity noticeably.

Also, made a few changes to make it easier to
extend PhotoViewActivity and PhotoViewFragment,
to change its behavior.

Change-Id: Icc4c397529bd147d0ac6818f79a48db1c4a25f32
/frameworks/opt/photoviewer/src/com/android/ex/photo/PhotoViewActivity.java
399fe3d995ed4366a18c7ce6632b3014284df57a 30-Oct-2012 Martin Hibdon <mhibdon@google.com> Remove PhotoViewFragment's dependency on PhotoViewActivity

Now, there is a interface called PhotoViewCallbacks
that PhotoViewFragment depends upon. This way other
users can use PhotoViewFragment without using
PhotoViewActivity.

Change-Id: Ibbda93d2e0226bcc993ef98be1de7cf3a323f41a
/frameworks/opt/photoviewer/src/com/android/ex/photo/PhotoViewActivity.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/PhotoViewActivity.java
4a6a7183e0740dfb305a16676c867e182aced7aa 19-Sep-2012 Adam Copp <adamcopp@google.com> Cursor listeners can use setPhotoIndex meaningfully

Cursor listeners can now use setPhotoIndex and have the changes take
effect immediately. It appears that nobody in code search will have
their code broken by this change.

Change-Id: I76afd8545310c24f05307d38ed03081914a17987
/frameworks/opt/photoviewer/src/com/android/ex/photo/PhotoViewActivity.java
3b16fb64efd107102fe93bf0c6cd09ae1c1614f5 06-Sep-2012 Adam Copp <adamcopp@google.com> Merge "Make setLightsOutMode protected"
b462d1bf5d3833fabbdc38d13f66dadcf6ceda54 06-Sep-2012 Adam Copp <adamcopp@google.com> Fix double-tap to restore from fullscreen

After auto-hiding the actionbar, two taps must be made to restore
the action bar.

this change fixes that by calling setFullScreen instead of just changing
lights out mode. This correctly updates the mFullScreen variable and
means only one tap is required to restore the action bar.

Bug: 7117697

Change-Id: I8645ca77c2f025868c487c2c63e7057d696d6dac
/frameworks/opt/photoviewer/src/com/android/ex/photo/PhotoViewActivity.java
7e6995626b551c215bc3064c95b9996af940746a 06-Sep-2012 Adam Copp <adamcopp@google.com> Make setLightsOutMode protected

setLightsOutMode becomes protected so that subclasses can reliably
hide and show ui elements when fullscreen mode is enabled.

Change-Id: I891cfd80b515df72020d5df21427247615f04a74
/frameworks/opt/photoviewer/src/com/android/ex/photo/PhotoViewActivity.java
0ab3e0cf9cbb5751a276e4c2555640a0e8173b5f 28-Aug-2012 Adam Copp <adamcopp@google.com> Scope changes and removal of unnessecary variable

Adds isFullScreen() and setPhotoIndex() protected methods to
PhotoViewActivity in order to allow subclasses access to this
information.

Removes mDataValid from BaseCursorPagerAdapter since it was hiding how
simple the checks actually were (it was just mCursor != null)

A nullcheck has also been added to BaseFragmentPagerAdapter in
instantiateItem. in the long term, BaseCursorPagerAdapter should not be
so fragile, and should not surface nulls, but that change could be quite
involved, so should probably not be rolled into this change.

Change-Id: I4889c5ae2a764660926c70da25b85565f4600188
/frameworks/opt/photoviewer/src/com/android/ex/photo/PhotoViewActivity.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/PhotoViewActivity.java
d4a7a6c3fbbeed97d6550612e81c57f98f093a84 30-Aug-2012 Paul Westbrook <pwestbro@google.com> am 7d920938: am 45faaf4d: am 2b4059cd: Allow action bar to be updated

* commit '7d9209389c0c678cbd5a82d767fb6c984fcd0d64':
Allow action bar to be updated
2989cf0c8e4b0aee4c9ac2b5384a392fd74cd6a9 30-Aug-2012 Paul Westbrook <pwestbro@google.com> Allow action bar to be updated

Allow the action bar to be updated when the photo list loader
loads data

Bug: 7082929
Change-Id: I476df1fa2ec7dcb1adfe5aed359a5126c60be179
/frameworks/opt/photoviewer/src/com/android/ex/photo/PhotoViewActivity.java
e9d441306cc11d5538f8af05db4d0f94a1e91f70 29-Aug-2012 Paul Westbrook <pwestbro@google.com> am 4689c6f8: am 162052cc: am 114cef99: Fix crash in email with attachments

* commit '4689c6f834a99fe8b57f2391bc14d13a3c6645cb':
Fix crash in email with attachments
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/PhotoViewActivity.java
502e7156de49b62863ef0824cfd8b5a0be65dbed 22-Aug-2012 Adam Copp <adamcopp@google.com> Merge "Add HTTP uri handling & fetch thumbnail first"
bd8b47b147f29f196f37d66ccb561d40414ab5b6 22-Aug-2012 Adam Copp <adamcopp@google.com> Add HTTP uri handling & fetch thumbnail first

If a http:// or https:// url is specified as the thumbnail uri or
regular uri for an image, we attempt to fetch it over the internet.

Also, changed the order of loading so that we always attempt to fetch
the thumbnail image before we fetch the regular image. This aids in the
http:// uri case, since it should take significantly less time to be
presented with a thumbnail than the full image.

Finally, finishes the photo viewer activity when the "top" button on the
action bar is pressed, unless a custom override has been added.

These 3 changes could be seperated into different patches if you would
like

Change-Id: Iddc8cc6bef3f9e66198dfb98eb2f7bd309023b3f
/frameworks/opt/photoviewer/src/com/android/ex/photo/PhotoViewActivity.java
abfecf5511e7f4e700f77826b9ed9834313143ff 21-Aug-2012 Marc Blank <mblank@google.com> Abort posted runnable if cursor is no longer open

Bug: 7002552
Change-Id: I38ce1231b0ec88ebf02d4d0edb5495b8baac65d5
/frameworks/opt/photoviewer/src/com/android/ex/photo/PhotoViewActivity.java
9556f61c11991d6e955cfd68ca53f4f489dfa8c5 14-Aug-2012 Paul Westbrook <pwestbro@google.com> Fix some photo view problems

Make sure to stop the indeterminate progress bare when we can't
load an image

Bug: 6956516
Change-Id: Ifb69ca2e08a8ddfb351989d8e276e7fb6e3b06e5
/frameworks/opt/photoviewer/src/com/android/ex/photo/PhotoViewActivity.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/PhotoViewActivity.java
1a7f70300256d443fe2236a0008b4aa016e2d834 07-Aug-2012 Andrew Sapperstein <asapperstein@google.com> Fix Build.

Change-Id: If36065612faadc4d6b44ddbfc9efde0597db4718
/frameworks/opt/photoviewer/src/com/android/ex/photo/PhotoViewActivity.java
150e623129eef49467f1d6f67649e4636a4513f2 03-Aug-2012 Andrew Sapperstein <asapperstein@google.com> Enabled optional support for showing progress.

Added some progress bars to the "empty" view
so that implementors of the API can show the
progress of things like downloads or loading.

Additionally, added a retry button and an optional
text that allows you to indicate status to the user.

Due to a bug in the framework, we actually use two
progress bars (one determinate and one indeterminate)
to update our status. Created a wrapper that allows
the controlling of both progress bars in sync.

Change-Id: I710e06317948d376d445abf1603545982ac8479d
/frameworks/opt/photoviewer/src/com/android/ex/photo/PhotoViewActivity.java
1abd4654c2eeacc7d854a438a9c72d7239278bea 30-Jul-2012 Andrew Sapperstein <asapperstein@google.com> ActionBar now auto-hides like Gallery's version.

5 second delay from opened. Will not hide on first
appearance. Has be closed and re-opened. Also,
eliminated the progress spinner when the photo hadn't
yet loaded.

Additionally, modified the action bar to match gallery's
transparency.

Change-Id: I69e72d787bc2cda9c18df6a9cf1800d155d6876a
/frameworks/opt/photoviewer/src/com/android/ex/photo/PhotoViewActivity.java
9007d640832f674a9d65058a3c2a484c078d239e 27-Jul-2012 Andrew Sapperstein <asapperstein@google.com> Showing a default preview photo.

If we do not have a preview and are currently
waiting on a full photo, we will show a stock
photo. Currently shows a grey box as we do not
have assets yet.

Change-Id: I155071598b20bf81b2b60bdd8ac881a64b8ee1b7
/frameworks/opt/photoviewer/src/com/android/ex/photo/PhotoViewActivity.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/PhotoViewActivity.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/PhotoViewActivity.java