android - RecyclerView Item drawable states not working -
i using recyclerview. has gridlayoutmanager , contains/displays grid of images using glide/picasso library. item in recyclerview has following layout.
<?xml version="1.0" encoding="utf-8"?> <framelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/item_recycler_view" android:clickable="true" android:focusable="true" android:foreground="@drawable/item_recycler_view"> <imageview android:id="@+id/savedphoto" android:layout_width="match_parent" android:layout_height="wrap_content" android:adjustviewbounds="true" android:scaletype="centercrop" android:transitionname="imagescale" />
i have set following states drawable(item_recycler_view) parent framelayout.
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@android:color/holo_red_dark" android:state_selected="true" /> <item android:drawable="@android:color/holo_red_dark" android:state_pressed="true" /> <item android:drawable="@android:color/transparent" />
i change in state not take place on pressing item in recyclerview.
how set different drawables different states of recyclerview item while continuing use picasso/glide ??
Comments
Post a Comment