From the course: Android App Development: Accessibility

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Communicating meaningful toggle buttons

Communicating meaningful toggle buttons - Android Tutorial

From the course: Android App Development: Accessibility

Start my 1-month free trial

Communicating meaningful toggle buttons

- [Instructor] Let's take a look at another example where communicating information with color alone is very common. Open the cards example, and in our cards example, the like and favorite buttons indicate their state using color alone. Let's fix this by changing its shape in addition to its color. On Android Studio, let's go to the Drawables folder and let's take a look at the current drawables that we have. For the thumb up, we actually already have a fill state. But for the favorite, we don't have any. So let's create one. Right click on the drawable folder, go to New, and Vector Asset. Under the Clip Art, click on the button and search for favorite. We have here an icon showing the fill state. Click okay. I'm going to change its name as well. Just remove the caller here. Click next and finish. So now we have two states where we can change the shape. Let's close these drawables. Now let's open the adapters folder and CardListAdapter. Now locate where we actually change the color…

Contents