导航菜单

页面标题

页面副标题

BodyTech v7.6.4 - f.java 源代码

正在查看: BodyTech v7.6.4 应用的 f.java JAVA 源代码文件

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


package com.github.mikephil.charting.renderer;

import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.drawable.Drawable;
import com.github.mikephil.charting.animation.ChartAnimator;
import com.github.mikephil.charting.data.Entry;
import com.github.mikephil.charting.data.LineData;
import com.github.mikephil.charting.data.LineDataSet;
import com.github.mikephil.charting.formatter.ValueFormatter;
import com.github.mikephil.charting.highlight.Highlight;
import com.github.mikephil.charting.renderer.b;
import com.github.mikephil.charting.utils.MPPointD;
import com.github.mikephil.charting.utils.MPPointF;
import com.github.mikephil.charting.utils.Transformer;
import com.github.mikephil.charting.utils.ViewPortHandler;
import java.lang.ref.WeakReference;
import java.util.HashMap;
import java.util.List;

public class f extends e7.c {
    protected a7.g i;

    protected Paint f2460j;

    protected WeakReference<Bitmap> f2461k;

    protected Canvas f2462l;

    protected Bitmap.Config f2463m;

    protected Path f2464n;

    protected Path f2465o;

    private float[] f2466p;

    protected Path f2467q;

    private HashMap<b7.d, b> f2468r;

    private float[] f2469s;

    static class a {
        static final int[] a;

        static {
            int[] iArr = new int[LineDataSet.Mode.values().length];
            a = iArr;
            try {
                iArr[LineDataSet.Mode.LINEAR.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                a[LineDataSet.Mode.STEPPED.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                a[LineDataSet.Mode.CUBIC_BEZIER.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                a[LineDataSet.Mode.HORIZONTAL_BEZIER.ordinal()] = 4;
            } catch (NoSuchFieldError unused4) {
            }
        }
    }

    public f(a7.g gVar, ChartAnimator chartAnimator, ViewPortHandler viewPortHandler) {
        super(chartAnimator, viewPortHandler);
        this.f2463m = Bitmap.Config.ARGB_8888;
        this.f2464n = new Path();
        this.f2465o = new Path();
        this.f2466p = new float[4];
        this.f2467q = new Path();
        this.f2468r = new HashMap<>();
        this.f2469s = new float[2];
        this.i = gVar;
        Paint paint = new Paint(1);
        this.f2460j = paint;
        paint.setStyle(Paint.Style.FILL);
        this.f2460j.setColor(-1);
    }

    private void v(b7.e eVar, int i, int i8, Path path) {
        float a8 = eVar.X().a(eVar, this.i);
        float i9 = this.b.i();
        boolean z7 = eVar.o0() == LineDataSet.Mode.STEPPED;
        path.reset();
        ?? r8 = eVar.r(i);
        path.moveTo(r8.n(), a8);
        path.lineTo(r8.n(), r8.e() * i9);
        int i10 = i + 1;
        Entry entry = null;
        x6.d dVar = r8;
        while (i10 <= i8) {
            ?? r9 = eVar.r(i10);
            if (z7) {
                path.lineTo(r9.n(), dVar.e() * i9);
            }
            path.lineTo(r9.n(), r9.e() * i9);
            i10++;
            dVar = r9;
            entry = r9;
        }
        if (entry != null) {
            path.lineTo(entry.n(), a8);
        }
        path.close();
    }

    @Override
    public void b(Canvas canvas) {
        int n8 = (int) this.a.n();
        int m8 = (int) this.a.m();
        WeakReference<Bitmap> weakReference = this.f2461k;
        Bitmap bitmap = weakReference == null ? null : weakReference.get();
        if (bitmap == null || bitmap.getWidth() != n8 || bitmap.getHeight() != m8) {
            if (n8 <= 0 || m8 <= 0) {
                return;
            }
            bitmap = Bitmap.createBitmap(n8, m8, this.f2463m);
            this.f2461k = new WeakReference<>(bitmap);
            this.f2462l = new Canvas(bitmap);
        }
        bitmap.eraseColor(0);
        for (T t8 : this.i.getLineData().i()) {
            if (t8.isVisible()) {
                q(canvas, t8);
            }
        }
        canvas.drawBitmap(bitmap, 0.0f, 0.0f, this.c);
    }

    @Override
    public void c(Canvas canvas) {
        n(canvas);
    }

    @Override
    public void d(Canvas canvas, Highlight[] highlightArr) {
        LineData lineData = this.i.getLineData();
        for (Highlight highlight : highlightArr) {
            b7.e eVar = (b7.e) lineData.f(highlight.d());
            if (eVar != null && eVar.M0()) {
                ?? a02 = eVar.a0(highlight.h(), highlight.j());
                if (h(a02, eVar)) {
                    MPPointD e = this.i.getTransformer(eVar.J()).e(a02.n(), a02.e() * this.b.i());
                    highlight.m((float) e.e, (float) e.f2472k);
                    j(canvas, (float) e.e, (float) e.f2472k, eVar);
                }
            }
        }
    }

    @Override
    public void e(Canvas canvas) {
        int i;
        b7.e eVar;
        Entry entry;
        if (g(this.i)) {
            List<T> i8 = this.i.getLineData().i();
            for (int i9 = 0; i9 < i8.size(); i9++) {
                b7.e eVar2 = (b7.e) i8.get(i9);
                if (i(eVar2) && eVar2.J0() >= 1) {
                    a(eVar2);
                    Transformer transformer = this.i.getTransformer(eVar2.J());
                    int l02 = (int) (eVar2.l0() * 1.75f);
                    if (!eVar2.L0()) {
                        l02 /= 2;
                    }
                    int i10 = l02;
                    this.g.a(this.i, eVar2);
                    float h = this.b.h();
                    float i11 = this.b.i();
                    b.a aVar = this.g;
                    float[] c = transformer.c(eVar2, h, i11, aVar.a, aVar.b);
                    ValueFormatter p8 = eVar2.p();
                    MPPointF d = MPPointF.d(eVar2.K0());
                    d.e = g7.d.e(d.e);
                    d.f2475k = g7.d.e(d.f2475k);
                    int i12 = 0;
                    while (i12 < c.length) {
                        float f = c[i12];
                        float f8 = c[i12 + 1];
                        if (!this.a.C(f)) {
                            break;
                        }
                        if (this.a.B(f) && this.a.F(f8)) {
                            int i13 = i12 / 2;
                            Entry r8 = eVar2.r(this.g.a + i13);
                            if (eVar2.H()) {
                                entry = r8;
                                i = i10;
                                eVar = eVar2;
                                u(canvas, p8.h(r8), f, f8 - i10, eVar2.x(i13));
                            } else {
                                entry = r8;
                                i = i10;
                                eVar = eVar2;
                            }
                            if (entry.c() != null && eVar.c0()) {
                                Drawable c8 = entry.c();
                                g7.d.f(canvas, c8, (int) (f + d.e), (int) (f8 + d.f2475k), c8.getIntrinsicWidth(), c8.getIntrinsicHeight());
                            }
                        } else {
                            i = i10;
                            eVar = eVar2;
                        }
                        i12 += 2;
                        eVar2 = eVar;
                        i10 = i;
                    }
                    MPPointF.f(d);
                }
            }
        }
    }

    protected void n(Canvas canvas) {
        b bVar;
        Bitmap b8;
        this.c.setStyle(Paint.Style.FILL);
        float i = this.b.i();
        float[] fArr = this.f2469s;
        boolean z7 = false;
        float f = 0.0f;
        fArr[0] = 0.0f;
        fArr[1] = 0.0f;
        List i8 = this.i.getLineData().i();
        int i9 = 0;
        while (i9 < i8.size()) {
            b7.e eVar = (b7.e) i8.get(i9);
            if (eVar.isVisible() && eVar.L0() && eVar.J0() != 0) {
                this.f2460j.setColor(eVar.k());
                Transformer transformer = this.i.getTransformer(eVar.J());
                this.g.a(this.i, eVar);
                float l02 = eVar.l0();
                float N0 = eVar.N0();
                boolean z8 = (!eVar.R0() || N0 >= l02 || N0 <= f) ? z7 ? 1 : 0 : true;
                boolean z9 = (z8 && eVar.k() == 1122867) ? true : z7 ? 1 : 0;
                a aVar = null;
                if (this.f2468r.containsKey(eVar)) {
                    bVar = this.f2468r.get(eVar);
                } else {
                    bVar = new b(this, aVar);
                    this.f2468r.put(eVar, bVar);
                }
                if (bVar.c(eVar)) {
                    bVar.a(eVar, z8, z9);
                }
                b.a aVar2 = this.g;
                int i10 = aVar2.c;
                int i11 = aVar2.a;
                int i12 = i10 + i11;
                ?? r32 = z7;
                while (i11 <= i12) {
                    ?? r8 = eVar.r(i11);
                    if (r8 == 0) {
                        break;
                    }
                    this.f2469s[r32] = r8.n();
                    this.f2469s[1] = r8.e() * i;
                    transformer.k(this.f2469s);
                    if (!this.a.C(this.f2469s[r32])) {
                        break;
                    }
                    if (this.a.B(this.f2469s[r32]) && this.a.F(this.f2469s[1]) && (b8 = bVar.b(i11)) != null) {
                        float[] fArr2 = this.f2469s;
                        canvas.drawBitmap(b8, fArr2[r32] - l02, fArr2[1] - l02, (Paint) null);
                    }
                    i11++;
                    r32 = 0;
                }
            }
            i9++;
            z7 = false;
            f = 0.0f;
        }
    }

    protected void o(b7.e eVar) {
        float i = this.b.i();
        Transformer transformer = this.i.getTransformer(eVar.J());
        this.g.a(this.i, eVar);
        float n8 = eVar.n();
        this.f2464n.reset();
        b.a aVar = this.g;
        if (aVar.c >= 1) {
            int i8 = aVar.a;
            T r8 = eVar.r(Math.max(i8 - 1, 0));
            ?? r9 = eVar.r(Math.max(i8, 0));
            if (r9 != 0) {
                this.f2464n.moveTo(r9.n(), r9.e() * i);
                int i9 = this.g.a + 1;
                int i10 = -1;
                Entry entry = r9;
                Entry entry2 = r9;
                Entry entry3 = r8;
                while (true) {
                    b.a aVar2 = this.g;
                    Entry entry4 = entry2;
                    if (i9 > aVar2.c + aVar2.a) {
                        break;
                    }
                    if (i10 != i9) {
                        entry4 = eVar.r(i9);
                    }
                    int i11 = i9 + 1;
                    if (i11 < eVar.J0()) {
                        i9 = i11;
                    }
                    ?? r10 = eVar.r(i9);
                    this.f2464n.cubicTo(entry.n() + ((entry4.n() - entry3.n()) * n8), (entry.e() + ((entry4.e() - entry3.e()) * n8)) * i, entry4.n() - ((r10.n() - entry.n()) * n8), (entry4.e() - ((r10.e() - entry.e()) * n8)) * i, entry4.n(), entry4.e() * i);
                    entry3 = entry;
                    entry = entry4;
                    entry2 = r10;
                    int i12 = i9;
                    i9 = i11;
                    i10 = i12;
                }
            } else {
                return;
            }
        }
        if (eVar.m0()) {
            this.f2465o.reset();
            this.f2465o.addPath(this.f2464n);
            p(this.f2462l, eVar, this.f2465o, transformer, this.g);
        }
        this.c.setColor(eVar.M());
        this.c.setStyle(Paint.Style.STROKE);
        transformer.i(this.f2464n);
        this.f2462l.drawPath(this.f2464n, this.c);
        this.c.setPathEffect(null);
    }

    protected void p(Canvas canvas, b7.e eVar, Path path, Transformer transformer, b.a aVar) {
        float a8 = eVar.X().a(eVar, this.i);
        path.lineTo(eVar.r(aVar.a + aVar.c).n(), a8);
        path.lineTo(eVar.r(aVar.a).n(), a8);
        path.close();
        transformer.i(path);
        Drawable o8 = eVar.o();
        if (o8 != null) {
            m(canvas, path, o8);
        } else {
            l(canvas, path, eVar.S(), eVar.c());
        }
    }

    protected void q(Canvas canvas, b7.e eVar) {
        if (eVar.J0() < 1) {
            return;
        }
        this.c.setStrokeWidth(eVar.g());
        this.c.setPathEffect(eVar.g0());
        int i = a.a[eVar.o0().ordinal()];
        if (i == 3) {
            o(eVar);
        } else if (i != 4) {
            s(canvas, eVar);
        } else {
            r(eVar);
        }
        this.c.setPathEffect(null);
    }

    protected void r(b7.e eVar) {
        float i = this.b.i();
        Transformer transformer = this.i.getTransformer(eVar.J());
        this.g.a(this.i, eVar);
        this.f2464n.reset();
        b.a aVar = this.g;
        if (aVar.c >= 1) {
            ?? r8 = eVar.r(aVar.a);
            this.f2464n.moveTo(r8.n(), r8.e() * i);
            int i8 = this.g.a + 1;
            Entry entry = r8;
            while (true) {
                b.a aVar2 = this.g;
                if (i8 > aVar2.c + aVar2.a) {
                    break;
                }
                ?? r9 = eVar.r(i8);
                float n8 = entry.n() + ((r9.n() - entry.n()) / 2.0f);
                this.f2464n.cubicTo(n8, entry.e() * i, n8, r9.e() * i, r9.n(), r9.e() * i);
                i8++;
                entry = r9;
            }
        }
        if (eVar.m0()) {
            this.f2465o.reset();
            this.f2465o.addPath(this.f2464n);
            p(this.f2462l, eVar, this.f2465o, transformer, this.g);
        }
        this.c.setColor(eVar.M());
        this.c.setStyle(Paint.Style.STROKE);
        transformer.i(this.f2464n);
        this.f2462l.drawPath(this.f2464n, this.c);
        this.c.setPathEffect(null);
    }

    protected void s(Canvas canvas, b7.e eVar) {
        int J0 = eVar.J0();
        boolean z7 = eVar.o0() == LineDataSet.Mode.STEPPED;
        int i = z7 ? 4 : 2;
        Transformer transformer = this.i.getTransformer(eVar.J());
        float i8 = this.b.i();
        this.c.setStyle(Paint.Style.STROKE);
        Canvas canvas2 = eVar.i() ? this.f2462l : canvas;
        this.g.a(this.i, eVar);
        if (eVar.m0() && J0 > 0) {
            t(canvas, eVar, transformer, this.g);
        }
        if (eVar.z().size() > 1) {
            int i9 = i * 2;
            if (this.f2466p.length <= i9) {
                this.f2466p = new float[i * 4];
            }
            int i10 = this.g.a;
            while (true) {
                b.a aVar = this.g;
                if (i10 > aVar.c + aVar.a) {
                    break;
                }
                ?? r8 = eVar.r(i10);
                if (r8 != 0) {
                    this.f2466p[0] = r8.n();
                    this.f2466p[1] = r8.e() * i8;
                    if (i10 < this.g.b) {
                        ?? r9 = eVar.r(i10 + 1);
                        if (r9 == 0) {
                            break;
                        }
                        if (z7) {
                            this.f2466p[2] = r9.n();
                            float[] fArr = this.f2466p;
                            float f = fArr[1];
                            fArr[3] = f;
                            fArr[4] = fArr[2];
                            fArr[5] = f;
                            fArr[6] = r9.n();
                            this.f2466p[7] = r9.e() * i8;
                        } else {
                            this.f2466p[2] = r9.n();
                            this.f2466p[3] = r9.e() * i8;
                        }
                    } else {
                        float[] fArr2 = this.f2466p;
                        fArr2[2] = fArr2[0];
                        fArr2[3] = fArr2[1];
                    }
                    transformer.k(this.f2466p);
                    if (!this.a.C(this.f2466p[0])) {
                        break;
                    }
                    if (this.a.B(this.f2466p[2]) && (this.a.D(this.f2466p[1]) || this.a.A(this.f2466p[3]))) {
                        this.c.setColor(eVar.p0(i10));
                        canvas2.drawLines(this.f2466p, 0, i9, this.c);
                    }
                }
                i10++;
            }
        } else {
            int i11 = J0 * i;
            if (this.f2466p.length < Math.max(i11, i) * 2) {
                this.f2466p = new float[Math.max(i11, i) * 4];
            }
            if (eVar.r(this.g.a) != 0) {
                int i12 = this.g.a;
                int i13 = 0;
                while (true) {
                    b.a aVar2 = this.g;
                    if (i12 > aVar2.c + aVar2.a) {
                        break;
                    }
                    ?? r10 = eVar.r(i12 == 0 ? 0 : i12 - 1);
                    ?? r11 = eVar.r(i12);
                    if (r10 != 0 && r11 != 0) {
                        this.f2466p[i13] = r10.n();
                        int i14 = i13 + 2;
                        this.f2466p[i13 + 1] = r10.e() * i8;
                        if (z7) {
                            this.f2466p[i14] = r11.n();
                            this.f2466p[i13 + 3] = r10.e() * i8;
                            this.f2466p[i13 + 4] = r11.n();
                            i14 = i13 + 6;
                            this.f2466p[i13 + 5] = r10.e() * i8;
                        }
                        this.f2466p[i14] = r11.n();
                        this.f2466p[i14 + 1] = r11.e() * i8;
                        i13 = i14 + 2;
                    }
                    i12++;
                }
                if (i13 > 0) {
                    transformer.k(this.f2466p);
                    int max = Math.max((this.g.c + 1) * i, i) * 2;
                    this.c.setColor(eVar.M());
                    canvas2.drawLines(this.f2466p, 0, max, this.c);
                }
            }
        }
        this.c.setPathEffect(null);
    }

    protected void t(Canvas canvas, b7.e eVar, Transformer transformer, b.a aVar) {
        int i;
        int i8;
        Path path = this.f2467q;
        int i9 = aVar.a;
        int i10 = aVar.c + i9;
        int i11 = 0;
        do {
            i = (i11 * 128) + i9;
            i8 = i + 128;
            if (i8 > i10) {
                i8 = i10;
            }
            if (i <= i8) {
                v(eVar, i, i8, path);
                transformer.i(path);
                Drawable o8 = eVar.o();
                if (o8 != null) {
                    m(canvas, path, o8);
                } else {
                    l(canvas, path, eVar.S(), eVar.c());
                }
            }
            i11++;
        } while (i <= i8);
    }

    public void u(Canvas canvas, String str, float f, float f8, int i) {
        this.f.setColor(i);
        canvas.drawText(str, f, f8, this.f);
    }

    public void w() {
        Canvas canvas = this.f2462l;
        if (canvas != null) {
            canvas.setBitmap(null);
            this.f2462l = null;
        }
        WeakReference<Bitmap> weakReference = this.f2461k;
        if (weakReference != null) {
            Bitmap bitmap = weakReference.get();
            if (bitmap != null) {
                bitmap.recycle();
            }
            this.f2461k.clear();
            this.f2461k = null;
        }
    }

    private class b {
        private Path a;
        private Bitmap[] b;

        private b() {
            this.a = new Path();
        }

        protected void a(b7.e eVar, boolean z7, boolean z8) {
            int R = eVar.R();
            float l02 = eVar.l0();
            float N0 = eVar.N0();
            for (int i = 0; i < R; i++) {
                int i8 = (int) (l02 * 2.1d);
                Bitmap createBitmap = Bitmap.createBitmap(i8, i8, Bitmap.Config.ARGB_4444);
                Canvas canvas = new Canvas(createBitmap);
                this.b[i] = createBitmap;
                f.this.c.setColor(eVar.I0(i));
                if (z8) {
                    this.a.reset();
                    this.a.addCircle(l02, l02, l02, Path.Direction.CW);
                    this.a.addCircle(l02, l02, N0, Path.Direction.CCW);
                    canvas.drawPath(this.a, f.this.c);
                } else {
                    canvas.drawCircle(l02, l02, l02, f.this.c);
                    if (z7) {
                        canvas.drawCircle(l02, l02, N0, f.this.f2460j);
                    }
                }
            }
        }

        protected Bitmap b(int i) {
            Bitmap[] bitmapArr = this.b;
            return bitmapArr[i % bitmapArr.length];
        }

        protected boolean c(b7.e eVar) {
            int R = eVar.R();
            Bitmap[] bitmapArr = this.b;
            if (bitmapArr == null) {
                this.b = new Bitmap[R];
                return true;
            }
            if (bitmapArr.length == R) {
                return false;
            }
            this.b = new Bitmap[R];
            return true;
        }

        b(f fVar, a aVar) {
            this();
        }
    }

    @Override
    public void f() {
    }
}