- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
54 lines
1.6 KiB
Java
54 lines
1.6 KiB
Java
package androidx.core.graphics;
|
|
|
|
import android.graphics.Path;
|
|
import android.graphics.PointF;
|
|
import androidx.annotation.FloatRange;
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.RequiresApi;
|
|
import java.util.ArrayList;
|
|
import java.util.Collection;
|
|
|
|
/* loaded from: classes.dex */
|
|
public final class PathUtils {
|
|
@NonNull
|
|
@RequiresApi(26)
|
|
public static Collection<PathSegment> flatten(@NonNull Path path) {
|
|
return flatten(path, 0.5f);
|
|
}
|
|
|
|
@NonNull
|
|
@RequiresApi(26)
|
|
public static Collection<PathSegment> flatten(@NonNull Path path, @FloatRange(from = 0.0d) float f) {
|
|
float[] approximate = Api26Impl.approximate(path, f);
|
|
int length = approximate.length / 3;
|
|
ArrayList arrayList = new ArrayList(length);
|
|
for (int i = 1; i < length; i++) {
|
|
int i2 = i * 3;
|
|
int i3 = (i - 1) * 3;
|
|
float f2 = approximate[i2];
|
|
float f3 = approximate[i2 + 1];
|
|
float f4 = approximate[i2 + 2];
|
|
float f5 = approximate[i3];
|
|
float f6 = approximate[i3 + 1];
|
|
float f7 = approximate[i3 + 2];
|
|
if (f2 != f5 && (f3 != f6 || f4 != f7)) {
|
|
arrayList.add(new PathSegment(new PointF(f6, f7), f5, new PointF(f3, f4), f2));
|
|
}
|
|
}
|
|
return arrayList;
|
|
}
|
|
|
|
private PathUtils() {
|
|
}
|
|
|
|
@RequiresApi(26)
|
|
public static class Api26Impl {
|
|
private Api26Impl() {
|
|
}
|
|
|
|
public static float[] approximate(Path path, float f) {
|
|
return path.approximate(f);
|
|
}
|
|
}
|
|
}
|