导航菜单

页面标题

页面副标题

Cantique de Louanges v12 - h.java 源代码

正在查看: Cantique de Louanges v12 应用的 h.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.bytedance.adsdk.lottie;

import android.animation.ValueAnimator;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.RectF;
import android.graphics.Typeface;
import android.graphics.drawable.Animatable;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.bytedance.component.sdk.annotation.FloatRange;
import com.bytedance.component.sdk.annotation.IntRange;
import com.bytedance.component.sdk.annotation.MainThread;
import com.bytedance.component.sdk.annotation.RestrictTo;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Map;

public class h extends Drawable implements Animatable, Drawable.Callback {
    private final Matrix A;
    private Bitmap B;
    private Canvas C;
    private Rect D;
    private RectF E;
    private Paint F;
    private Rect G;
    private Rect H;
    private RectF I;
    private RectF J;
    private Matrix K;
    private Matrix L;
    private boolean M;
    String a;
    c b;
    v c;
    private f d;
    private final com.bytedance.adsdk.lottie.f.e e;
    private boolean f;
    private boolean g;
    private boolean h;
    private b i;
    private final ArrayList<a> j;
    private final ValueAnimator.AnimatorUpdateListener k;
    private com.bytedance.adsdk.lottie.b.b l;
    private String m;
    private d n;
    private com.bytedance.adsdk.lottie.b.a o;
    private Map<String, Typeface> p;
    private boolean q;
    private boolean r;
    private boolean s;
    private com.bytedance.adsdk.lottie.c.c.b t;
    private int u;
    private boolean v;
    private boolean w;
    private boolean x;
    private u y;
    private boolean z;

    private interface a {
        void a(f fVar);
    }

    private enum b {
        NONE,
        PLAY,
        RESUME
    }

    public h() {
        com.bytedance.adsdk.lottie.f.e eVar = new com.bytedance.adsdk.lottie.f.e();
        this.e = eVar;
        this.f = true;
        this.g = false;
        this.h = false;
        this.i = b.NONE;
        this.j = new ArrayList<>();
        ValueAnimator.AnimatorUpdateListener animatorUpdateListener = new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator valueAnimator) {
                if (h.this.t != null) {
                    h.this.t.a(h.this.e.f());
                }
            }
        };
        this.k = animatorUpdateListener;
        this.r = false;
        this.s = true;
        this.u = 255;
        this.y = u.AUTOMATIC;
        this.z = false;
        this.A = new Matrix();
        this.M = false;
        eVar.addUpdateListener(animatorUpdateListener);
    }

    private boolean A() {
        return this.f || this.g;
    }

    private com.bytedance.adsdk.lottie.b.b B() {
        com.bytedance.adsdk.lottie.b.b bVar = this.l;
        if (bVar != null && !bVar.a(D())) {
            this.l = null;
        }
        if (this.l == null) {
            this.l = new com.bytedance.adsdk.lottie.b.b(getCallback(), this.m, this.n, this.d.l());
        }
        return this.l;
    }

    private com.bytedance.adsdk.lottie.b.a C() {
        if (getCallback() == null) {
            return null;
        }
        if (this.o == null) {
            com.bytedance.adsdk.lottie.b.a aVar = new com.bytedance.adsdk.lottie.b.a(getCallback(), this.b);
            this.o = aVar;
            String str = this.a;
            if (str != null) {
                aVar.a(str);
            }
        }
        return this.o;
    }

    private Context D() {
        Drawable.Callback callback = getCallback();
        if (callback != null && (callback instanceof View)) {
            return ((View) callback).getContext();
        }
        return null;
    }

    private void E() {
        if (this.C != null) {
            return;
        }
        this.C = new Canvas();
        this.J = new RectF();
        this.K = new Matrix();
        this.L = new Matrix();
        this.D = new Rect();
        this.E = new RectF();
        this.F = new com.bytedance.adsdk.lottie.a.a();
        this.G = new Rect();
        this.H = new Rect();
        this.I = new RectF();
    }

    private boolean F() {
        Drawable.Callback callback = getCallback();
        if (!(callback instanceof View)) {
            return false;
        }
        if (((View) callback).getParent() instanceof ViewGroup) {
            return !((ViewGroup) r0).getClipChildren();
        }
        return false;
    }

    private void y() {
        f fVar = this.d;
        if (fVar == null) {
            return;
        }
        this.z = this.y.a(Build.VERSION.SDK_INT, fVar.a(), fVar.b());
    }

    private void z() {
        f fVar = this.d;
        if (fVar == null) {
            return;
        }
        com.bytedance.adsdk.lottie.c.c.b bVar = new com.bytedance.adsdk.lottie.c.c.b(this, com.bytedance.adsdk.lottie.e.v.a(fVar), fVar.i(), fVar);
        this.t = bVar;
        if (this.w) {
            bVar.a(true);
        }
        this.t.b(this.s);
    }

    public String c() {
        return this.m;
    }

    public boolean d() {
        return this.r;
    }

    @Override
    public void draw(Canvas canvas) {
        e.a("Drawable#draw");
        if (this.h) {
            try {
                if (this.z) {
                    a(canvas, this.t);
                } else {
                    a(canvas);
                }
            } catch (Throwable th) {
                com.bytedance.adsdk.lottie.f.d.b("Lottie crashed in draw!", th);
            }
        } else if (this.z) {
            a(canvas, this.t);
        } else {
            a(canvas);
        }
        this.M = false;
        e.b("Drawable#draw");
    }

    public u e() {
        return this.z ? u.SOFTWARE : u.HARDWARE;
    }

    public t f() {
        f fVar = this.d;
        if (fVar != null) {
            return fVar.c();
        }
        return null;
    }

    public boolean g() {
        return this.x;
    }

    @Override
    public int getAlpha() {
        return this.u;
    }

    @Override
    public int getIntrinsicHeight() {
        f fVar = this.d;
        if (fVar == null) {
            return -1;
        }
        return fVar.d().height();
    }

    @Override
    public int getIntrinsicWidth() {
        f fVar = this.d;
        if (fVar == null) {
            return -1;
        }
        return fVar.d().width();
    }

    @Override
    public int getOpacity() {
        return -3;
    }

    public void h() {
        if (this.e.isRunning()) {
            this.e.cancel();
            if (!isVisible()) {
                this.i = b.NONE;
            }
        }
        this.d = null;
        this.t = null;
        this.l = null;
        this.e.h();
        invalidateSelf();
    }

    @MainThread
    public void i() {
        if (this.t == null) {
            this.j.add(new a() {
                @Override
                public void a(f fVar) {
                    h.this.i();
                }
            });
            return;
        }
        y();
        if (A() || q() == 0) {
            if (isVisible()) {
                this.e.k();
                this.i = b.NONE;
            } else {
                this.i = b.PLAY;
            }
        }
        if (A()) {
            return;
        }
        c((int) (n() < 0.0f ? l() : m()));
        this.e.l();
        if (isVisible()) {
            return;
        }
        this.i = b.NONE;
    }

    @Override
    public void invalidateDrawable(Drawable drawable) {
        Drawable.Callback callback = getCallback();
        if (callback == null) {
            return;
        }
        callback.invalidateDrawable(this);
    }

    @Override
    public void invalidateSelf() {
        if (this.M) {
            return;
        }
        this.M = true;
        Drawable.Callback callback = getCallback();
        if (callback != null) {
            callback.invalidateDrawable(this);
        }
    }

    @Override
    public boolean isRunning() {
        return r();
    }

    @MainThread
    public void j() {
        this.j.clear();
        this.e.l();
        if (isVisible()) {
            return;
        }
        this.i = b.NONE;
    }

    @MainThread
    public void k() {
        if (this.t == null) {
            this.j.add(new a() {
                @Override
                public void a(f fVar) {
                    h.this.k();
                }
            });
            return;
        }
        y();
        if (A() || q() == 0) {
            if (isVisible()) {
                this.e.n();
                this.i = b.NONE;
            } else {
                this.i = b.RESUME;
            }
        }
        if (A()) {
            return;
        }
        c((int) (n() < 0.0f ? l() : m()));
        this.e.l();
        if (isVisible()) {
            return;
        }
        this.i = b.NONE;
    }

    public float l() {
        return this.e.o();
    }

    public float m() {
        return this.e.p();
    }

    public float n() {
        return this.e.j();
    }

    public int o() {
        return (int) this.e.g();
    }

    @SuppressLint({"WrongConstant"})
    public int p() {
        return this.e.getRepeatMode();
    }

    public int q() {
        return this.e.getRepeatCount();
    }

    public boolean r() {
        com.bytedance.adsdk.lottie.f.e eVar = this.e;
        if (eVar == null) {
            return false;
        }
        return eVar.isRunning();
    }

    boolean s() {
        if (isVisible()) {
            return this.e.isRunning();
        }
        b bVar = this.i;
        return bVar == b.PLAY || bVar == b.RESUME;
    }

    @Override
    public void scheduleDrawable(Drawable drawable, Runnable runnable, long j) {
        Drawable.Callback callback = getCallback();
        if (callback == null) {
            return;
        }
        callback.scheduleDrawable(this, runnable, j);
    }

    @Override
    public void setAlpha(@IntRange(from = 0, to = 255) int i) {
        this.u = i;
        invalidateSelf();
    }

    @Override
    public void setColorFilter(ColorFilter colorFilter) {
        com.bytedance.adsdk.lottie.f.d.b("Use addColorFilter instead.");
    }

    @Override
    public boolean setVisible(boolean z, boolean z2) {
        boolean z3 = !isVisible();
        boolean visible = super.setVisible(z, z2);
        if (z) {
            b bVar = this.i;
            if (bVar == b.PLAY) {
                i();
            } else if (bVar == b.RESUME) {
                k();
            }
        } else if (this.e.isRunning()) {
            w();
            this.i = b.RESUME;
        } else if (!z3) {
            this.i = b.NONE;
        }
        return visible;
    }

    @Override
    @MainThread
    public void start() {
        Drawable.Callback callback = getCallback();
        if ((callback instanceof View) && ((View) callback).isInEditMode()) {
            return;
        }
        i();
    }

    @Override
    @MainThread
    public void stop() {
        j();
    }

    public v t() {
        return this.c;
    }

    public boolean u() {
        return this.p == null && this.c == null && this.d.j().size() > 0;
    }

    @Override
    public void unscheduleDrawable(Drawable drawable, Runnable runnable) {
        Drawable.Callback callback = getCallback();
        if (callback == null) {
            return;
        }
        callback.unscheduleDrawable(this, runnable);
    }

    public f v() {
        return this.d;
    }

    public void w() {
        this.j.clear();
        this.e.m();
        if (isVisible()) {
            return;
        }
        this.i = b.NONE;
    }

    @FloatRange(from = 0.0d, to = 1.0d)
    public float x() {
        return this.e.f();
    }

    public boolean a() {
        return this.q;
    }

    public void b(boolean z) {
        if (z != this.s) {
            this.s = z;
            com.bytedance.adsdk.lottie.c.c.b bVar = this.t;
            if (bVar != null) {
                bVar.b(z);
            }
            invalidateSelf();
        }
    }

    public void c(boolean z) {
        this.r = z;
    }

    public void d(boolean z) {
        this.v = z;
        f fVar = this.d;
        if (fVar != null) {
            fVar.b(z);
        }
    }

    public void e(boolean z) {
        if (this.w == z) {
            return;
        }
        this.w = z;
        com.bytedance.adsdk.lottie.c.c.b bVar = this.t;
        if (bVar != null) {
            bVar.a(z);
        }
    }

    public void g(boolean z) {
        this.h = z;
    }

    public void a(boolean z) {
        if (this.q == z) {
            return;
        }
        this.q = z;
        if (this.d != null) {
            z();
        }
    }

    public void c(final String str) {
        f fVar = this.d;
        if (fVar == null) {
            this.j.add(new a() {
                @Override
                public void a(f fVar2) {
                    h.this.c(str);
                }
            });
            return;
        }
        com.bytedance.adsdk.lottie.c.f c = fVar.c(str);
        if (c != null) {
            b((int) (c.a + c.b));
            return;
        }
        throw new IllegalArgumentException("Cannot find marker with name " + str + ".");
    }

    public void f(boolean z) {
        this.x = z;
    }

    public void g(String str) {
        this.a = str;
        com.bytedance.adsdk.lottie.b.a C = C();
        if (C != null) {
            C.a(str);
        }
    }

    public i f(String str) {
        f fVar = this.d;
        if (fVar == null) {
            return null;
        }
        return fVar.l().get(str);
    }

    public void d(final String str) {
        f fVar = this.d;
        if (fVar == null) {
            this.j.add(new a() {
                @Override
                public void a(f fVar2) {
                    h.this.d(str);
                }
            });
            return;
        }
        com.bytedance.adsdk.lottie.c.f c = fVar.c(str);
        if (c != null) {
            int i = (int) c.a;
            a(i, ((int) c.b) + i);
        } else {
            throw new IllegalArgumentException("Cannot find marker with name " + str + ".");
        }
    }

    public void e(int i) {
        this.e.setRepeatCount(i);
    }

    public void a(String str) {
        this.m = str;
    }

    public boolean b() {
        return this.s;
    }

    public Bitmap e(String str) {
        com.bytedance.adsdk.lottie.b.b B = B();
        if (B != null) {
            return B.a(str);
        }
        return null;
    }

    public boolean a(f fVar) {
        if (this.d == fVar) {
            return false;
        }
        this.M = true;
        h();
        this.d = fVar;
        z();
        this.e.a(fVar);
        d(this.e.getAnimatedFraction());
        Iterator it = new ArrayList(this.j).iterator();
        while (it.hasNext()) {
            a aVar = (a) it.next();
            if (aVar != null) {
                aVar.a(fVar);
            }
            it.remove();
        }
        this.j.clear();
        fVar.b(this.v);
        y();
        Drawable.Callback callback = getCallback();
        if (callback instanceof ImageView) {
            ImageView imageView = (ImageView) callback;
            imageView.setImageDrawable(null);
            imageView.setImageDrawable(this);
        }
        return true;
    }

    public void b(final int i) {
        if (this.d == null) {
            this.j.add(new a() {
                @Override
                public void a(f fVar) {
                    h.this.b(i);
                }
            });
        } else {
            this.e.b(i + 0.99f);
        }
    }

    public void c(float f) {
        this.e.c(f);
    }

    public void c(final int i) {
        if (this.d == null) {
            this.j.add(new a() {
                @Override
                public void a(f fVar) {
                    h.this.c(i);
                }
            });
        } else {
            this.e.a(i);
        }
    }

    public void h(boolean z) {
        this.g = z;
    }

    public void b(@FloatRange(from = 0.0d, to = 1.0d) final float f) {
        f fVar = this.d;
        if (fVar == null) {
            this.j.add(new a() {
                @Override
                public void a(f fVar2) {
                    h.this.b(f);
                }
            });
        } else {
            this.e.b(com.bytedance.adsdk.lottie.f.g.a(fVar.f(), this.d.g(), f));
        }
    }

    public void d(@FloatRange(from = 0.0d, to = 1.0d) final float f) {
        if (this.d == null) {
            this.j.add(new a() {
                @Override
                public void a(f fVar) {
                    h.this.d(f);
                }
            });
            return;
        }
        e.a("Drawable#setProgress");
        this.e.a(this.d.a(f));
        e.b("Drawable#setProgress");
    }

    public void b(final String str) {
        f fVar = this.d;
        if (fVar == null) {
            this.j.add(new a() {
                @Override
                public void a(f fVar2) {
                    h.this.b(str);
                }
            });
            return;
        }
        com.bytedance.adsdk.lottie.c.f c = fVar.c(str);
        if (c != null) {
            a((int) c.a);
            return;
        }
        throw new IllegalArgumentException("Cannot find marker with name " + str + ".");
    }

    public void i(boolean z) {
        this.e.c(z);
    }

    public void d(int i) {
        this.e.setRepeatMode(i);
    }

    private void b(int i, int i2) {
        Bitmap bitmap = this.B;
        if (bitmap != null && bitmap.getWidth() >= i && this.B.getHeight() >= i2) {
            if (this.B.getWidth() > i || this.B.getHeight() > i2) {
                Bitmap createBitmap = Bitmap.createBitmap(this.B, 0, 0, i, i2);
                this.B = createBitmap;
                this.C.setBitmap(createBitmap);
                this.M = true;
                return;
            }
            return;
        }
        Bitmap createBitmap2 = Bitmap.createBitmap(i, i2, Bitmap.Config.ARGB_8888);
        this.B = createBitmap2;
        this.C.setBitmap(createBitmap2);
        this.M = true;
    }

    public void a(u uVar) {
        this.y = uVar;
        y();
    }

    public void a(final int i) {
        if (this.d == null) {
            this.j.add(new a() {
                @Override
                public void a(f fVar) {
                    h.this.a(i);
                }
            });
        } else {
            this.e.a(i);
        }
    }

    public void a(final float f) {
        f fVar = this.d;
        if (fVar == null) {
            this.j.add(new a() {
                @Override
                public void a(f fVar2) {
                    h.this.a(f);
                }
            });
        } else {
            a((int) com.bytedance.adsdk.lottie.f.g.a(fVar.f(), this.d.g(), f));
        }
    }

    public void a(final int i, final int i2) {
        if (this.d == null) {
            this.j.add(new a() {
                @Override
                public void a(f fVar) {
                    h.this.a(i, i2);
                }
            });
        } else {
            this.e.a(i, i2 + 0.99f);
        }
    }

    public void a(Boolean bool) {
        this.f = bool.booleanValue();
    }

    public void a(d dVar) {
        this.n = dVar;
        com.bytedance.adsdk.lottie.b.b bVar = this.l;
        if (bVar != null) {
            bVar.a(dVar);
        }
    }

    public void a(c cVar) {
        this.b = cVar;
        com.bytedance.adsdk.lottie.b.a aVar = this.o;
        if (aVar != null) {
            aVar.a(cVar);
        }
    }

    public void a(Map<String, Typeface> map) {
        if (map == this.p) {
            return;
        }
        this.p = map;
        invalidateSelf();
    }

    public void a(v vVar) {
        this.c = vVar;
    }

    public Bitmap a(String str, Bitmap bitmap) {
        com.bytedance.adsdk.lottie.b.b B = B();
        if (B == null) {
            com.bytedance.adsdk.lottie.f.d.b("Cannot update bitmap. Most likely the drawable is not added to a View which prevents Lottie from getting a Context.");
            return null;
        }
        Bitmap a2 = B.a(str, bitmap);
        invalidateSelf();
        return a2;
    }

    @RestrictTo({RestrictTo.Scope.LIBRARY})
    public Typeface a(com.bytedance.adsdk.lottie.c.c cVar) {
        Map<String, Typeface> map = this.p;
        if (map != null) {
            String a2 = cVar.a();
            if (map.containsKey(a2)) {
                return map.get(a2);
            }
            String b2 = cVar.b();
            if (map.containsKey(b2)) {
                return map.get(b2);
            }
            String str = cVar.a() + "-" + cVar.c();
            if (map.containsKey(str)) {
                return map.get(str);
            }
        }
        com.bytedance.adsdk.lottie.b.a C = C();
        if (C != null) {
            return C.a(cVar);
        }
        return null;
    }

    private void a(Canvas canvas) {
        com.bytedance.adsdk.lottie.c.c.b bVar = this.t;
        f fVar = this.d;
        if (bVar == null || fVar == null) {
            return;
        }
        this.A.reset();
        if (!getBounds().isEmpty()) {
            this.A.preScale(r2.width() / fVar.d().width(), r2.height() / fVar.d().height());
            this.A.preTranslate(r2.left, r2.top);
        }
        bVar.a(canvas, this.A, this.u);
    }

    private void a(Canvas canvas, com.bytedance.adsdk.lottie.c.c.b bVar) {
        if (this.d == null || bVar == null) {
            return;
        }
        E();
        canvas.getMatrix(this.K);
        canvas.getClipBounds(this.D);
        a(this.D, this.E);
        this.K.mapRect(this.E);
        a(this.E, this.D);
        if (this.s) {
            this.J.set(0.0f, 0.0f, getIntrinsicWidth(), getIntrinsicHeight());
        } else {
            bVar.a(this.J, (Matrix) null, false);
        }
        this.K.mapRect(this.J);
        Rect bounds = getBounds();
        float width = bounds.width() / getIntrinsicWidth();
        float height = bounds.height() / getIntrinsicHeight();
        a(this.J, width, height);
        if (!F()) {
            RectF rectF = this.J;
            Rect rect = this.D;
            rectF.intersect(rect.left, rect.top, rect.right, rect.bottom);
        }
        int ceil = (int) Math.ceil(this.J.width());
        int ceil2 = (int) Math.ceil(this.J.height());
        if (ceil == 0 || ceil2 == 0) {
            return;
        }
        b(ceil, ceil2);
        if (this.M) {
            this.A.set(this.K);
            this.A.preScale(width, height);
            Matrix matrix = this.A;
            RectF rectF2 = this.J;
            matrix.postTranslate(-rectF2.left, -rectF2.top);
            this.B.eraseColor(0);
            bVar.a(this.C, this.A, this.u);
            this.K.invert(this.L);
            this.L.mapRect(this.I, this.J);
            a(this.I, this.H);
        }
        this.G.set(0, 0, ceil, ceil2);
        canvas.drawBitmap(this.B, this.G, this.H, this.F);
    }

    private void a(RectF rectF, Rect rect) {
        rect.set((int) Math.floor(rectF.left), (int) Math.floor(rectF.top), (int) Math.ceil(rectF.right), (int) Math.ceil(rectF.bottom));
    }

    private void a(Rect rect, RectF rectF) {
        rectF.set(rect.left, rect.top, rect.right, rect.bottom);
    }

    private void a(RectF rectF, float f, float f2) {
        rectF.set(rectF.left * f, rectF.top * f2, rectF.right * f, rectF.bottom * f2);
    }
}