Creating Layouts
Explore how to create Android app layouts using Kotlin with Android Studio. Learn to design the main activity layout and a dynamic row template for displaying airport status. Understand drag-and-drop widget placement, setting IDs, layout constraints, and using RecyclerView for dynamic lists.
We'll cover the following...
We’ll use two layouts in this app, one for the main landing page and the other for each of the rows to display airport status information. Let’s start with the design of the first one.
Designing initial layout
In the Project pane, under app/res/layout, you’ll see the file activity_main.xml—it was created by the IDE when the project was created. Double click this file name and take a look at the layout. You can view and edit the layout using the Design view, or directly view and edit the XML document using the Text view. Let’s edit the layout from the Design view.
The Android Studio provides powerful ways to add various widgets to the layout. Start by deleting the TextView with the words Hello World from the middle of the layout. ...