Android - Tools attribute in layouts
The XML tools attributes allow you to see a more clear picture of your complete layout, without writing throwaway code or using dummy values that a user might accidentally see. To use the tools attributes in your XML file, you will first need to add the tools namespace. You can do this by adding xmlns:tools="http://schemas.android.com/tools" to your file’s parent view element. Alternatively, you can start typing tools in any view element, then Opt+Enter (Alt+Enter on Windows) to automatically add the namespace. It’s also a good idea to include context for your tools, so any custom themes and styles are applied to the preview as well. Do this by including tools:context=".MainActivity" in the parent element.
tools:text="title" - Set text on your view only for the layout preview. There is no lint warning for using a hardcoded string here, since it is just for debugging.
tools:src="@drawable/my_img" - Set the image on your view only for the layout preview.
tools:visibi