65.3 Designing the User Interface
The user interface will consist of a button to launch coroutines together with a Seekbar to specify how many coroutines are to be launched asynchronously each time the button is clicked. As the coroutines execute, a TextView will update when individual coroutines start and end.
Begin by loading the activity_main.xml layout file and add the Button, TextView and SeekBar objects so that the layout resembles that shown in Figure 65-1:
Figure 65-1
To implement the layout constraints shown above begin by clearing all constraints on the layout using the toolbar button. Shift-click on the four objects so that all are selected, right-click over the top-most TextView and select the Center -> Horizontally menu option. Right-click once again, this time selecting the Chains -> Create Vertical Chain option.
Select the SeekBar and change the layout_width property to 0dp (match_constraints) before adding a 24dp margin on the left and right hand...