Package com.airbnb.lottie
Class TextDelegate
- java.lang.Object
-
- com.airbnb.lottie.TextDelegate
-
public class TextDelegate extends java.lang.ObjectExtend this class to replace animation text with custom text. This can be useful to handle translations. The only method you should have to override isgetText(String).
-
-
Constructor Summary
Constructors Constructor Description TextDelegate(LottieAnimationView animationView)TextDelegate(LottieDrawable drawable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetTextInternal(java.lang.String input)voidinvalidateAllText()Invalidates all cached stringsvoidinvalidateText(java.lang.String input)Invalidates a cached string with the given input.voidsetCacheText(boolean cacheText)Sets whether or notTextDelegatewill cache (memoize) the results of getText.voidsetText(java.lang.String input, java.lang.String output)Update the text that will be rendered for the given input text.
-
-
-
Constructor Detail
-
TextDelegate
public TextDelegate(LottieAnimationView animationView)
-
TextDelegate
public TextDelegate(LottieDrawable drawable)
-
-
Method Detail
-
setText
public void setText(java.lang.String input, java.lang.String output)Update the text that will be rendered for the given input text.
-
setCacheText
public void setCacheText(boolean cacheText)
Sets whether or notTextDelegatewill cache (memoize) the results of getText. If this isn't necessary then set it to false.
-
invalidateText
public void invalidateText(java.lang.String input)
Invalidates a cached string with the given input.
-
invalidateAllText
public void invalidateAllText()
Invalidates all cached strings
-
getTextInternal
public final java.lang.String getTextInternal(java.lang.String input)
-
-