Inspectopedia Help

FrameLayout can be replaced with <merge> tag

FrameLayout can be replaced with <merge> tag

If a <FrameLayout> is the root of a layout and does not provide background or padding etc, it can often be replaced with a <merge> tag which is slightly more efficient. Note that this depends on context, so make sure you understand how the <merge> tag works before proceeding.

Issue id: MergeRootFrame

https://android-developers.googleblog.com/2009/03/android-layout-tricks-3-optimize-by.html

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for Android 2023.3, Qodana for JVM 2023.3

Plugin:

Android, 2022.3.1 Beta 2

Last modified: 13 July 2023