Customize the Player List Items

Again, the Pick Players screen is currently functional as is, but once you get some real users on the app, there’s bound to be some confusion. Nothing is telling users what happens when you check or uncheck the check box for a player or what that switch at the end means. Disabling unchecked items gives users an indication what they’re doing when they check the box since they’ve seen forms like this before.

For the <SwitchCompat> tag, we can change the on/off states from just being a generic-looking switch to human and AI icons. This way people will be able to quickly tell what’s going on with each control without the need for a bunch of text on the screen. First up is the <CheckBox> and the android:enabled attribute. ...

Get Kotlin and Android Development featuring Jetpack now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.