Skip to content

Commit

Permalink
Use layer name instead of keypathName
Browse files Browse the repository at this point in the history
  • Loading branch information
greggiacovelli committed Nov 2, 2021
1 parent 52e1a29 commit 2099504
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lottie/src/main/java/com/airbnb/lottie/TextDelegate.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ public TextDelegate(@SuppressWarnings("NullableProblems") LottieDrawable drawabl
/**
* Override this to replace the animation text with something dynamic. This can be used for
* translations or custom data.
* @param keyPathName the name of the layer with text
* @param layerName the name of the layer with text
* @param input the string at the layer with text
* @return a String to use for the specific data, by default this is the same as getText(input)
*/
public String getText(String keyPathName, String input) {
public String getText(String layerName, String input) {
return getText(input);
}

Expand Down Expand Up @@ -94,11 +94,11 @@ public void invalidateAllText() {
}

@RestrictTo(RestrictTo.Scope.LIBRARY)
public final String getTextInternal(String keyPathName, String input) {
public final String getTextInternal(String layerName, String input) {
if (cacheText && stringMap.containsKey(input)) {
return stringMap.get(input);
}
String text = getText(keyPathName, input);
String text = getText(layerName, input);
if (cacheText) {
stringMap.put(input, text);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import com.airbnb.lottie.model.DocumentData.Justification;
import com.airbnb.lottie.model.Font;
import com.airbnb.lottie.model.FontCharacter;
import com.airbnb.lottie.model.KeyPath;
import com.airbnb.lottie.model.animatable.AnimatableTextProperties;
import com.airbnb.lottie.model.content.ShapeGroup;
import com.airbnb.lottie.utils.Utils;
Expand Down

0 comments on commit 2099504

Please sign in to comment.