Skip to content

Commit

Permalink
Fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
gpeal committed Dec 29, 2023
1 parent f131834 commit de11798
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,11 @@ class LottieClipSpecTest {
LongSparseArray(),
emptyMap(),
emptyMap(),
1f,
SparseArrayCompat(),
emptyMap(),
markers,
)
return composition
}
}
}
5 changes: 3 additions & 2 deletions lottie/src/main/java/com/airbnb/lottie/LottieComposition.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class LottieComposition {
private final HashSet<String> warnings = new HashSet<>();
private Map<String, List<Layer>> precomps;
private Map<String, LottieImageAsset> images;
private float imagesDpScale = Utils.dpScale();
private float imagesDpScale;
/**
* Map of font names to fonts
*/
Expand Down Expand Up @@ -75,7 +75,7 @@ public class LottieComposition {
@RestrictTo(RestrictTo.Scope.LIBRARY)
public void init(Rect bounds, float startFrame, float endFrame, float frameRate,
List<Layer> layers, LongSparseArray<Layer> layerMap, Map<String,
List<Layer>> precomps, Map<String, LottieImageAsset> images,
List<Layer>> precomps, Map<String, LottieImageAsset> images, float imagesDpScale,
SparseArrayCompat<FontCharacter> characters, Map<String, Font> fonts,
List<Marker> markers) {
this.bounds = bounds;
Expand All @@ -86,6 +86,7 @@ public void init(Rect bounds, float startFrame, float endFrame, float frameRate,
this.layerMap = layerMap;
this.precomps = precomps;
this.images = images;
this.imagesDpScale = imagesDpScale;
this.characters = characters;
this.fonts = fonts;
this.markers = markers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public static LottieComposition parse(JsonReader reader) throws IOException {
Rect bounds = new Rect(0, 0, scaledWidth, scaledHeight);

composition.init(bounds, startFrame, endFrame, frameRate, layers, layerMap, precomps,
images, characters, fonts, markers);
images, Utils.dpScale(), characters, fonts, markers);

return composition;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ public void setup() {
@SuppressWarnings("SameParameterValue")
private LottieComposition createComposition(int startFrame, int endFrame) {
LottieComposition composition = new LottieComposition();
composition.init(new Rect(), startFrame, endFrame, 1000, new ArrayList<Layer>(),
new LongSparseArray<Layer>(0), new HashMap<String, List<Layer>>(0),
new HashMap<String, LottieImageAsset>(0), new SparseArrayCompat<FontCharacter>(0),
new HashMap<String, Font>(0), new ArrayList<Marker>());
composition.init(new Rect(), startFrame, endFrame, 1000, new ArrayList<>(),
new LongSparseArray<>(0), new HashMap<>(0),
new HashMap<>(0), 1f, new SparseArrayCompat<>(0),
new HashMap<>(0), new ArrayList<>());
return composition;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ private LottieValueAnimator createAnimator() {

private LottieComposition createComposition(int startFrame, int endFrame) {
LottieComposition composition = new LottieComposition();
composition.init(new Rect(), startFrame, endFrame, 1000, new ArrayList<Layer>(),
new LongSparseArray<Layer>(0), new HashMap<String, List<Layer>>(0),
new HashMap<String, LottieImageAsset>(0), new SparseArrayCompat<FontCharacter>(0),
new HashMap<String, Font>(0), new ArrayList<Marker>());
composition.init(new Rect(), startFrame, endFrame, 1000, new ArrayList<>(),
new LongSparseArray<>(0), new HashMap<>(0),
new HashMap<>(0), 1f, new SparseArrayCompat<>(0),
new HashMap<>(0), new ArrayList<>());
return composition;
}

Expand Down

0 comments on commit de11798

Please sign in to comment.