android / user-interface-samples

Multiple samples showing the best practices in the user interface on Android.
Apache License 2.0
4.33k stars 1.63k forks source link

Replace FrameLayout with FragmentContainerView #465

Open Goooler opened 2 months ago

Goooler commented 2 months ago

FragmentContainerView is a customized Layout designed specifically for Fragments. It extends FrameLayout, so it can reliably handle Fragment Transactions, and it also has additional features to coordinate with fragment behavior.

https://developer.android.com/reference/androidx/fragment/app/FragmentContainerView

Align with the usages like https://github.com/android/user-interface-samples/blob/4dc2385d266cc8818905451647ec4f54867901a5/CanonicalLayouts/list-detail-sliding-pane/app/src/main/res/layout/fragment_list.xml#L30-L31