Layout XML Code (Cont.)


The Android Studio Designer tool significantly simplifies the task of designing and implementing Android user interfaces. It operates in two distinct modes referred to as Design mode and Text mode.
Design Mode
The Designer tool provides a “what you see is what you get” (WYSIWYG) environment in which views can be selected from a palette and then placed onto a canvas representing the display of an Android device.

A wide variety of properties relating to the selected view may be modified using the Properties panel. The figure highlights the key areas of the Android Studio Designer tool: (A) palette, (B) device screen, (C) component tree, (D) properties, (E) toolbar, and (F) mode switching tabs.

Text Mode
Under the surface, the Designer tool actually constructs an XML resource file containing the definition of the user interface that is being designed. When using the Android Studio Designer tool that all it is really doing is providing a user friendly approach to creating XML layout resource files.

The figure highlights the key areas of the Android Studio Designer tool in text mode: (A) editor, (B) preview, (C) toolbar, and (D) mode switching tabs.


      “There are moments when troubles enter our lives and we can do nothing to avoid them.    
      But they are there for a reason.    
      Only when we have overcome them will we understand why they were there.”    
      ― Paulo Coelho, The Fifth Mountain