Home » Android » android – Is it possible to create a custom state for use in a StateListDrawable?

android – Is it possible to create a custom state for use in a StateListDrawable?

Posted by: admin June 15, 2020 Leave a comment

Questions:

They have states for things like pressed, focused, disabled, but is it possible to create custom states so it could reflect some of my own custom criteria?

For example, say you have a list of names. Some people fall into a certain category that should be visually represented differently. These people’s rows would then have a different state and background drawable.

How to&Answers:

This article shows how to do it.