The transition from the shared element leaves a strange white background between the first activity and the second transparent activity

I recently ran into some strange problem. I have two activities. The first contains a grid with thumbnails. This is a kind of gallery. And the second contains a presentation pager with fragments and behaves as a means of viewing images, where you can move between images. I am using a shared element transition to trigger the second action. Just like the Google Photos app. In the second action, I can scroll up or down to reject the action with the background fading out. I made my second activity completely transparent:

<item name="android:windowBackground">@color/palette_transparent</item> <item name="android:colorBackgroundCacheHint">@null</item> <item name="android:windowIsTranslucent">true</item> <item name="android:windowAnimationStyle">@android:style/Animation</item> 

But the problem is that when I scroll the image up / down, and the second activity background disappears, I see a white background, but not the first type of activity. If I start the second action without going over a common element, everything will be fine.

I did a study and found out that this white layer probably overlaps the first action. It is not part of the second action, as I can see in the hierarchy of representations of Stetho.

My explanation is probably not very good either in my English, so a few videos here clarify my problem too much.

Video Without transition and Video With transition

+9
source share
1 answer

This should help:

 <item name="android:windowEnterTransition">@android:transition/no_transition</item> <item name="android:windowExitTransition">@android:transition/no_transition</item> 
0
source

All Articles