question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dynamically setting text doesn't reflect after reverting animation

See original GitHub issue

I am using CircularProgressButton in XML like this

<br.com.simplepass.loadingbutton.customViews.CircularProgressButton
        android:id="@+id/btnSelfCheckInCheckOut"
        style="@style/Widget.MaterialComponents.Button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:spinning_bar_color="@color/color_on_primary"
        tools:text="Check In"
        tools:visibility="visible" />`

and button setting the text on button inside my fragment and start the animation like this btnSelfCheckInCheckOut.startAnimation() and when I revert the animation the dynamically applied text is lost. I found a workout for this by calling saveInitialState() after changing text.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
leandroBorgesFerreiracommented, Nov 1, 2019

Hello @somesh-basicx. You’re right, I can reproduce this bug. Thanks for catching this! I’ll take a look and fix it as soon as I can. Mean while, you can workaround this by using the call back in the revertAnimation():

val buttonText = buttonTest1.text

buttonTest1.startAnimation()
buttonTest1.revertAnimation {
        buttonTest1.text = buttonText
}
0reactions
leandroBorgesFerreiracommented, Mar 23, 2021

I know that I’m answering this several months later… But the Java workaround was always available:

progressButton.revertAnimation(new OnAnimationEndListener() {
            @Override
            public void onAnimationEnd() {
                //Change the text here!!
            }
        });
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to restart updated animation after dynamically changing ...
I'm trying to create a marquee (yes, I've done LOTS of searching on that topic first) using animated text-indent . I prefer this...
Read more >
Sequence Text behavior controls in Motion - Apple Support
In Motion, use onscreen controls to build custom text sequence animations using the Sequence Text behavior.
Read more >
After Effects: Why does my background revert to black when I ...
Solved: For a recent project, I chose a deep red background, but when I exported it, it was black! Thanks for any help....
Read more >
Animating from "display: block" to "display: none"
Why Doesn't This Work? · When the element is visible, first animate the opacity, then, when that's finished, make it display: none ....
Read more >
Documentation for HAniS - the HTML5 Image AnimationS ...
The HTML5 AnimationS webapp for animating a sequence of single images on your web page, coded in JavaScript with many configuration options.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found