Я создал список и добавил границу к его элементам.Эффект пульсации над фактической границей
что-то вроде этого:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:baselineAligned="false"
android:orientation="horizontal"
android:background="@drawable/listviewborderbox"
android:padding="10dp" >
<LinearLayout
android:id="@+id/sharedbyyouNameLayout"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight=".70"
android:gravity="center"
android:orientation="vertical" >
<TextView
android:id="@+id/sharedbyyoutext"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:text="@string/sampletext1"
android:textColor="@color/blackText"
android:textSize="14sp" />
<TextView
android:id="@+id/sharedbyyouselected"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left"
android:text="@string/sampletext2"
android:textColor="@color/blackText"
android:textSize="16sp"
tools:ignore="RtlHardcoded" />
</LinearLayout>
<LinearLayout
android:id="@+id/sharedbyyouLayoutforarrow"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight=".10"
android:gravity="center"
android:orientation="vertical" >
<ImageView
android:id="@+id/arrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_next"
tools:ignore="RtlSymmetry,RtlHardcoded,ContentDescription" />
</LinearLayout>
</LinearLayout>
И у меня есть пульсация значение эффекта в вытяжке-v21 так:
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="@android:color/white"> <item android:drawable="@color/footercolor"/> </ripple>
пограничную форму XML в вытяжке папке это:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="@color/colorforbodybox" />
<corners android:radius="10dip"/>
<stroke android:width="2dip" android:color="@color/colorforborder" />
</shape>
Эффект пульсации работает, но эффект пульсации отображается за пределами линии границы, которую я нарисовал. Пожалуйста, проверьте рис ниже:
Как сделать мультипликационный эффект не пересекать границу в списке?