android:background killing Activity enter/return transitions -
i used activity enter/return transitions (using xml transitions slide , fade animate views) , worked because it's straightforward. in last project having problems dummy activites (without real processing), transitions don't work, after hours of changing layout code, figured out responsible android:background
in root framelayout of activity layout set background color. when removed attribute, transitions came work. also, if apply attribute in activity theme, transitions stop again.
currently project animating second activity has layout structure:
<framelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:background="@color/colorprimary" android:layout_width="match_parent" android:layout_height="match_parent"> <imageview> <recyclerview> </framelayout>
and transition slide in imageview top , slide in recyclerview bottom. i've said. works if root framelayout don't have background color.
do have idea if it's bug or else?
edit: if use ugly dummy view provide background color, transitions work:
<framelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent"> <view android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/colorprimary" /> <imageview> <recyclerview> </framelayout>
edit 2: same problem happens if use root viewgroup linearlayout instead framelayout.
i've found solution (or workaround) using friend tip:
if use attribute in root framelayout, transition works:
android:transitiongroup="false"
Comments
Post a Comment