Fixed
Status Update
Comments
ni...@google.com <ni...@google.com> #2
Information redacted by Android Beta Feedback.
ni...@google.com <ni...@google.com> #3
Thank you for reporting this issue. We have shared this with our product and engineering team and will update this issue with more information as it becomes available.
Description
Android API version: 22
Steps to reproduce:
1. Run the app on an emulator/device with API 22 (emu reproduces every time)
2. A list of elements should be shown
The list isn't shown.
What I noticed is that having a structure like this:
<?xml version="1.0" encoding="utf-8"?>
<layout>
<data>
<import type="android.view.View" />
<variable
name="loading"
type="Boolean" />
</data>
<RelativeLayout xmlns:android="
xmlns:app="
xmlns:tools="
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<ProgressBar
android:id="@+id/loadingStatus"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:visibility="@{loading ? View.VISIBLE : View.GONE }" />
<TextView
android:id="@+id/text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Title bar"
android:textSize="38sp"
android:layout_alignParentTop="true" />
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_below="@+id/text"
android:layout_alignParentBottom="true"
android:visibility="@{loading ? View.GONE : View.VISIBLE}">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
.... some views here
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
</RelativeLayout>
</layout>
And quickly changing the value of "loading" to false (50ms in the attached repro project) -> true, will fail to show the inner NestedScrollView
This happens on Android API 22 only, on more recent APIs it works fine.
Changing the top level ConstraintLayout to be a RelativeLayout fixes the issue (see activity_main_relative.xml and inside MainActivity.kt in the repro zip)