Search code examples
androidstringanimationsettext

Call TextSwitcher's SetText without using the fade animation


I'm trying to implement a TextSwitcher in my calculator app, it works and animates fine, but under some circumstances I want it NOT to animate the Text Changing process (change text like a simple textView)

Example:

Button A clicked --> Change the Value with a nice fade animation
Button B clicked --> Change The Value without any particular animation

what should I do? Is there another method available for setting text without the animation?


Solution

  • Yes: setCurrentText().

    Sets the text of the text view that is currently showing. This does not perform the animations.