murraycu / android-galaxyzoo

This Android app lets you classify Galaxy Zoo subjects. It is available in the Google Play Store: https://play.google.com/store/apps/details?id=com.murrayc.galaxyzoo.app . Try beta versions early here: https://play.google.com/apps/testing/com.murrayc.galaxyzoo.app . See also the iPhone app for Galaxy Zoo: https://github.com/murraycu/ios-galaxyzoo/
GNU General Public License v3.0
11 stars 13 forks source link

Viewing example images doesn't use the changeImageTransform transformation/animation #4

Closed murraycu closed 9 years ago

murraycu commented 9 years ago

Opening already-classified item from the list view shows a nice move+expand animation as the large version of the image is shown in the new activity.

However, the same thing doesn't work when opening an example image from the help activity(QuestionHelpActivity/QuestionHelpFragment). For instance, click on the ? action icon and then click on an image thumbnail.

This should work:

Both the thumbnail and the larger image are marked with the same transitionName: https://github.com/murraycu/android-galaxyzoo/blob/master/app/src/main/java/com/murrayc/galaxyzoo/app/QuestionHelpFragment.java#L153 and https://github.com/murraycu/android-galaxyzoo/blob/master/app/src/main/res/layout/fragment_example_viewer.xml#L23

and the ExampleViewerActivity is started with the appropriate transition options bundle: https://github.com/murraycu/android-galaxyzoo/blob/master/app/src/main/java/com/murrayc/galaxyzoo/app/QuestionHelpFragment.java#L194

and the transitions are specified in the theme: https://github.com/murraycu/android-galaxyzoo/blob/master/app/src/main/res/values-v21/styles.xml#L15 which refers to this: https://github.com/murraycu/android-galaxyzoo/blob/master/app/src/main/res/transition/change_image_transform.xml

murraycu commented 9 years ago

Also, the transition from the list view (when clicking on already-classified items) doesn't come from the right place either.

murraycu commented 9 years ago

This seems to work correctly now. The trick was to use changeBounds as well as changeImageTransform: https://github.com/murraycu/android-galaxyzoo/commit/e5962528ffdf0cb3bb9259874a5efc9a3d2aebbb