--wip-- [skip ci]
diff --git a/lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java b/lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java
index df44788..9f01aa5 100644
--- a/lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java
+++ b/lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java
@@ -66,7 +66,7 @@
*
* @see <a href="http://airbnb.io/lottie">Full Documentation</a>
*/
-@SuppressWarnings({"unused", "WeakerAccess"}) public class LottieAnimationView extends AppCompatImageView {
+@SuppressWarnings({"WeakerAccess"}) public class LottieAnimationView extends AppCompatImageView {
private static final String TAG = LottieAnimationView.class.getSimpleName();
private static final LottieListener<Throwable> DEFAULT_FAILURE_LISTENER = new LottieListener<Throwable>() {
@@ -374,7 +374,7 @@
*
* {@link R.attr#lottie_cacheComposition}
*/
- public void setCacheComposition(boolean cacheComposition) {
+ public void setCacheComposition(boolean cacheComposition) {
this.cacheComposition = cacheComposition;
}
@@ -598,7 +598,7 @@
}
/**
- * Plays the animation from the beginning. If speed is < 0, it will start at the end
+ * Plays the animation from the beginning. If speed is {@literal <} 0, it will start at the end
* and play towards the beginning
*/
@MainThread
@@ -612,7 +612,7 @@
}
/**
- * Continues playing the animation from its current position. If speed < 0, it will play backwards
+ * Continues playing the animation from its current position. If speed {@literal <} 0, it will play backwards
* from the current position.
*/
@MainThread
@@ -737,14 +737,14 @@
}
/**
- * Sets the playback speed. If speed < 0, the animation will play backwards.
+ * Sets the playback speed. If speed {@literal <} 0, the animation will play backwards.
*/
public void setSpeed(float speed) {
lottieDrawable.setSpeed(speed);
}
/**
- * Returns the current playback speed. This will be < 0 if the animation is playing backwards.
+ * Returns the current playback speed. This will be {@literal <} 0 if the animation is playing backwards.
*/
public float getSpeed() {
return lottieDrawable.getSpeed();
diff --git a/lottie/src/main/java/com/airbnb/lottie/LottieComposition.java b/lottie/src/main/java/com/airbnb/lottie/LottieComposition.java
index d6a554f..a613902 100644
--- a/lottie/src/main/java/com/airbnb/lottie/LottieComposition.java
+++ b/lottie/src/main/java/com/airbnb/lottie/LottieComposition.java
@@ -9,7 +9,6 @@
import androidx.annotation.WorkerThread;
import androidx.collection.LongSparseArray;
import androidx.collection.SparseArrayCompat;
-import android.util.Log;
import com.airbnb.lottie.model.Font;
import com.airbnb.lottie.model.FontCharacter;
@@ -20,7 +19,6 @@
import org.json.JSONObject;
-import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
@@ -178,7 +176,7 @@
@Nullable
public Marker getMarker(String markerName) {
int size = markers.size();
- for (int i = 0; i < markers.size(); i++) {
+ for (int i = 0; i < size; i++) {
Marker marker = markers.get(i);
if (marker.matchesName(markerName)) {
return marker;
@@ -223,6 +221,7 @@
/**
* @see LottieCompositionFactory#fromAsset(Context, String)
*/
+ @SuppressWarnings("deprecation")
@Deprecated
public static Cancellable fromAssetFileName(Context context, String fileName, OnCompositionLoadedListener l) {
ListenerAdapter listener = new ListenerAdapter(l);
@@ -233,6 +232,7 @@
/**
* @see LottieCompositionFactory#fromRawRes(Context, int)
*/
+ @SuppressWarnings("deprecation")
@Deprecated
public static Cancellable fromRawFile(Context context, @RawRes int resId, OnCompositionLoadedListener l) {
ListenerAdapter listener = new ListenerAdapter(l);
@@ -241,8 +241,9 @@
}
/**
- * @see LottieCompositionFactory#fromJsonInputStream(InputStream)
+ * @see LottieCompositionFactory#fromJsonInputStream(InputStream, String)
*/
+ @SuppressWarnings("deprecation")
@Deprecated
public static Cancellable fromInputStream(InputStream stream, OnCompositionLoadedListener l) {
ListenerAdapter listener = new ListenerAdapter(l);
@@ -251,8 +252,9 @@
}
/**
- * @see LottieCompositionFactory#fromJsonString(String)
+ * @see LottieCompositionFactory#fromJsonString(String, String)
*/
+ @SuppressWarnings("deprecation")
@Deprecated
public static Cancellable fromJsonString(String jsonString, OnCompositionLoadedListener l) {
ListenerAdapter listener = new ListenerAdapter(l);
@@ -261,8 +263,9 @@
}
/**
- * @see LottieCompositionFactory#fromJsonReader(JsonReader)
+ * @see LottieCompositionFactory#fromJsonReader(JsonReader, String)
*/
+ @SuppressWarnings("deprecation")
@Deprecated
public static Cancellable fromJsonReader(JsonReader reader, OnCompositionLoadedListener l) {
ListenerAdapter listener = new ListenerAdapter(l);
@@ -281,7 +284,7 @@
}
/**
- * @see LottieCompositionFactory#fromJsonInputStreamSync(InputStream)
+ * @see LottieCompositionFactory#fromJsonInputStreamSync(InputStream, String)
*/
@Nullable
@WorkerThread
@@ -293,7 +296,7 @@
/**
* This will now auto-close the input stream!
*
- * @see LottieCompositionFactory#fromJsonInputStreamSync(InputStream, boolean)
+ * @see LottieCompositionFactory#fromJsonInputStreamSync(InputStream, String)
*/
@Nullable
@WorkerThread
@@ -306,7 +309,7 @@
}
/**
- * @see LottieCompositionFactory#fromJsonSync(JSONObject)
+ * @see LottieCompositionFactory#fromJsonSync(JSONObject, String)
*/
@Nullable
@WorkerThread
@@ -316,7 +319,7 @@
}
/**
- * @see LottieCompositionFactory#fromJsonStringSync(String)
+ * @see LottieCompositionFactory#fromJsonStringSync(String, String)
*/
@Nullable
@WorkerThread
@@ -326,15 +329,16 @@
}
/**
- * @see LottieCompositionFactory#fromJsonReaderSync(JsonReader)
+ * @see LottieCompositionFactory#fromJsonReaderSync(JsonReader, String)
*/
@Nullable
@WorkerThread
@Deprecated
- public static LottieComposition fromJsonSync(JsonReader reader) throws IOException {
+ public static LottieComposition fromJsonSync(JsonReader reader) {
return LottieCompositionFactory.fromJsonReaderSync(reader, null).getValue();
}
+ @SuppressWarnings("deprecation")
private static final class ListenerAdapter implements LottieListener<LottieComposition>, Cancellable {
private final OnCompositionLoadedListener listener;
private boolean cancelled = false;
diff --git a/lottie/src/main/java/com/airbnb/lottie/LottieCompositionFactory.java b/lottie/src/main/java/com/airbnb/lottie/LottieCompositionFactory.java
index 344bf98..b263543 100644
--- a/lottie/src/main/java/com/airbnb/lottie/LottieCompositionFactory.java
+++ b/lottie/src/main/java/com/airbnb/lottie/LottieCompositionFactory.java
@@ -30,7 +30,6 @@
import okio.BufferedSource;
import okio.Okio;
-import static com.airbnb.lottie.parser.moshi.JsonReader.of;
import static com.airbnb.lottie.utils.Utils.closeQuietly;
import static okio.Okio.buffer;
import static okio.Okio.source;
@@ -63,7 +62,7 @@
/**
* Set the maximum number of compositions to keep cached in memory.
- * This must be > 0.
+ * This must be {@literal >} 0.
*/
public static void setMaxCacheSize(int size) {
LottieCompositionCache.getInstance().resize(size);
@@ -310,7 +309,7 @@
@WorkerThread
private static LottieResult<LottieComposition> fromJsonInputStreamSync(InputStream stream, @Nullable String cacheKey, boolean close) {
try {
- return fromJsonReaderSync(of(buffer(source(stream))), cacheKey);
+ return fromJsonReaderSync(JsonReader.of(buffer(source(stream))), cacheKey);
} finally {
if (close) {
closeQuietly(stream);
@@ -365,7 +364,7 @@
ByteArrayInputStream stream = new ByteArrayInputStream(json.getBytes());
- return fromJsonReaderSync(of(buffer(source(stream))), cacheKey);
+ return fromJsonReaderSync(JsonReader.of(buffer(source(stream))), cacheKey);
}
public static LottieTask<LottieComposition> fromJsonReader(final JsonReader reader, @Nullable final String cacheKey) {
@@ -439,7 +438,7 @@
} else if (entry.getName().equalsIgnoreCase("manifest.json")) { //ignore .lottie manifest
inputStream.closeEntry();
} else if (entry.getName().contains(".json")) {
- com.airbnb.lottie.parser.moshi.JsonReader reader = of(buffer(source(inputStream)));
+ com.airbnb.lottie.parser.moshi.JsonReader reader = JsonReader.of(buffer(source(inputStream)));
composition = LottieCompositionFactory.fromJsonReaderSyncInternal(reader, null, false).getValue();
} else if (entryName.contains(".png") || entryName.contains(".webp")) {
String[] splitName = entryName.split("/");
diff --git a/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java b/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java
index fc409bd..007acba 100644
--- a/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java
+++ b/lottie/src/main/java/com/airbnb/lottie/LottieDrawable.java
@@ -430,7 +430,7 @@
}
/**
- * Plays the animation from the beginning. If speed is < 0, it will start at the end
+ * Plays the animation from the beginning. If speed is {@literal <} 0, it will start at the end
* and play towards the beginning
*/
@MainThread
@@ -461,7 +461,7 @@
}
/**
- * Continues playing the animation from its current position. If speed < 0, it will play backwards
+ * Continues playing the animation from its current position. If speed {@literal <} 0, it will play backwards
* from the current position.
*/
@MainThread
@@ -715,14 +715,14 @@
}
/**
- * Sets the playback speed. If speed < 0, the animation will play backwards.
+ * Sets the playback speed. If speed {@literal <} 0, the animation will play backwards.
*/
public void setSpeed(float speed) {
animator.setSpeed(speed);
}
/**
- * Returns the current playback speed. This will be < 0 if the animation is playing backwards.
+ * Returns the current playback speed. This will be {@literal <} 0 if the animation is playing backwards.
*/
public float getSpeed() {
return animator.getSpeed();
diff --git a/lottie/src/main/java/com/airbnb/lottie/model/LottieCompositionCache.java b/lottie/src/main/java/com/airbnb/lottie/model/LottieCompositionCache.java
index 1cdcce7..c219f75 100644
--- a/lottie/src/main/java/com/airbnb/lottie/model/LottieCompositionCache.java
+++ b/lottie/src/main/java/com/airbnb/lottie/model/LottieCompositionCache.java
@@ -43,7 +43,7 @@
/**
* Set the maximum number of compositions to keep cached in memory.
- * This must be > 0.
+ * This must be {@literal >} 0.
*/
public void resize(int size) {
cache.resize(size);
diff --git a/lottie/src/main/java/com/airbnb/lottie/parser/moshi/JsonReader.java b/lottie/src/main/java/com/airbnb/lottie/parser/moshi/JsonReader.java
index 12f4506..ffa7bf5 100644
--- a/lottie/src/main/java/com/airbnb/lottie/parser/moshi/JsonReader.java
+++ b/lottie/src/main/java/com/airbnb/lottie/parser/moshi/JsonReader.java
@@ -62,8 +62,7 @@
* skip the value's nested tokens, which may otherwise conflict.
*
* <p>If a value may be null, you should first check using {@link #peek()}.
- * Null literals can be consumed using either {@link #nextNull()} or {@link
- * #skipValue()}.
+ * Null literals can be consumed using {@link #skipValue()}.
*
* <h3>Example</h3>
* Suppose we'd like to parse a stream of messages such as the following: <pre> {@code
@@ -364,7 +363,7 @@
}
/**
- * A set of strings to be chosen with {@link #selectName} or {@link #selectString}. This prepares
+ * A set of strings to be chosen with {@link #selectName}. This prepares
* the encoded values of the strings so they can be read directly from the input source.
*/
public static final class Options {
diff --git a/upload_release.sh b/upload_release.sh
index f45edcc..2db186e 100755
--- a/upload_release.sh
+++ b/upload_release.sh
@@ -1,2 +1,2 @@
#!/bin/bash
-./gradlew clean lottie:assembleRelease lottie-compose:assembleRelease lottie:uploadArchives lottie-compose:uploadArchives --rerun-tasks --no-parallel
\ No newline at end of file
+./gradlew clean lottie:assembleRelease lottie-compose:assembleRelease lottie:uploadArchives --rerun-tasks --no-parallel
\ No newline at end of file