Skip to content

Commit 201b4a0

Browse files
Material Design Teamhunterstich
authored andcommitted
[Material] Update guidelines for CollapsingToolbar + PreferenceFragmentCompat
It previously recommended creating a PreferencFragmentCompat inside a NestedScrollView, which will make the RecyclerView fully inflate all element, causing a UI jank. See more in https://momen-zaq.medium.com/recyclerview-with-nestedscrollview-best-practices-and-how-to-avoid-it-152fd9ce46d9 PiperOrigin-RevId: 460482020
1 parent 53b3001 commit 201b4a0

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

catalog/java/io/material/catalog/topappbar/res/layout/cat_topappbar_preferences_fragment.xml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,10 @@
3737

3838
</com.google.android.material.appbar.AppBarLayout>
3939

40-
<androidx.core.widget.NestedScrollView
40+
<FrameLayout
41+
android:id="@+id/cat_topappbar_preferences_container"
4142
android:layout_width="match_parent"
4243
android:layout_height="match_parent"
43-
app:layout_behavior="@string/appbar_scrolling_view_behavior">
44-
45-
<FrameLayout
46-
android:id="@+id/cat_topappbar_preferences_container"
47-
android:layout_width="match_parent"
48-
android:layout_height="wrap_content"/>
49-
</androidx.core.widget.NestedScrollView>
44+
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
5045

5146
</androidx.coordinatorlayout.widget.CoordinatorLayout>

0 commit comments

Comments
 (0)