J'ai créé un bouton et je veux ajouter un effet d'entraînement à ce bouton!
J'ai créé un fichier XML bouton bg: (bg_btn.xml)
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<gradient android:startColor="#FFFFFF" android:endColor="#00FF00" android:angle="270" />
<corners android:radius="3dp" />
<stroke android:width="5px" android:color="#000000" />
</shape>
Et voici mon fichier d'effet d'entraînement: (ripple_bg.xml)
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:color="#f816a463"
tools:targetApi="lollipop">
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
<solid android:color="#f816a463" />
</shape>
</item>
</ripple>
Et c'est mon bouton auquel je veux ajouter un effet d'entraînement:
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Button"
android:id="@+id/button"
android:layout_centerHorizontal="true"
android:layout_marginTop="173dp"
android:textColor="#fff"
android:background="@drawable/ripple_bg"
android:clickable="true" />
Mais après l'ajout de l'effet d'entraînement, l'arrière-plan du bouton est transparent et le bouton s'affiche uniquement lorsque vous cliquez dessus, comme ceci:
Avant de cliquer
Sur clic

Mais j'ai besoin à la fois de la couleur d'arrière-plan du bouton et de l'effet d'entraînement, j'ai trouvé une partie de ce code dans différents blogs de Stack Overflow, mais cela ne fonctionne toujours pas!
lou mau lien de l'image. (voir mon montage)