Reputation: 2735
In an Android application, I have a layout containing a TextView
at the top and two elements beneath it: an icon
and another TextView
. The second TextView displays a numerical value that undergoes a counter animation using ValueAnimator
.
Upon completion of this counter animation, in doOnEnd
blcok, I aim to overlay an additional animation. The animation file is available with me.
Specifically, I seek guidance on positioning this overlay animation as follows:
How can I achieve this positioning and overlay of the animation in my Android application? Any insights or guidance would be appreciated. Thank you.
Note - I plan to use the constrain layout. However, if this is possible by using other layouts, I would be happy to use it.
Note - Need to consider text resize / font scaling while implementating.
Upvotes: 0
Views: 70
Reputation: 402
you can match the constraints of your animation to match the positioning of your second one.
android:id="@+id/animation"
app:layout_constraintBottom_toBottomOf="second_text"
app:layout_constraintEnd_toEndOf="second_text"
app:layout_constraintTop_toTopOf="second_text"
app:layout_constraintStart_toTopStart="second_text"
and then use app:layout_constraintHorizontal_bias="float_value"
and app:layout_constraintVertical_bias="float_value"
to move the first text in the correct position. You might have to increase the top padding of the second text view.
Upvotes: 0