Я пытаюсь реализовать анимацию изменения размера с ConstraintLayout
в качестве корневого макета.
Вот мой код:
AdditiveAnimator().targets(waveView).setDuration(2000)
.height((waveView.height.toFloat()*1.5f).toInt())
.width((waveView.width.toFloat()*1.5).toInt())
.setInterpolator( DecelerateInterpolator())
.setRepeatCount(Animation.INFINITE)
.start()
Обратите внимание, что это сторонняя библиотека анимации.
И это мой XML вид:
<View
android:id="@+id/wave_view"
android:layout_width="@dimen/_160sdp"
android:layout_height="@dimen/_160sdp"
android:background="@drawable/wave_background"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.35"
/>
Это приводит к дисбалансу анимации. Я имею в виду следующее:
![result with bias](https://i.stack.imgur.com/R3LFz.png)
Теперь, когда я убираю смещение, получается:
![result without bias](https://i.stack.imgur.com/CDzPX.png)
Что я должен сделать, чтобы достичь желаемых результатов. Должен ли я использовать другой корневой макет?