I am having a double ripple effect on press item(a ripple effect from center of the item and a second from the point touched), here is a screenshot of my problem:
But this only happen on the first item, in the others the ripple effect works well. I am following this udacity project and I did realize that they have the same problem.
Here are my resources I am using:
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>
row_item.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" />
...
How can I fix this double ripple effect on item pressed? (Again, this just happen in the first item, the others work well).
Here is the source code: https://github.com/epool/SpotifyStreamer/tree/stage-2
@epool,
I downloaded your project and ran it. The problem occurred not only on the first item of the list, but on others as well. I did notice that it was inconsistent though, it didn't happen every single time.
It seems like you might have set the ripple effect, or at least enabled it, on a different place as well.
If you simply delete the line of code below, it should work just fine! =]
Just on a side note, I clicked multiple times on different items of the list to see how they would behave, and by doing that, I got the following error:
That's on your Binder.java file, on line 446. So you might want to address that.
If you have any other question, please let me know.