In my application I want to create a ripple which fills the whole view. Because it doesn't worked properly I created a minimal example app and tried it there but with no success.
My Layout looks like this:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent" android:padding="16dp">
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/ripple"
android:onClick="onViewClicked" />
</LinearLayout>
And my drawable is defined like this:
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="#1E88E5"
android:radius="0dp">
<item
android:id="@android:id/mask"
android:drawable="@android:color/white" />
</ripple>
Here is a video how it looks currently. I want that the circle (I think its called hotspot officially) grows from the middel until it fills the whole View
. I'm not talking about the radius of the ripple which is consciously set to 0dp here. Do you have any ideas how I can achieve this?
EDIT: In the end I want to achieve something like this.
For everyone who do not want to read all the answers: I managed to implement it and create a repo for this. Fell free to use this in your project and send me pull requests.