How do I imitate the behaviour of a pressed button in Android? -


i'm trying make custom button, behaves 'pressed button' in android own background images.

pressing changes button's image (color darker), can't seem focussed / focussed&pressed states right. when release finger on default button there circle filling whole button won't happen mine.

that's code:

<?xml version="1.0" encoding="utf-8"?>    <selector xmlns:android="http://schemas.android.com/apk/res/android">        <item android:state_focused="true" android:state_pressed="false" android:drawable="@drawable/fertig_focussed" />      <item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/fertig_focussed_pressed" />      <item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/fertig_pressed"/>      <item android:drawable="@drawable/fertig_regular" />    </selector>

thanks in advance!

that's because android check stats in order , 1 matching first.

you need put "pressed" first, focus pressed second, focused.


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -