Loops demo app
To get started, create a new Android project called Loops
, use the Empty Activity template, and leave all the other settings at their default.
Let's add a few buttons to our UI to make this more fun. Switch to the activity_main.xml
file and make sure you are on the Design tab, and then follow these steps:
- Drag a button onto the UI and center it horizontally near the top.
- In the properties window, change the text property to
Count Up
. - In the properties window, change the onClick property to
countUp
. - Place a new button just below the previous one and repeat steps 2 and 3 but this time use
Count Down
for the text property andcountDown
for the onClick property. - Place a new button just below the previous one and repeat steps 2 and 3 but this time use nested for the text property and the onClick property.
- Click the Infer Constraints button to constrain the three buttons in position.
Looks are not important for this demo but run the...