Both the button and the ListView are not modified when clicked, but the settings when the item is not pressed work.
ListView :
<ListView
android:id="@+id/listaListas"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:divider="#FFECECEC"
android:dividerHeight="2sp"
android:layout_alignParentEnd="true"
android:layout_above="@+id/novalista"
android:background="@drawable/layout_item_listview">
</ListView>
layout_item_listview:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:state_selected="true"
android:drawable="@drawable/layout_item_selecionado" />
<item android:state_pressed="false" android:state_selected="false"
android:drawable="@drawable/layout_item_normal" />
</selector>
layout_item_selected:
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/item_selecionado"/>
</shape>
layout_item_normal:
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/vermelho"/>
</shape>
Boot:
<ImageButton
android:layout_width="70dp"
android:layout_height="80dp"
android:background="@color/amarelo"
android:src="@drawable/img_estrelabotao"
android:id="@+id/btnfavorito"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true"
android:visibility="visible"
style="@style/estiloBotaoFavorito"/>
FavoriteBoard style:
<style name="estiloBotaoFavorito">
<item name="android:background">@drawable/layout_botao_favorito</item>
<item name="android:textColor">@color/icons</item>
<item name="android:textSize">15dp</item>
</style>
layout_botao_favorito:
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_pressed="true" android:drawable="@drawable/layout_botao_favorito_pressionado"/>
<item android:state_pressed="false" android:drawable="@drawable/layout_botao_favorito_normal"/>
</selector>
layout_botao_favorito_pressado:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:padding="10dp"
android:shape="rectangle">
<solid
android:drawable="@drawable/nine_patch_retangulo"
android:color="@color/amarelo_escuro"
android:elevation="8dp"/>
</shape>
layout_botao_favorito_normal:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:padding="10dp"
android:shape="rectangle">
<solid
android:drawable="@drawable/nine_patch_retangulo"
android:color="@color/amarelo"
android:elevation="8dp"/>
</shape>
Another question I have is if within the shape of the button I can set elevation and drawable? As you did not accuse me I left it like this