CircleImageView превратился в квадрат - PullRequest
0 голосов
/ 18 декабря 2018

У меня есть CirceImageView, как показано ниже

<de.hdodenhof.circleimageview.CircleImageView
    android:id="@+id/circleImageView_right_arrow"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/ic_keyboard_arrow_right"
    android:layout_marginLeft="20dp"
    android:layout_marginStart="20dp"
    android:background="@drawable/imageview_border"
    android:clickable="true"
    android:focusable="true"/>

Файл imageview_border.xml выглядит так, как показано ниже

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <!--<stroke
        android:width="5dp"
        android:color="@color/light_green" />-->
    <corners
        android:radius="1000dp"   >
    </corners>
    <!--<solid
        android:color="@color/light_green">
    </solid>-->
</shape>

Когда я применяю анимацию к CircleImageView, представление превращается в квадрат.Почему это происходит и как я могу избежать превращения его в квадрат?

int colorFrom = getResources().getColor(R.color.light_green); // The color to change from
int colorTo = getResources().getColor(R.color.colorPrimary); // The color to change to
ValueAnimator colorAnimation = ValueAnimator.ofObject(new ArgbEvaluator(), colorFrom, colorTo);
        colorAnimation.setDuration(1000); // milliseconds
        colorAnimation.setRepeatCount(-1); // INFINITE
        colorAnimation.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

            @Override
            public void onAnimationUpdate(ValueAnimator animator) {
                mRightArrowCircleImageView.setBackgroundColor((int) animator.getAnimatedValue());
            }
        });
        colorAnimation.start();
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...