Get Wrong Animation effect when use ActivityOptions.makeSceneTransitionAnimation
it's a new transition animation in Android 5.0. but PhotoView will get wrong size when play animation like

Would love to see this fixed too. It makes Lollipop transition unusable.
I tried to postpone the transition by calling startPostponedEnterTransition in OnPreDrawListener but it doesn't change a thing.
I tried to extend ChangeImageTransform to add logs and compare these values with the ones that I get when using a simple ImageView instead of a PhotoView, but everything seems to be the same. Does anyone have an idea?
Same problem. The only way i workarounded it: wrap imageviews into PhotoViewAttachers on enter animation finish. And clean PhotoViewAttachers on destroy views or activity exit
Can you share the code to do this? I'm struggling with this problem too, but don't want to move away from PhotoView
https://github.com/deviant-studio/VKontakte-Plus/blob/master/app/src/main/java/ds/vkplus/ui/activity/PhotosActivity.kt it's on kotlin though
Doesn't really help me. but thanks - Hope this gets fixed soon or a workaround is found
Same here.
I currently work around this by having 2 ImageViews in the 2nd activity, a standard ImageView for the transition, and a PhotoView that gets displayed when the transition is over on top of it
Is there any news on this?
Having an extra standard ImageView might work but then it breaks (for various reasons) when closing with ActivityCompat.finishAfterTransition().
If you happen to know what’s wrong, it should not be difficult to write a ChangeImageTransform extension, like:
public class ChangePhotoTransform extends ChangeImageTransform {
private static final String PROPNAME_MATRIX = “android:changeImageTransform:matrix”;
private static final String PROPNAME_BOUNDS = “android:changeImageTransform:bounds”;
@Override
public void captureStartValues(TransitionValues transitionValues) {
if (transitionValues.view instanceof PhotoView) {
capturePhotoValues(transitionValues);
} else {
super.captureStartValues(transitionValues);
}
}
@Override
public void captureEndValues(TransitionValues transitionValues) {
if (transitionValues.view instanceof PhotoView) {
capturePhotoValues(transitionValues);
} else {
super.captureEndValues(transitionValues);
}
}
private void capturePhotoValues(TransitionValues transitionValues) {
PhotoView view = (PhotoView) transitionValues.view;
if (view.getVisibility() != View.VISIBLE) return;
Map<String, Object> values = transitionValues.values;
// Then...
values.put(PROPNAME_BOUNDS, goodRect);
// And finally....
values.put(PROPNAME_MATRIX, goodMatrix);
}
}
The current implementation of ChangeImageTransform is quite simple. I did my best in the past hours, but with no luck.
I had similar animation issue. Magic call photoViewAttacher.update() helped in my case.
public class DetailsTransition extends ChangeImageTransform {
@Override
public void captureStartValues(TransitionValues transitionValues) {
updateAttacher(transitionValues);
super.captureStartValues(transitionValues);
}
@Override
public void captureEndValues(TransitionValues transitionValues) {
updateAttacher(transitionValues);
super.captureEndValues(transitionValues);
}
private static void updateAttacher(TransitionValues transitionValues) {
View view = transitionValues.view;
if (view instanceof PhotoView) {
PhotoView imageView = (PhotoView) view;
PhotoViewAttacher photoViewAttacher = (PhotoViewAttacher) imageView.getIPhotoViewImplementation();
photoViewAttacher.update();
}
}
}
Why not use imageview and PhotoVIewAttacher, something like this: public void onTransitionEnd(Transition transition) { PhotoViewAttacher attacher = new PhotoViewAttacher(); } It seems to have fixed the issue.
This should be resolved in 1.3.0 thanks to @Rexee
thanks @Rexee 👍
Seems like this issue reemerged in 2.1.3 Downgrading to 2.0.0 helped
Everything works fine for me on 2.2.0