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)

1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.