FreeFlow icon indicating copy to clipboard operation
FreeFlow copied to clipboard

Recursively computing layout when RelativeLayout and android:layout_above

Open ypresto opened this issue 10 years ago • 0 comments

I found memory is growing and GC is running when FreeFlow is shown even if I didn't touch to the device. Allocation tracking says FreeFlow is computing layout constantly.

image

It was because FreeFlowContainer is placed in RelativeLayout and layout_above is used. (I placed LinearLayout with fixed height of 76dp, which contains Buttons, on the bottom of fragment.) For workaround I applied below diff to my xml file.

    <FreeFlowContainer
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
+        android:layout_height="match_parent"
         android:layout_alignParentTop="true"
-        android:layout_above="@id/footerButton"
+        android:layout_alignParentBottom="true"
+        android:layout_marginBottom="76dp"

This issue also causes bug that sometimes onItemSelected() is not called.

ypresto avatar Jul 03 '15 03:07 ypresto