6
<?xml version="1.0" encoding="utf-8"?>

<selector xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res/com.example.app">
    <item app:remainingUse="2" android:drawable="@drawable/blabla2" />
    <item app:remainingUse="1" android:drawable="@drawable/blabla1" />
    <item app:remainingUse="0" android:drawable="@drawable/blabla0" />
    <item android:drawable="@drawable/blabla3" />
</selector>

Is it possible to use an integer value as control state in a custom selector like above?

(remainingUse is a custom integer variable defined in attrs.xml)

ahmet
  • 646
  • 6
  • 14

0 Answers0