Android: <include> mit RippleEffect & StateListAnimator
Ich habe ein Layout, das ein anderes Layout enthält:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="@+id/layout1">
<include layout="@layout/my_layout"/>
</LinearLayout>
Ich muss dem enthaltenen Layout einen RippleEffect sowie einen StateListAnimator hinzufügen.
Beispiel
<include layout="@layout/my_layout"
android:stateListAnimator="@anim/lift_up"
android:background="@drawable/ripple_effect"/>
Beide der RippleEffect und der StateListAnimator funktionieren zu 100%. Ich kann das enthaltene Layout nicht ändern. Daher muss ich die Effekte entweder auf das Include-Tag oder auf das übergeordnete Layout selbst anwenden.
ch habe beide Techniken ausprobiert, von denen keine erfolgreich wa
AKTUALISIERE
Wenn möglich, sollte dies programmgesteuert erfolgen.
UPDATE 2
weitewie würde ich gehen, um die Ansicht erhöht zu halten, sobald es animiert hat?