How to implement the favorite functionality in the android gridview -
i'm having app, i'm display information in gridview. need add favorite functionality same gridview. please me this. tried googling, no luck.
you can use custom checkbox favorite in gridview items
here code checkbox
<checkbox android:id="@+id/checkbox_favorite" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_centervertical="true" android:button="@drawable/customdrawablecheckbox" android:layout_marginleft="10dp"/>
here code custom drawable
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_checked="false" android:drawable="@drawable/ic_action_favorite" /> <item android:state_checked="true" android:drawable="@drawable/ic_action_favoritecheck" /> <item android:drawable="@drawable/ic_action_favorite" />
Comments
Post a Comment