プレスアイテムに二重の波及効果があります(アイテムの中心からの波及効果と、触れたポイントからの秒)。ここに私の問題のスクリーンショットがあります:
ただし、これは最初のアイテムでのみ発生し、他のアイテムでは波及効果がうまく機能します。私はこのudacity プロジェクトに従っていますが、同じ問題があることに気付きました。
私が使用しているリソースは次のとおりです。
drawable-v21/touch_selector.xml
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<ripple android:color="@color/grey" />
</item>
<item android:drawable="@color/light_blue" android:state_activated="true" />
<item android:drawable="@android:color/transparent" />
</selector>
行項目.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/touch_selector"
android:minHeight="?android:attr/listPreferredItemHeight"
android:orientation="horizontal">
...
</LinearLayout>
fragment_main.xml
...
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="@null"
tools:listitem="@layout/row_item" />
...
押されたアイテムに対するこの二重の波及効果を修正するにはどうすればよいですか? (繰り返しますが、これは最初の項目で発生するだけで、他の項目はうまく機能します)。
ソースコードは次のとおりです: https://github.com/epool/SpotifyStreamer/tree/stage-2