Initial commit
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package pl.com.salsoft.sqlitestudioremote;
|
||||
|
||||
import android.app.Service;
|
||||
import android.content.Intent;
|
||||
import android.os.IBinder;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class SQLiteStudioService extends Service {
|
||||
public SQLiteStudioService() {
|
||||
new ArrayList();
|
||||
new ArrayList();
|
||||
}
|
||||
|
||||
@Override // android.app.Service
|
||||
public IBinder onBind(Intent intent) {
|
||||
return null;
|
||||
}
|
||||
}
|
6
sources/pl/droidsonroids/gif/AnimationListener.java
Normal file
6
sources/pl/droidsonroids/gif/AnimationListener.java
Normal file
@@ -0,0 +1,6 @@
|
||||
package pl.droidsonroids.gif;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface AnimationListener {
|
||||
void a(int i);
|
||||
}
|
165
sources/pl/droidsonroids/gif/GifAnimationMetaData.java
Normal file
165
sources/pl/droidsonroids/gif/GifAnimationMetaData.java
Normal file
@@ -0,0 +1,165 @@
|
||||
package pl.droidsonroids.gif;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.res.AssetFileDescriptor;
|
||||
import android.content.res.AssetManager;
|
||||
import android.content.res.Resources;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import java.io.File;
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.Serializable;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Locale;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class GifAnimationMetaData implements Serializable, Parcelable {
|
||||
public static final Parcelable.Creator<GifAnimationMetaData> CREATOR = new Parcelable.Creator<GifAnimationMetaData>() { // from class: pl.droidsonroids.gif.GifAnimationMetaData.1
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public GifAnimationMetaData createFromParcel(Parcel parcel) {
|
||||
return new GifAnimationMetaData(parcel);
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public GifAnimationMetaData[] newArray(int i) {
|
||||
return new GifAnimationMetaData[i];
|
||||
}
|
||||
};
|
||||
private static final long serialVersionUID = 5692363926580237325L;
|
||||
private final int mDuration;
|
||||
private final int mHeight;
|
||||
private final int mImageCount;
|
||||
private final int mLoopCount;
|
||||
private final long mMetadataBytesCount;
|
||||
private final long mPixelsBytesCount;
|
||||
private final int mWidth;
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public long getAllocationByteCount() {
|
||||
return this.mPixelsBytesCount;
|
||||
}
|
||||
|
||||
public long getDrawableAllocationByteCount(GifDrawable gifDrawable, int i) {
|
||||
if (i >= 1 && i <= 65535) {
|
||||
return (this.mPixelsBytesCount / (i * i)) + ((gifDrawable == null || gifDrawable.f.isRecycled()) ? ((this.mWidth * this.mHeight) * 4) / r6 : Build.VERSION.SDK_INT >= 19 ? gifDrawable.f.getAllocationByteCount() : gifDrawable.c());
|
||||
}
|
||||
throw new IllegalStateException("Sample size " + i + " out of range <1, \uffff>");
|
||||
}
|
||||
|
||||
public int getDuration() {
|
||||
return this.mDuration;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return this.mHeight;
|
||||
}
|
||||
|
||||
public int getLoopCount() {
|
||||
return this.mLoopCount;
|
||||
}
|
||||
|
||||
public long getMetadataAllocationByteCount() {
|
||||
return this.mMetadataBytesCount;
|
||||
}
|
||||
|
||||
public int getNumberOfFrames() {
|
||||
return this.mImageCount;
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
return this.mWidth;
|
||||
}
|
||||
|
||||
public boolean isAnimated() {
|
||||
return this.mImageCount > 1 && this.mDuration > 0;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
int i = this.mLoopCount;
|
||||
String format = String.format(Locale.ENGLISH, "GIF: size: %dx%d, frames: %d, loops: %s, duration: %d", Integer.valueOf(this.mWidth), Integer.valueOf(this.mHeight), Integer.valueOf(this.mImageCount), i == 0 ? "Infinity" : Integer.toString(i), Integer.valueOf(this.mDuration));
|
||||
if (!isAnimated()) {
|
||||
return format;
|
||||
}
|
||||
return "Animated " + format;
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
parcel.writeInt(this.mLoopCount);
|
||||
parcel.writeInt(this.mDuration);
|
||||
parcel.writeInt(this.mHeight);
|
||||
parcel.writeInt(this.mWidth);
|
||||
parcel.writeInt(this.mImageCount);
|
||||
parcel.writeLong(this.mMetadataBytesCount);
|
||||
parcel.writeLong(this.mPixelsBytesCount);
|
||||
}
|
||||
|
||||
public GifAnimationMetaData(Resources resources, int i) throws Resources.NotFoundException, IOException {
|
||||
this(resources.openRawResourceFd(i));
|
||||
}
|
||||
|
||||
public GifAnimationMetaData(AssetManager assetManager, String str) throws IOException {
|
||||
this(assetManager.openFd(str));
|
||||
}
|
||||
|
||||
public GifAnimationMetaData(String str) throws IOException {
|
||||
this(new GifInfoHandle(str));
|
||||
}
|
||||
|
||||
public GifAnimationMetaData(File file) throws IOException {
|
||||
this(file.getPath());
|
||||
}
|
||||
|
||||
public GifAnimationMetaData(InputStream inputStream) throws IOException {
|
||||
this(new GifInfoHandle(inputStream));
|
||||
}
|
||||
|
||||
public GifAnimationMetaData(AssetFileDescriptor assetFileDescriptor) throws IOException {
|
||||
this(new GifInfoHandle(assetFileDescriptor));
|
||||
}
|
||||
|
||||
public GifAnimationMetaData(FileDescriptor fileDescriptor) throws IOException {
|
||||
this(new GifInfoHandle(fileDescriptor));
|
||||
}
|
||||
|
||||
public GifAnimationMetaData(byte[] bArr) throws IOException {
|
||||
this(new GifInfoHandle(bArr));
|
||||
}
|
||||
|
||||
public GifAnimationMetaData(ByteBuffer byteBuffer) throws IOException {
|
||||
this(new GifInfoHandle(byteBuffer));
|
||||
}
|
||||
|
||||
public GifAnimationMetaData(ContentResolver contentResolver, Uri uri) throws IOException {
|
||||
this(GifInfoHandle.a(contentResolver, uri));
|
||||
}
|
||||
|
||||
private GifAnimationMetaData(GifInfoHandle gifInfoHandle) {
|
||||
this.mLoopCount = gifInfoHandle.g();
|
||||
this.mDuration = gifInfoHandle.e();
|
||||
this.mWidth = gifInfoHandle.l();
|
||||
this.mHeight = gifInfoHandle.f();
|
||||
this.mImageCount = gifInfoHandle.j();
|
||||
this.mMetadataBytesCount = gifInfoHandle.h();
|
||||
this.mPixelsBytesCount = gifInfoHandle.a();
|
||||
gifInfoHandle.o();
|
||||
}
|
||||
|
||||
private GifAnimationMetaData(Parcel parcel) {
|
||||
this.mLoopCount = parcel.readInt();
|
||||
this.mDuration = parcel.readInt();
|
||||
this.mHeight = parcel.readInt();
|
||||
this.mWidth = parcel.readInt();
|
||||
this.mImageCount = parcel.readInt();
|
||||
this.mMetadataBytesCount = parcel.readLong();
|
||||
this.mPixelsBytesCount = parcel.readLong();
|
||||
}
|
||||
}
|
393
sources/pl/droidsonroids/gif/GifDrawable.java
Normal file
393
sources/pl/droidsonroids/gif/GifDrawable.java
Normal file
@@ -0,0 +1,393 @@
|
||||
package pl.droidsonroids.gif;
|
||||
|
||||
import android.content.res.AssetFileDescriptor;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.ColorFilter;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.PorterDuffColorFilter;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.drawable.Animatable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.SystemClock;
|
||||
import android.widget.MediaController;
|
||||
import java.io.IOException;
|
||||
import java.util.Locale;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import pl.droidsonroids.gif.transforms.Transform;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class GifDrawable extends Drawable implements Animatable, MediaController.MediaPlayerControl {
|
||||
final ScheduledThreadPoolExecutor a;
|
||||
volatile boolean b;
|
||||
long c;
|
||||
private final Rect d;
|
||||
protected final Paint e;
|
||||
final Bitmap f;
|
||||
final GifInfoHandle g;
|
||||
final ConcurrentLinkedQueue<AnimationListener> h;
|
||||
private ColorStateList i;
|
||||
private PorterDuffColorFilter j;
|
||||
private PorterDuff.Mode k;
|
||||
final boolean l;
|
||||
final InvalidationHandler m;
|
||||
private final RenderTask n;
|
||||
private final Rect o;
|
||||
ScheduledFuture<?> p;
|
||||
private int q;
|
||||
private int r;
|
||||
private Transform s;
|
||||
|
||||
public GifDrawable(Resources resources, int i) throws Resources.NotFoundException, IOException {
|
||||
this(resources.openRawResourceFd(i));
|
||||
float a = GifViewUtils.a(resources, i);
|
||||
this.r = (int) (this.g.f() * a);
|
||||
this.q = (int) (this.g.l() * a);
|
||||
}
|
||||
|
||||
private void g() {
|
||||
ScheduledFuture<?> scheduledFuture = this.p;
|
||||
if (scheduledFuture != null) {
|
||||
scheduledFuture.cancel(false);
|
||||
}
|
||||
this.m.removeMessages(-1);
|
||||
}
|
||||
|
||||
private void h() {
|
||||
if (this.l && this.b) {
|
||||
long j = this.c;
|
||||
if (j != Long.MIN_VALUE) {
|
||||
long max = Math.max(0L, j - SystemClock.uptimeMillis());
|
||||
this.c = Long.MIN_VALUE;
|
||||
this.a.remove(this.n);
|
||||
this.p = this.a.schedule(this.n, max, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void i() {
|
||||
this.b = false;
|
||||
this.m.removeMessages(-1);
|
||||
this.g.o();
|
||||
}
|
||||
|
||||
void a(long j) {
|
||||
if (this.l) {
|
||||
this.c = 0L;
|
||||
this.m.sendEmptyMessageAtTime(-1, 0L);
|
||||
} else {
|
||||
g();
|
||||
this.p = this.a.schedule(this.n, Math.max(j, 0L), TimeUnit.MILLISECONDS);
|
||||
}
|
||||
}
|
||||
|
||||
public int b() {
|
||||
int c = this.g.c();
|
||||
return (c == 0 || c < this.g.g()) ? c : c - 1;
|
||||
}
|
||||
|
||||
public int c() {
|
||||
return this.f.getRowBytes() * this.f.getHeight();
|
||||
}
|
||||
|
||||
@Override // android.widget.MediaController.MediaPlayerControl
|
||||
public boolean canPause() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // android.widget.MediaController.MediaPlayerControl
|
||||
public boolean canSeekBackward() {
|
||||
return d() > 1;
|
||||
}
|
||||
|
||||
@Override // android.widget.MediaController.MediaPlayerControl
|
||||
public boolean canSeekForward() {
|
||||
return d() > 1;
|
||||
}
|
||||
|
||||
public int d() {
|
||||
return this.g.j();
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void draw(Canvas canvas) {
|
||||
boolean z;
|
||||
if (this.j == null || this.e.getColorFilter() != null) {
|
||||
z = false;
|
||||
} else {
|
||||
this.e.setColorFilter(this.j);
|
||||
z = true;
|
||||
}
|
||||
Transform transform = this.s;
|
||||
if (transform == null) {
|
||||
canvas.drawBitmap(this.f, this.o, this.d, this.e);
|
||||
} else {
|
||||
transform.a(canvas, this.e, this.f);
|
||||
}
|
||||
if (z) {
|
||||
this.e.setColorFilter(null);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean e() {
|
||||
return this.g.n();
|
||||
}
|
||||
|
||||
public void f() {
|
||||
this.a.execute(new SafeRunnable(this) { // from class: pl.droidsonroids.gif.GifDrawable.1
|
||||
@Override // pl.droidsonroids.gif.SafeRunnable
|
||||
public void a() {
|
||||
if (GifDrawable.this.g.p()) {
|
||||
GifDrawable.this.start();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public int getAlpha() {
|
||||
return this.e.getAlpha();
|
||||
}
|
||||
|
||||
@Override // android.widget.MediaController.MediaPlayerControl
|
||||
public int getAudioSessionId() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override // android.widget.MediaController.MediaPlayerControl
|
||||
public int getBufferPercentage() {
|
||||
return 100;
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public ColorFilter getColorFilter() {
|
||||
return this.e.getColorFilter();
|
||||
}
|
||||
|
||||
@Override // android.widget.MediaController.MediaPlayerControl
|
||||
public int getCurrentPosition() {
|
||||
return this.g.d();
|
||||
}
|
||||
|
||||
@Override // android.widget.MediaController.MediaPlayerControl
|
||||
public int getDuration() {
|
||||
return this.g.e();
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public int getIntrinsicHeight() {
|
||||
return this.r;
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public int getIntrinsicWidth() {
|
||||
return this.q;
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public int getOpacity() {
|
||||
return (!this.g.m() || this.e.getAlpha() < 255) ? -2 : -1;
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void invalidateSelf() {
|
||||
super.invalidateSelf();
|
||||
h();
|
||||
}
|
||||
|
||||
@Override // android.widget.MediaController.MediaPlayerControl
|
||||
public boolean isPlaying() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Animatable
|
||||
public boolean isRunning() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public boolean isStateful() {
|
||||
ColorStateList colorStateList;
|
||||
return super.isStateful() || ((colorStateList = this.i) != null && colorStateList.isStateful());
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
protected void onBoundsChange(Rect rect) {
|
||||
this.d.set(rect);
|
||||
Transform transform = this.s;
|
||||
if (transform != null) {
|
||||
transform.a(rect);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
protected boolean onStateChange(int[] iArr) {
|
||||
PorterDuff.Mode mode;
|
||||
ColorStateList colorStateList = this.i;
|
||||
if (colorStateList == null || (mode = this.k) == null) {
|
||||
return false;
|
||||
}
|
||||
this.j = a(colorStateList, mode);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override // android.widget.MediaController.MediaPlayerControl
|
||||
public void pause() {
|
||||
stop();
|
||||
}
|
||||
|
||||
@Override // android.widget.MediaController.MediaPlayerControl
|
||||
public void seekTo(final int i) {
|
||||
if (i < 0) {
|
||||
throw new IllegalArgumentException("Position is not positive");
|
||||
}
|
||||
this.a.execute(new SafeRunnable(this) { // from class: pl.droidsonroids.gif.GifDrawable.2
|
||||
@Override // pl.droidsonroids.gif.SafeRunnable
|
||||
public void a() {
|
||||
GifDrawable gifDrawable = GifDrawable.this;
|
||||
gifDrawable.g.a(i, gifDrawable.f);
|
||||
this.a.m.sendEmptyMessageAtTime(-1, 0L);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void setAlpha(int i) {
|
||||
this.e.setAlpha(i);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void setColorFilter(ColorFilter colorFilter) {
|
||||
this.e.setColorFilter(colorFilter);
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
@Deprecated
|
||||
public void setDither(boolean z) {
|
||||
this.e.setDither(z);
|
||||
invalidateSelf();
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void setFilterBitmap(boolean z) {
|
||||
this.e.setFilterBitmap(z);
|
||||
invalidateSelf();
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void setTintList(ColorStateList colorStateList) {
|
||||
this.i = colorStateList;
|
||||
this.j = a(colorStateList, this.k);
|
||||
invalidateSelf();
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public void setTintMode(PorterDuff.Mode mode) {
|
||||
this.k = mode;
|
||||
this.j = a(this.i, mode);
|
||||
invalidateSelf();
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Drawable
|
||||
public boolean setVisible(boolean z, boolean z2) {
|
||||
boolean visible = super.setVisible(z, z2);
|
||||
if (!this.l) {
|
||||
if (z) {
|
||||
if (z2) {
|
||||
f();
|
||||
}
|
||||
if (visible) {
|
||||
start();
|
||||
}
|
||||
} else if (visible) {
|
||||
stop();
|
||||
}
|
||||
}
|
||||
return visible;
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Animatable, android.widget.MediaController.MediaPlayerControl
|
||||
public void start() {
|
||||
synchronized (this) {
|
||||
if (this.b) {
|
||||
return;
|
||||
}
|
||||
this.b = true;
|
||||
a(this.g.q());
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.graphics.drawable.Animatable
|
||||
public void stop() {
|
||||
synchronized (this) {
|
||||
if (this.b) {
|
||||
this.b = false;
|
||||
g();
|
||||
this.g.r();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return String.format(Locale.ENGLISH, "GIF: size: %dx%d, frames: %d, error: %d", Integer.valueOf(this.g.l()), Integer.valueOf(this.g.f()), Integer.valueOf(this.g.j()), Integer.valueOf(this.g.i()));
|
||||
}
|
||||
|
||||
public GifDrawable(AssetFileDescriptor assetFileDescriptor) throws IOException {
|
||||
this(new GifInfoHandle(assetFileDescriptor), null, null, true);
|
||||
}
|
||||
|
||||
GifDrawable(GifInfoHandle gifInfoHandle, GifDrawable gifDrawable, ScheduledThreadPoolExecutor scheduledThreadPoolExecutor, boolean z) {
|
||||
this.b = true;
|
||||
this.c = Long.MIN_VALUE;
|
||||
this.d = new Rect();
|
||||
this.e = new Paint(6);
|
||||
this.h = new ConcurrentLinkedQueue<>();
|
||||
this.n = new RenderTask(this);
|
||||
this.l = z;
|
||||
this.a = scheduledThreadPoolExecutor == null ? GifRenderingExecutor.a() : scheduledThreadPoolExecutor;
|
||||
this.g = gifInfoHandle;
|
||||
Bitmap bitmap = null;
|
||||
if (gifDrawable != null) {
|
||||
synchronized (gifDrawable.g) {
|
||||
if (!gifDrawable.g.n() && gifDrawable.g.f() >= this.g.f() && gifDrawable.g.l() >= this.g.l()) {
|
||||
gifDrawable.i();
|
||||
Bitmap bitmap2 = gifDrawable.f;
|
||||
bitmap2.eraseColor(0);
|
||||
bitmap = bitmap2;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (bitmap == null) {
|
||||
this.f = Bitmap.createBitmap(this.g.l(), this.g.f(), Bitmap.Config.ARGB_8888);
|
||||
} else {
|
||||
this.f = bitmap;
|
||||
}
|
||||
this.f.setHasAlpha(!gifInfoHandle.m());
|
||||
this.o = new Rect(0, 0, this.g.l(), this.g.f());
|
||||
this.m = new InvalidationHandler(this);
|
||||
this.n.a();
|
||||
this.q = this.g.l();
|
||||
this.r = this.g.f();
|
||||
}
|
||||
|
||||
public void a(int i) {
|
||||
this.g.a(i);
|
||||
}
|
||||
|
||||
private PorterDuffColorFilter a(ColorStateList colorStateList, PorterDuff.Mode mode) {
|
||||
if (colorStateList == null || mode == null) {
|
||||
return null;
|
||||
}
|
||||
return new PorterDuffColorFilter(colorStateList.getColorForState(getState(), 0), mode);
|
||||
}
|
||||
|
||||
public int a() {
|
||||
return this.g.b();
|
||||
}
|
||||
}
|
55
sources/pl/droidsonroids/gif/GifError.java
Normal file
55
sources/pl/droidsonroids/gif/GifError.java
Normal file
@@ -0,0 +1,55 @@
|
||||
package pl.droidsonroids.gif;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public enum GifError {
|
||||
NO_ERROR(0, "No error"),
|
||||
OPEN_FAILED(101, "Failed to open given input"),
|
||||
READ_FAILED(102, "Failed to read from given input"),
|
||||
NOT_GIF_FILE(103, "Data is not in GIF format"),
|
||||
NO_SCRN_DSCR(104, "No screen descriptor detected"),
|
||||
NO_IMAG_DSCR(105, "No image descriptor detected"),
|
||||
NO_COLOR_MAP(106, "Neither global nor local color map found"),
|
||||
WRONG_RECORD(107, "Wrong record type detected"),
|
||||
DATA_TOO_BIG(108, "Number of pixels bigger than width * height"),
|
||||
NOT_ENOUGH_MEM(109, "Failed to allocate required memory"),
|
||||
CLOSE_FAILED(110, "Failed to close given input"),
|
||||
NOT_READABLE(111, "Given file was not opened for read"),
|
||||
IMAGE_DEFECT(112, "Image is defective, decoding aborted"),
|
||||
EOF_TOO_SOON(113, "Image EOF detected before image complete"),
|
||||
NO_FRAMES(1000, "No frames found, at least one frame required"),
|
||||
INVALID_SCR_DIMS(1001, "Invalid screen size, dimensions must be positive"),
|
||||
INVALID_IMG_DIMS(1002, "Invalid image size, dimensions must be positive"),
|
||||
IMG_NOT_CONFINED(1003, "Image size exceeds screen size"),
|
||||
REWIND_FAILED(1004, "Input source rewind failed, animation stopped"),
|
||||
INVALID_BYTE_BUFFER(1005, "Invalid and/or indirect byte buffer specified"),
|
||||
UNKNOWN(-1, "Unknown error");
|
||||
|
||||
public final String description;
|
||||
int errorCode;
|
||||
|
||||
GifError(int i, String str) {
|
||||
this.errorCode = i;
|
||||
this.description = str;
|
||||
}
|
||||
|
||||
static GifError fromCode(int i) {
|
||||
for (GifError gifError : values()) {
|
||||
if (gifError.errorCode == i) {
|
||||
return gifError;
|
||||
}
|
||||
}
|
||||
GifError gifError2 = UNKNOWN;
|
||||
gifError2.errorCode = i;
|
||||
return gifError2;
|
||||
}
|
||||
|
||||
public int getErrorCode() {
|
||||
return this.errorCode;
|
||||
}
|
||||
|
||||
String getFormattedDescription() {
|
||||
return String.format(Locale.ENGLISH, "GifError %d: %s", Integer.valueOf(this.errorCode), this.description);
|
||||
}
|
||||
}
|
30
sources/pl/droidsonroids/gif/GifIOException.java
Normal file
30
sources/pl/droidsonroids/gif/GifIOException.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package pl.droidsonroids.gif;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class GifIOException extends IOException {
|
||||
private static final long serialVersionUID = 13038402904505L;
|
||||
private final String mErrnoMessage;
|
||||
public final GifError reason;
|
||||
|
||||
GifIOException(int i, String str) {
|
||||
this.reason = GifError.fromCode(i);
|
||||
this.mErrnoMessage = str;
|
||||
}
|
||||
|
||||
static GifIOException fromCode(int i) {
|
||||
if (i == GifError.NO_ERROR.errorCode) {
|
||||
return null;
|
||||
}
|
||||
return new GifIOException(i, null);
|
||||
}
|
||||
|
||||
@Override // java.lang.Throwable
|
||||
public String getMessage() {
|
||||
if (this.mErrnoMessage == null) {
|
||||
return this.reason.getFormattedDescription();
|
||||
}
|
||||
return this.reason.getFormattedDescription() + ": " + this.mErrnoMessage;
|
||||
}
|
||||
}
|
253
sources/pl/droidsonroids/gif/GifInfoHandle.java
Normal file
253
sources/pl/droidsonroids/gif/GifInfoHandle.java
Normal file
@@ -0,0 +1,253 @@
|
||||
package pl.droidsonroids.gif;
|
||||
|
||||
import android.content.ContentResolver;
|
||||
import android.content.res.AssetFileDescriptor;
|
||||
import android.graphics.Bitmap;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.system.ErrnoException;
|
||||
import android.system.Os;
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
final class GifInfoHandle {
|
||||
private volatile long a;
|
||||
|
||||
static {
|
||||
LibraryLoader.b();
|
||||
}
|
||||
|
||||
GifInfoHandle(FileDescriptor fileDescriptor) throws GifIOException {
|
||||
this.a = a(fileDescriptor, 0L, true);
|
||||
}
|
||||
|
||||
private static long a(FileDescriptor fileDescriptor, long j, boolean z) throws GifIOException {
|
||||
int a;
|
||||
if (Build.VERSION.SDK_INT > 27) {
|
||||
try {
|
||||
a = a(fileDescriptor, z);
|
||||
} catch (Exception e) {
|
||||
throw new GifIOException(GifError.OPEN_FAILED.errorCode, e.getMessage());
|
||||
}
|
||||
} else {
|
||||
a = extractNativeFileDescriptor(fileDescriptor, z);
|
||||
}
|
||||
return openNativeFileDescriptor(a, j);
|
||||
}
|
||||
|
||||
static native int createTempNativeFileDescriptor() throws GifIOException;
|
||||
|
||||
static native int extractNativeFileDescriptor(FileDescriptor fileDescriptor, boolean z) throws GifIOException;
|
||||
|
||||
private static native void free(long j);
|
||||
|
||||
private static native long getAllocationByteCount(long j);
|
||||
|
||||
private static native int getCurrentFrameIndex(long j);
|
||||
|
||||
private static native int getCurrentLoop(long j);
|
||||
|
||||
private static native int getCurrentPosition(long j);
|
||||
|
||||
private static native int getDuration(long j);
|
||||
|
||||
private static native int getHeight(long j);
|
||||
|
||||
private static native int getLoopCount(long j);
|
||||
|
||||
private static native long getMetadataByteCount(long j);
|
||||
|
||||
private static native int getNativeErrorCode(long j);
|
||||
|
||||
private static native int getNumberOfFrames(long j);
|
||||
|
||||
private static native long[] getSavedState(long j);
|
||||
|
||||
private static native int getWidth(long j);
|
||||
|
||||
private static native boolean isOpaque(long j);
|
||||
|
||||
static native long openByteArray(byte[] bArr) throws GifIOException;
|
||||
|
||||
static native long openDirectByteBuffer(ByteBuffer byteBuffer) throws GifIOException;
|
||||
|
||||
static native long openFile(String str) throws GifIOException;
|
||||
|
||||
static native long openNativeFileDescriptor(int i, long j) throws GifIOException;
|
||||
|
||||
static native long openStream(InputStream inputStream) throws GifIOException;
|
||||
|
||||
private static native long renderFrame(long j, Bitmap bitmap);
|
||||
|
||||
private static native boolean reset(long j);
|
||||
|
||||
private static native long restoreRemainder(long j);
|
||||
|
||||
private static native int restoreSavedState(long j, long[] jArr, Bitmap bitmap);
|
||||
|
||||
private static native void saveRemainder(long j);
|
||||
|
||||
private static native void seekToTime(long j, int i, Bitmap bitmap);
|
||||
|
||||
private static native void setLoopCount(long j, char c);
|
||||
|
||||
synchronized int b() {
|
||||
return getCurrentFrameIndex(this.a);
|
||||
}
|
||||
|
||||
synchronized int c() {
|
||||
return getCurrentLoop(this.a);
|
||||
}
|
||||
|
||||
synchronized int d() {
|
||||
return getCurrentPosition(this.a);
|
||||
}
|
||||
|
||||
synchronized int e() {
|
||||
return getDuration(this.a);
|
||||
}
|
||||
|
||||
synchronized int f() {
|
||||
return getHeight(this.a);
|
||||
}
|
||||
|
||||
protected void finalize() throws Throwable {
|
||||
try {
|
||||
o();
|
||||
} finally {
|
||||
super.finalize();
|
||||
}
|
||||
}
|
||||
|
||||
synchronized int g() {
|
||||
return getLoopCount(this.a);
|
||||
}
|
||||
|
||||
synchronized long h() {
|
||||
return getMetadataByteCount(this.a);
|
||||
}
|
||||
|
||||
synchronized int i() {
|
||||
return getNativeErrorCode(this.a);
|
||||
}
|
||||
|
||||
synchronized int j() {
|
||||
return getNumberOfFrames(this.a);
|
||||
}
|
||||
|
||||
synchronized long[] k() {
|
||||
return getSavedState(this.a);
|
||||
}
|
||||
|
||||
synchronized int l() {
|
||||
return getWidth(this.a);
|
||||
}
|
||||
|
||||
synchronized boolean m() {
|
||||
return isOpaque(this.a);
|
||||
}
|
||||
|
||||
synchronized boolean n() {
|
||||
return this.a == 0;
|
||||
}
|
||||
|
||||
synchronized void o() {
|
||||
free(this.a);
|
||||
this.a = 0L;
|
||||
}
|
||||
|
||||
synchronized boolean p() {
|
||||
return reset(this.a);
|
||||
}
|
||||
|
||||
synchronized long q() {
|
||||
return restoreRemainder(this.a);
|
||||
}
|
||||
|
||||
synchronized void r() {
|
||||
saveRemainder(this.a);
|
||||
}
|
||||
|
||||
GifInfoHandle(byte[] bArr) throws GifIOException {
|
||||
this.a = openByteArray(bArr);
|
||||
}
|
||||
|
||||
GifInfoHandle(ByteBuffer byteBuffer) throws GifIOException {
|
||||
this.a = openDirectByteBuffer(byteBuffer);
|
||||
}
|
||||
|
||||
private static int a(FileDescriptor fileDescriptor, boolean z) throws GifIOException, ErrnoException {
|
||||
try {
|
||||
int createTempNativeFileDescriptor = createTempNativeFileDescriptor();
|
||||
Os.dup2(fileDescriptor, createTempNativeFileDescriptor);
|
||||
return createTempNativeFileDescriptor;
|
||||
} finally {
|
||||
if (z) {
|
||||
Os.close(fileDescriptor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GifInfoHandle(String str) throws GifIOException {
|
||||
this.a = openFile(str);
|
||||
}
|
||||
|
||||
GifInfoHandle(InputStream inputStream) throws GifIOException {
|
||||
if (inputStream.markSupported()) {
|
||||
this.a = openStream(inputStream);
|
||||
return;
|
||||
}
|
||||
throw new IllegalArgumentException("InputStream does not support marking");
|
||||
}
|
||||
|
||||
static GifInfoHandle a(ContentResolver contentResolver, Uri uri) throws IOException {
|
||||
if ("file".equals(uri.getScheme())) {
|
||||
return new GifInfoHandle(uri.getPath());
|
||||
}
|
||||
AssetFileDescriptor openAssetFileDescriptor = contentResolver.openAssetFileDescriptor(uri, "r");
|
||||
if (openAssetFileDescriptor != null) {
|
||||
return new GifInfoHandle(openAssetFileDescriptor);
|
||||
}
|
||||
throw new IOException("Could not open AssetFileDescriptor for " + uri);
|
||||
}
|
||||
|
||||
GifInfoHandle(AssetFileDescriptor assetFileDescriptor) throws IOException {
|
||||
try {
|
||||
this.a = a(assetFileDescriptor.getFileDescriptor(), assetFileDescriptor.getStartOffset(), false);
|
||||
} finally {
|
||||
try {
|
||||
assetFileDescriptor.close();
|
||||
} catch (IOException unused) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
synchronized long a(Bitmap bitmap) {
|
||||
return renderFrame(this.a, bitmap);
|
||||
}
|
||||
|
||||
void a(int i) {
|
||||
if (i >= 0 && i <= 65535) {
|
||||
synchronized (this) {
|
||||
setLoopCount(this.a, (char) i);
|
||||
}
|
||||
return;
|
||||
}
|
||||
throw new IllegalArgumentException("Loop count of range <0, 65535>");
|
||||
}
|
||||
|
||||
synchronized void a(int i, Bitmap bitmap) {
|
||||
seekToTime(this.a, i, bitmap);
|
||||
}
|
||||
|
||||
synchronized long a() {
|
||||
return getAllocationByteCount(this.a);
|
||||
}
|
||||
|
||||
synchronized int a(long[] jArr, Bitmap bitmap) {
|
||||
return restoreSavedState(this.a, jArr, bitmap);
|
||||
}
|
||||
}
|
20
sources/pl/droidsonroids/gif/GifRenderingExecutor.java
Normal file
20
sources/pl/droidsonroids/gif/GifRenderingExecutor.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package pl.droidsonroids.gif;
|
||||
|
||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
final class GifRenderingExecutor extends ScheduledThreadPoolExecutor {
|
||||
|
||||
private static final class InstanceHolder {
|
||||
private static final GifRenderingExecutor a = new GifRenderingExecutor();
|
||||
}
|
||||
|
||||
static GifRenderingExecutor a() {
|
||||
return InstanceHolder.a;
|
||||
}
|
||||
|
||||
private GifRenderingExecutor() {
|
||||
super(1, new ThreadPoolExecutor.DiscardPolicy());
|
||||
}
|
||||
}
|
175
sources/pl/droidsonroids/gif/GifTextView.java
Normal file
175
sources/pl/droidsonroids/gif/GifTextView.java
Normal file
@@ -0,0 +1,175 @@
|
||||
package pl.droidsonroids.gif;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.os.Parcelable;
|
||||
import android.util.AttributeSet;
|
||||
import android.widget.TextView;
|
||||
import java.io.IOException;
|
||||
import pl.droidsonroids.gif.GifViewUtils;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class GifTextView extends TextView {
|
||||
private GifViewUtils.GifViewAttributes a;
|
||||
|
||||
public GifTextView(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
private static void a(Drawable[] drawableArr, boolean z) {
|
||||
for (Drawable drawable : drawableArr) {
|
||||
if (drawable != null) {
|
||||
drawable.setVisible(z, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void setCompoundDrawablesVisible(boolean z) {
|
||||
a(getCompoundDrawables(), z);
|
||||
a(getCompoundDrawablesRelative(), z);
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView, android.view.View
|
||||
protected void onAttachedToWindow() {
|
||||
super.onAttachedToWindow();
|
||||
setCompoundDrawablesVisible(true);
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
protected void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
setCompoundDrawablesVisible(false);
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView, android.view.View
|
||||
public void onRestoreInstanceState(Parcelable parcelable) {
|
||||
if (!(parcelable instanceof GifViewSavedState)) {
|
||||
super.onRestoreInstanceState(parcelable);
|
||||
return;
|
||||
}
|
||||
GifViewSavedState gifViewSavedState = (GifViewSavedState) parcelable;
|
||||
super.onRestoreInstanceState(gifViewSavedState.getSuperState());
|
||||
Drawable[] compoundDrawables = getCompoundDrawables();
|
||||
gifViewSavedState.restoreState(compoundDrawables[0], 0);
|
||||
gifViewSavedState.restoreState(compoundDrawables[1], 1);
|
||||
gifViewSavedState.restoreState(compoundDrawables[2], 2);
|
||||
gifViewSavedState.restoreState(compoundDrawables[3], 3);
|
||||
Drawable[] compoundDrawablesRelative = getCompoundDrawablesRelative();
|
||||
gifViewSavedState.restoreState(compoundDrawablesRelative[0], 4);
|
||||
gifViewSavedState.restoreState(compoundDrawablesRelative[2], 5);
|
||||
gifViewSavedState.restoreState(getBackground(), 6);
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView, android.view.View
|
||||
public Parcelable onSaveInstanceState() {
|
||||
Drawable[] drawableArr = new Drawable[7];
|
||||
if (this.a.a) {
|
||||
Drawable[] compoundDrawables = getCompoundDrawables();
|
||||
System.arraycopy(compoundDrawables, 0, drawableArr, 0, compoundDrawables.length);
|
||||
Drawable[] compoundDrawablesRelative = getCompoundDrawablesRelative();
|
||||
drawableArr[4] = compoundDrawablesRelative[0];
|
||||
drawableArr[5] = compoundDrawablesRelative[2];
|
||||
drawableArr[6] = getBackground();
|
||||
}
|
||||
return new GifViewSavedState(super.onSaveInstanceState(), drawableArr);
|
||||
}
|
||||
|
||||
@Override // android.view.View
|
||||
public void setBackgroundResource(int i) {
|
||||
setBackground(a(i));
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public void setCompoundDrawablesRelativeWithIntrinsicBounds(int i, int i2, int i3, int i4) {
|
||||
setCompoundDrawablesRelativeWithIntrinsicBounds(a(i), a(i2), a(i3), a(i4));
|
||||
}
|
||||
|
||||
@Override // android.widget.TextView
|
||||
public void setCompoundDrawablesWithIntrinsicBounds(int i, int i2, int i3, int i4) {
|
||||
setCompoundDrawablesWithIntrinsicBounds(a(i), a(i2), a(i3), a(i4));
|
||||
}
|
||||
|
||||
public void setFreezesAnimation(boolean z) {
|
||||
this.a.a = z;
|
||||
}
|
||||
|
||||
public GifTextView(Context context, AttributeSet attributeSet) {
|
||||
super(context, attributeSet);
|
||||
a(attributeSet, 0, 0);
|
||||
}
|
||||
|
||||
private void a(AttributeSet attributeSet, int i, int i2) {
|
||||
if (attributeSet != null) {
|
||||
Drawable a = a(attributeSet.getAttributeResourceValue("http://schemas.android.com/apk/res/android", "drawableLeft", 0));
|
||||
Drawable a2 = a(attributeSet.getAttributeResourceValue("http://schemas.android.com/apk/res/android", "drawableTop", 0));
|
||||
Drawable a3 = a(attributeSet.getAttributeResourceValue("http://schemas.android.com/apk/res/android", "drawableRight", 0));
|
||||
Drawable a4 = a(attributeSet.getAttributeResourceValue("http://schemas.android.com/apk/res/android", "drawableBottom", 0));
|
||||
Drawable a5 = a(attributeSet.getAttributeResourceValue("http://schemas.android.com/apk/res/android", "drawableStart", 0));
|
||||
Drawable a6 = a(attributeSet.getAttributeResourceValue("http://schemas.android.com/apk/res/android", "drawableEnd", 0));
|
||||
if (getLayoutDirection() == 0) {
|
||||
if (a5 != null) {
|
||||
a = a5;
|
||||
}
|
||||
if (a6 == null) {
|
||||
a6 = a3;
|
||||
}
|
||||
} else {
|
||||
if (a5 != null) {
|
||||
a3 = a5;
|
||||
}
|
||||
if (a6 == null) {
|
||||
a6 = a;
|
||||
}
|
||||
a = a3;
|
||||
}
|
||||
setCompoundDrawablesRelativeWithIntrinsicBounds(a, a2, a6, a4);
|
||||
setBackground(a(attributeSet.getAttributeResourceValue("http://schemas.android.com/apk/res/android", "background", 0)));
|
||||
this.a = new GifViewUtils.GifViewAttributes(this, attributeSet, i, i2);
|
||||
a();
|
||||
}
|
||||
this.a = new GifViewUtils.GifViewAttributes();
|
||||
}
|
||||
|
||||
public GifTextView(Context context, AttributeSet attributeSet, int i) {
|
||||
super(context, attributeSet, i);
|
||||
a(attributeSet, i, 0);
|
||||
}
|
||||
|
||||
public GifTextView(Context context, AttributeSet attributeSet, int i, int i2) {
|
||||
super(context, attributeSet, i, i2);
|
||||
a(attributeSet, i, i2);
|
||||
}
|
||||
|
||||
private void a() {
|
||||
if (this.a.b < 0) {
|
||||
return;
|
||||
}
|
||||
for (Drawable drawable : getCompoundDrawables()) {
|
||||
GifViewUtils.a(this.a.b, drawable);
|
||||
}
|
||||
for (Drawable drawable2 : getCompoundDrawablesRelative()) {
|
||||
GifViewUtils.a(this.a.b, drawable2);
|
||||
}
|
||||
GifViewUtils.a(this.a.b, getBackground());
|
||||
}
|
||||
|
||||
private Drawable a(int i) {
|
||||
if (i == 0) {
|
||||
return null;
|
||||
}
|
||||
Resources resources = getResources();
|
||||
String resourceTypeName = resources.getResourceTypeName(i);
|
||||
if (!isInEditMode() && GifViewUtils.a.contains(resourceTypeName)) {
|
||||
try {
|
||||
return new GifDrawable(resources, i);
|
||||
} catch (Resources.NotFoundException | IOException unused) {
|
||||
}
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
return resources.getDrawable(i, getContext().getTheme());
|
||||
}
|
||||
return resources.getDrawable(i);
|
||||
}
|
||||
}
|
71
sources/pl/droidsonroids/gif/GifViewSavedState.java
Normal file
71
sources/pl/droidsonroids/gif/GifViewSavedState.java
Normal file
@@ -0,0 +1,71 @@
|
||||
package pl.droidsonroids.gif;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.view.View;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
class GifViewSavedState extends View.BaseSavedState {
|
||||
public static final Parcelable.Creator<GifViewSavedState> CREATOR = new Parcelable.Creator<GifViewSavedState>() { // from class: pl.droidsonroids.gif.GifViewSavedState.1
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public GifViewSavedState createFromParcel(Parcel parcel) {
|
||||
return new GifViewSavedState(parcel);
|
||||
}
|
||||
|
||||
@Override // android.os.Parcelable.Creator
|
||||
public GifViewSavedState[] newArray(int i) {
|
||||
return new GifViewSavedState[i];
|
||||
}
|
||||
};
|
||||
final long[][] mStates;
|
||||
|
||||
void restoreState(Drawable drawable, int i) {
|
||||
if (this.mStates[i] == null || !(drawable instanceof GifDrawable)) {
|
||||
return;
|
||||
}
|
||||
((GifDrawable) drawable).a(r3.g.a(r0[i], r3.f));
|
||||
}
|
||||
|
||||
@Override // android.view.View.BaseSavedState, android.view.AbsSavedState, android.os.Parcelable
|
||||
public void writeToParcel(Parcel parcel, int i) {
|
||||
super.writeToParcel(parcel, i);
|
||||
parcel.writeInt(this.mStates.length);
|
||||
for (long[] jArr : this.mStates) {
|
||||
parcel.writeLongArray(jArr);
|
||||
}
|
||||
}
|
||||
|
||||
GifViewSavedState(Parcelable parcelable, Drawable... drawableArr) {
|
||||
super(parcelable);
|
||||
this.mStates = new long[drawableArr.length][];
|
||||
for (int i = 0; i < drawableArr.length; i++) {
|
||||
Drawable drawable = drawableArr[i];
|
||||
if (drawable instanceof GifDrawable) {
|
||||
this.mStates[i] = ((GifDrawable) drawable).g.k();
|
||||
} else {
|
||||
this.mStates[i] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private GifViewSavedState(Parcel parcel) {
|
||||
super(parcel);
|
||||
this.mStates = new long[parcel.readInt()][];
|
||||
int i = 0;
|
||||
while (true) {
|
||||
long[][] jArr = this.mStates;
|
||||
if (i >= jArr.length) {
|
||||
return;
|
||||
}
|
||||
jArr[i] = parcel.createLongArray();
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
GifViewSavedState(Parcelable parcelable, long[] jArr) {
|
||||
super(parcelable);
|
||||
this.mStates = new long[1][];
|
||||
this.mStates[0] = jArr;
|
||||
}
|
||||
}
|
54
sources/pl/droidsonroids/gif/GifViewUtils.java
Normal file
54
sources/pl/droidsonroids/gif/GifViewUtils.java
Normal file
@@ -0,0 +1,54 @@
|
||||
package pl.droidsonroids.gif;
|
||||
|
||||
import android.content.res.Resources;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.TypedValue;
|
||||
import android.view.View;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
final class GifViewUtils {
|
||||
static final List<String> a = Arrays.asList("raw", "drawable", "mipmap");
|
||||
|
||||
static void a(int i, Drawable drawable) {
|
||||
if (drawable instanceof GifDrawable) {
|
||||
((GifDrawable) drawable).a(i);
|
||||
}
|
||||
}
|
||||
|
||||
static float a(Resources resources, int i) {
|
||||
TypedValue typedValue = new TypedValue();
|
||||
resources.getValue(i, typedValue, true);
|
||||
int i2 = typedValue.density;
|
||||
if (i2 == 0) {
|
||||
i2 = 160;
|
||||
} else if (i2 == 65535) {
|
||||
i2 = 0;
|
||||
}
|
||||
int i3 = resources.getDisplayMetrics().densityDpi;
|
||||
if (i2 <= 0 || i3 <= 0) {
|
||||
return 1.0f;
|
||||
}
|
||||
return i3 / i2;
|
||||
}
|
||||
|
||||
static class GifViewAttributes {
|
||||
boolean a;
|
||||
final int b;
|
||||
|
||||
GifViewAttributes(View view, AttributeSet attributeSet, int i, int i2) {
|
||||
TypedArray obtainStyledAttributes = view.getContext().obtainStyledAttributes(attributeSet, R$styleable.GifView, i, i2);
|
||||
this.a = obtainStyledAttributes.getBoolean(R$styleable.GifView_freezesAnimation, false);
|
||||
this.b = obtainStyledAttributes.getInt(R$styleable.GifView_loopCount, -1);
|
||||
obtainStyledAttributes.recycle();
|
||||
}
|
||||
|
||||
GifViewAttributes() {
|
||||
this.a = false;
|
||||
this.b = -1;
|
||||
}
|
||||
}
|
||||
}
|
33
sources/pl/droidsonroids/gif/InvalidationHandler.java
Normal file
33
sources/pl/droidsonroids/gif/InvalidationHandler.java
Normal file
@@ -0,0 +1,33 @@
|
||||
package pl.droidsonroids.gif;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.Iterator;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
class InvalidationHandler extends Handler {
|
||||
private final WeakReference<GifDrawable> a;
|
||||
|
||||
public InvalidationHandler(GifDrawable gifDrawable) {
|
||||
super(Looper.getMainLooper());
|
||||
this.a = new WeakReference<>(gifDrawable);
|
||||
}
|
||||
|
||||
@Override // android.os.Handler
|
||||
public void handleMessage(Message message) {
|
||||
GifDrawable gifDrawable = this.a.get();
|
||||
if (gifDrawable == null) {
|
||||
return;
|
||||
}
|
||||
if (message.what == -1) {
|
||||
gifDrawable.invalidateSelf();
|
||||
return;
|
||||
}
|
||||
Iterator<AnimationListener> it = gifDrawable.h.iterator();
|
||||
while (it.hasNext()) {
|
||||
it.next().a(message.what);
|
||||
}
|
||||
}
|
||||
}
|
31
sources/pl/droidsonroids/gif/LibraryLoader.java
Normal file
31
sources/pl/droidsonroids/gif/LibraryLoader.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package pl.droidsonroids.gif;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import com.getkeepsafe.relinker.ReLinker;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public class LibraryLoader {
|
||||
|
||||
@SuppressLint({"StaticFieldLeak"})
|
||||
private static Context a;
|
||||
|
||||
private static Context a() {
|
||||
if (a == null) {
|
||||
try {
|
||||
a = (Context) Class.forName("android.app.ActivityThread").getDeclaredMethod("currentApplication", new Class[0]).invoke(null, new Object[0]);
|
||||
} catch (Exception e) {
|
||||
throw new IllegalStateException("LibraryLoader not initialized. Call LibraryLoader.initialize() before using library classes.", e);
|
||||
}
|
||||
}
|
||||
return a;
|
||||
}
|
||||
|
||||
static void b() {
|
||||
try {
|
||||
System.loadLibrary("pl_droidsonroids_gif");
|
||||
} catch (UnsatisfiedLinkError unused) {
|
||||
ReLinker.a(a(), "pl_droidsonroids_gif");
|
||||
}
|
||||
}
|
||||
}
|
13
sources/pl/droidsonroids/gif/R$styleable.java
Normal file
13
sources/pl/droidsonroids/gif/R$styleable.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package pl.droidsonroids.gif;
|
||||
|
||||
import com.ubt.jimu.R;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public final class R$styleable {
|
||||
public static final int GifTextureView_gifSource = 0;
|
||||
public static final int GifTextureView_isOpaque = 1;
|
||||
public static final int GifView_freezesAnimation = 0;
|
||||
public static final int GifView_loopCount = 1;
|
||||
public static final int[] GifTextureView = {R.attr.gifSource, R.attr.isOpaque};
|
||||
public static final int[] GifView = {R.attr.freezesAnimation, R.attr.loopCount};
|
||||
}
|
40
sources/pl/droidsonroids/gif/RenderTask.java
Normal file
40
sources/pl/droidsonroids/gif/RenderTask.java
Normal file
@@ -0,0 +1,40 @@
|
||||
package pl.droidsonroids.gif;
|
||||
|
||||
import android.os.SystemClock;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
class RenderTask extends SafeRunnable {
|
||||
RenderTask(GifDrawable gifDrawable) {
|
||||
super(gifDrawable);
|
||||
}
|
||||
|
||||
@Override // pl.droidsonroids.gif.SafeRunnable
|
||||
public void a() {
|
||||
GifDrawable gifDrawable = this.a;
|
||||
long a = gifDrawable.g.a(gifDrawable.f);
|
||||
if (a >= 0) {
|
||||
this.a.c = SystemClock.uptimeMillis() + a;
|
||||
if (this.a.isVisible() && this.a.b) {
|
||||
GifDrawable gifDrawable2 = this.a;
|
||||
if (!gifDrawable2.l) {
|
||||
gifDrawable2.a.remove(this);
|
||||
GifDrawable gifDrawable3 = this.a;
|
||||
gifDrawable3.p = gifDrawable3.a.schedule(this, a, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
}
|
||||
if (!this.a.h.isEmpty() && this.a.a() == this.a.g.j() - 1) {
|
||||
GifDrawable gifDrawable4 = this.a;
|
||||
gifDrawable4.m.sendEmptyMessageAtTime(gifDrawable4.b(), this.a.c);
|
||||
}
|
||||
} else {
|
||||
GifDrawable gifDrawable5 = this.a;
|
||||
gifDrawable5.c = Long.MIN_VALUE;
|
||||
gifDrawable5.b = false;
|
||||
}
|
||||
if (!this.a.isVisible() || this.a.m.hasMessages(-1)) {
|
||||
return;
|
||||
}
|
||||
this.a.m.sendEmptyMessageAtTime(-1, 0L);
|
||||
}
|
||||
}
|
30
sources/pl/droidsonroids/gif/SafeRunnable.java
Normal file
30
sources/pl/droidsonroids/gif/SafeRunnable.java
Normal file
@@ -0,0 +1,30 @@
|
||||
package pl.droidsonroids.gif;
|
||||
|
||||
import java.lang.Thread;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
abstract class SafeRunnable implements Runnable {
|
||||
final GifDrawable a;
|
||||
|
||||
SafeRunnable(GifDrawable gifDrawable) {
|
||||
this.a = gifDrawable;
|
||||
}
|
||||
|
||||
abstract void a();
|
||||
|
||||
@Override // java.lang.Runnable
|
||||
public final void run() {
|
||||
try {
|
||||
if (this.a.e()) {
|
||||
return;
|
||||
}
|
||||
a();
|
||||
} catch (Throwable th) {
|
||||
Thread.UncaughtExceptionHandler defaultUncaughtExceptionHandler = Thread.getDefaultUncaughtExceptionHandler();
|
||||
if (defaultUncaughtExceptionHandler != null) {
|
||||
defaultUncaughtExceptionHandler.uncaughtException(Thread.currentThread(), th);
|
||||
}
|
||||
throw th;
|
||||
}
|
||||
}
|
||||
}
|
13
sources/pl/droidsonroids/gif/transforms/Transform.java
Normal file
13
sources/pl/droidsonroids/gif/transforms/Transform.java
Normal file
@@ -0,0 +1,13 @@
|
||||
package pl.droidsonroids.gif.transforms;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Rect;
|
||||
|
||||
/* loaded from: classes2.dex */
|
||||
public interface Transform {
|
||||
void a(Canvas canvas, Paint paint, Bitmap bitmap);
|
||||
|
||||
void a(Rect rect);
|
||||
}
|
Reference in New Issue
Block a user