-
Book Overview & Buying
-
Table Of Contents
Android Programming with Kotlin for Beginners
By :
To follow along with this project, create a new Android Studio project, call it Kotlin Meet UI, and choose the Empty Activity template. You can find the code and the XML layout code in the Chapter12/Kotlin Meet UI folder.
First, let's build a simple UI by observing the following steps:
In the editor window of Android Studio, switch to activity_main.xml and make sure you are on the Design tab.
Delete the auto-generated TextView, the one that reads "Hello world!".
Add a TextView widget to the top-center of the layout.
Set its text property to 0, its id property to txtValue, and its textSize to 40sp. Pay careful attention to the case of the id value. It has an uppercase V.
Now, drag and drop six buttons on to the layout so that it looks a bit like the following diagram. The exact layout isn't important:

When the layout is how you want it, click the Infer Constraints button to constrain all the UI items.
Double left...