I am able to setup a listview using custom adapter which shows correct output.each list item also has an gradient style see drawable.xml below how do I change the item background to some other gradient on tapping any of them. can I set different gradients for each of the items.?
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:startColor="#FFFAFAFA"
android:centerColor="#FFFFFFFF"
android:endColor="#FFFAFAFA"
android:angle="90"/>
</shape>
My files…
activity_main.xml….Main xml file
MainActivity.java….Main activity
Item.java…. item selector method
ItemAdaptor…. custom adapter
list_item.xml….. item (textView) styling
I got a color change on tapping with
with res/values/listitem_states.xml:
I guess you can easily adapt that for gradients.