androidkotlinripple

Native Round Ripple Effect For ImageView


I want Native Round Ripple Effect for my Imageview. I have used "selectableItemBackgroundBorderless" but ripple effect appears with box.. Check below code for reference.. Thanks in Advance!!

 <ImageView
                android:id="@+id/ivAnswerListDownVote"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/dp_8"
                android:clickable="true"
                android:focusable="true"
                android:foreground="?attr/selectableItemBackgroundBorderless"
                android:src="@drawable/ic_outline_thumb_down_alt_24"
                tools:targetApi="m" />

Solution

  • You should use

    android:background="?attr/selectableItemBackgroundBorderless"