[add] 心形资源替换-事件面板适配新UI

This commit is contained in:
liujing
2020-11-23 16:42:00 +08:00
parent 6eb97f55e7
commit beb429d3af
11 changed files with 33 additions and 5 deletions

View File

@@ -4,6 +4,7 @@ import android.animation.Animator;
import android.animation.AnimatorInflater;
import android.animation.AnimatorSet;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;
@@ -36,8 +37,16 @@ public class HeartLikeView extends LinearLayout implements Animator.AnimatorList
public HeartLikeView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
inflate(context, R.layout.view_heart_like, this);
mIllegalParkingLike = findViewById(R.id.ivIllegalParkingLike);
TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.HeartLikeView, defStyleAttr,
0);
boolean showGrayBack = typedArray.getBoolean(R.styleable.HeartLikeView_showGrayBack, false);
if (showGrayBack) {
inflate(context, R.layout.view_heart_like_gray_back, this);
mIllegalParkingLike = findViewById(R.id.ivLikeForGrayBack);
} else {
inflate(context, R.layout.view_heart_like, this);
mIllegalParkingLike = findViewById(R.id.ivIllegalParkingLike);
}
setOnClickListener(v -> {
if (!isAnimator) {