In FrameLayout of XML we have an attribute by name tools:ignore="MergeRootFrame", what is MergeRootFrame ?
FrameLayout is designed to block out an area on the screen to display a single item. Generally, FrameLayout should be used to hold a single child view, because it can be difficult to organize child views in a way that's scalable to different screen sizes without the children overlapping each other.
The <include> tag lets you to divide your layout into multiple files: it helps dealing with complex or overlong user interface.
It's for the Lint tool. You're asking it to ignore (i.e. not show warnings for) the "MergeRootFrame" rule:
"MergeRootFrame": Checks whether a root <FrameLayout> can be replaced with a <merge> tag
<tools> attributes is basically used as a shortcut to store information and facilitating Android platform with required conditions without further computation.
"tools:ignore" is a statement which actually is telling Lint tool to ignore "issue id" - "MergeRootFrame".
based on ipavl's answer - <merge> tag is is basically used to remove multiple layers of viewgroups which are not required / degrades UI performance. this statement basically asks Lint to ignore warnings where, there are multiple redundant <framelayout>'s and this could be further optimized my replacing it with <merge>
This is explained here, beautifully - Warning: This <FrameLayout> can be replaced with a <merge> tag
Bottom line: Technically you are asking Lint to ignore warnings of this kind
http://tools.android.com/tech-docs/tools-attributes , https://developer.android.com/training/improving-layouts/reusing-layouts.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With