I must be missing something with android:visibility changes within a motion layout. Here’s a simplified version of my layout.
<MotionLayout>
<ImageView android:id="@+id/HeaderBackground" />
Bunch of image views, Text views that are constrainted to the HeaderBackground.
<RecyclerView android:visibility="visible">
<EditText android:visibility="visible">
<CustomViewGroup1 android:visibility="gone">
</MotionLayout>
I have a motionScreen that sets a Transition onswipe based on the recycler view to reduce the height of the HeaderBackground and hide some of the images/text views (i.e a collasping toolbar).
However, if there’s some fatal error, I want to show CustomViewGroup1 on top/infront of the RecyclerView but toggling the visibility of the RecyclerView to gone and CustomViewGroup1 to visible doesn’t make the CustomViewGroup1 show.
I could move the CustomViewGroup group out of the MotionLayout and add a framelayout as the root of the activity and hide the whole MotionLayout. But this is less than ideal as I’d have to copy of the toolbar bar and icons. So I guess the question is about visibility changes and potentially z ordering?
I'm using androidx.constraintlayout:constraintlayout:2.0.0-beta2
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…