[英]How could I change this dependency for Android custom shadow view?
我正在使用以下依赖项,但我不会再使用它,因为我注意到它已被弃用:我正在使用的依赖项
如您所见,这种依赖的 About 说明如下:
因性能不佳而弃用。 Android 自定义阴影视图,可以替换你的 CardView
我正在尝试替换我从 Android 自定义阴影视图的依赖项中使用的内容,因为依赖项 About 说,但我不知道该怎么做。
这就是我使用的:
<com.loopeer.shadow.ShadowView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="14dp"
android:layout_marginEnd="14dp"
android:layout_weight="1"
android:elevation="@dimen/shel"
app:cornerRadiusTL="@dimen/hol"
app:cornerRadiusTR="@dimen/car"
app:shadowMarginLeft="@dimen/shadow"
app:shadowMarginRight="@dimen/margn"
app:shadowRadius="@dimen/radius">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:visibility="visible">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/sign_stp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:padding="6dp"
android:text="@string/sign"
android:textAppearance="@style/Base.TextAppearance.AppCompat.Medium"
android:textColor="@color/red" />
</LinearLayout>
</LinearLayout>
</com.loopeer.shadow.ShadowView>
我还制作了以下 function 来显示卡片视图:
public void showCardView() {
Animation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
LinearLayout.setVisibility(View.VISIBLE);
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
LinearLayout.startAnimation(Animation);
}
在main.activity.java
上面的 function 运行:
showCardView();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.