I have a RecyclerView that implements a linear list of string items.
I want the list item to have a secondary action, 'share', to the right of each item. I created a compound drawable like Google suggested, in XML, but how do I access the drawable and set a OnClickListener()
on it? Am I better off just having two elements?
Compound Drawable TextView in my list item layout:
<TextView
android:id="@+id/item"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/text_margin"
android:textSize="17sp"
android:layout_marginTop="1dp"
android:background="#101010"
android:drawableRight="@drawable/ic_share_white_24dp"
android:textColor="#fff"
android:textAppearance="?attr/textAppearanceListItem" />