ノーマルプレスのリップル効果を実現する方法についていくつかの基本的な知識があります。このような長いリプル効果を実現する方法
How to set state_selected in ripple drawable
私は、このような長押し波及効果を達成できるか、疑問に思いました。
- 押されると全体の項目が強調表示されます。
- しばらく押すと、リップルは指が押された領域から伝播を開始します。
文言からはっきりと説明するのはかなり難しいです。私はそのような効果を示すためにビデオを添付します。
https://www.youtube.com/watch?v=ebOYnGM0HCc
私は、このような長押し波及効果を達成する方法を知っているかもしれませんか?
これは、通常の波及効果がどのように見えるかです:一般的な方法を使用して達成されるhttps://www.youtube.com/watch?v=OJ_WRFy7pWM
。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="demo.org.myapplication.MainActivity">
<View
android:layout_width="250dp"
android:layout_height="250dp"
android:clickable="true"
android:background="?attr/selectableItemBackground" />
</LinearLayout>
あなたは 'selectableItemBackgroundBorderless'を実験しましたか? – azizbekian