导航菜单

页面标题

页面副标题

Crédito Express v1.0.3 - NewPhotoActivity.java 源代码

正在查看: Crédito Express v1.0.3 应用的 NewPhotoActivity.java JAVA 源代码文件

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


package com.creditoexpress.creditloan.ribbing.page;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.view.View;
import android.widget.LinearLayout;
import androidx.camera.core.ImageCaptureException;
import androidx.camera.core.j;
import androidx.camera.core.m;
import androidx.camera.lifecycle.e;
import com.creditoexpress.creditloan.R$raw;
import com.creditoexpress.creditloan.bunked.BaseActivity;
import com.creditoexpress.creditloan.ribbing.page.NewPhotoActivity;
import java.io.File;
import n2.i;
import s.k;

public class NewPhotoActivity extends BaseActivity {
    public i K;
    public j L;
    public Bitmap M;
    public String N;

    public class a implements j.n {

        public final File f5225a;

        public a(File file) {
            this.f5225a = file;
        }

        @Override
        public void a(j.p pVar) {
            NewPhotoActivity.this.a1(BitmapFactory.decodeFile(this.f5225a.getPath()));
        }

        @Override
        public void b(ImageCaptureException imageCaptureException) {
            imageCaptureException.printStackTrace();
            NewPhotoActivity.this.finish();
        }
    }

    public static void c1(View view) {
    }

    public void e1(View view) {
        if (b3.a.h()) {
            return;
        }
        m1();
    }

    public void f1(View view) {
        if (b3.a.h()) {
            return;
        }
        Z0();
    }

    private void k1() {
        this.K.f9291f.setImageResource(getIntent().getIntExtra("loftily", 0) == 1010 ? R$raw.exp_ic_photo_front : R$raw.exp_ic_photo_back);
        this.K.f9287b.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                NewPhotoActivity.c1(view);
            }
        });
        this.K.f9290e.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                NewPhotoActivity.this.d1(view);
            }
        });
        this.K.f9294i.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                NewPhotoActivity.this.e1(view);
            }
        });
        this.K.f9293h.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                NewPhotoActivity.this.f1(view);
            }
        });
        this.K.f9292g.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                NewPhotoActivity.this.g1(view);
            }
        });
    }

    public final void X0() {
        int min = (int) (Math.min(b3.a.g(this), b3.a.f(this)) * 0.75d);
        int i7 = (int) ((min * 75.0f) / 47.0f);
        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(i7, -1);
        LinearLayout.LayoutParams layoutParams2 = new LinearLayout.LayoutParams(i7, min);
        LinearLayout.LayoutParams layoutParams3 = new LinearLayout.LayoutParams((int) ((Math.max(b3.a.g(this), b3.a.f(this)) - i7) / 2.0f), -1);
        this.K.f9295j.setLayoutParams(layoutParams);
        this.K.f9291f.setLayoutParams(layoutParams2);
        this.K.f9289d.setLayoutParams(layoutParams3);
    }

    public final void Y0(e eVar) {
        int a7 = b3.a.a(this);
        int rotation = this.K.f9287b.getDisplay() != null ? this.K.f9287b.getDisplay().getRotation() : 0;
        m c7 = new m.a().g(a7).j(rotation).c();
        c7.R(this.K.f9287b.getSurfaceProvider());
        this.L = new j.h().f(1).h(a7).l(rotation).c();
        try {
            eVar.e(this, new k.a().d(1).b(), this.L, c7);
        } catch (Exception e7) {
            e7.printStackTrace();
        }
    }

    public final void Z0() {
        Bitmap bitmap = this.M;
        if (bitmap != null) {
            File file = new File(b3.a.i(b3.a.b(bitmap), this.N, this));
            if (!file.exists() || file.length() <= 0) {
                b3.a.c(this);
            } else {
                setResult(-1);
            }
        }
        finish();
    }

    public final void a1(Bitmap bitmap) {
        try {
            float width = this.K.f9299n.getWidth();
            float top2 = this.K.f9291f.getTop();
            float bottom = this.K.f9291f.getBottom();
            float width2 = bitmap.getWidth();
            float height = bitmap.getHeight();
            this.M = Bitmap.createBitmap(bitmap, (int) ((width / this.K.f9287b.getWidth()) * width2), (int) ((top2 / this.K.f9287b.getHeight()) * height), (int) ((((this.K.f9291f.getRight() + width) - width) / this.K.f9287b.getWidth()) * width2), (int) (((bottom - top2) / this.K.f9287b.getHeight()) * height));
            l1();
        } catch (Exception e7) {
            e7.printStackTrace();
        }
    }

    public final void b1(y4.a aVar) {
        try {
            Y0((e) aVar.get());
        } catch (Exception e7) {
            e7.printStackTrace();
            finish();
        }
    }

    public final void d1(View view) {
        finish();
    }

    public final void g1(View view) {
        i1();
    }

    public final void h1() {
        i iVar = this.K;
        if (iVar != null) {
            iVar.f9291f.setVisibility(8);
            this.K.f9287b.setVisibility(8);
            this.K.f9296k.setVisibility(8);
            this.K.f9288c.setVisibility(0);
            this.K.f9297l.setVisibility(0);
        }
    }

    public final void i1() {
        i iVar = this.K;
        if (iVar != null) {
            iVar.f9291f.setVisibility(0);
            this.K.f9287b.setVisibility(0);
            this.K.f9296k.setVisibility(0);
            this.K.f9288c.setVisibility(8);
            this.K.f9297l.setVisibility(8);
        }
    }

    public final void j1() {
        final y4.a f7 = e.f(this);
        f7.a(new Runnable() {
            @Override
            public final void run() {
                NewPhotoActivity.this.b1(f7);
            }
        }, r0.a.getMainExecutor(this));
    }

    public final void l1() {
        if (this.M != null) {
            this.K.f9288c.setLayoutParams(new LinearLayout.LayoutParams(this.K.f9291f.getWidth(), this.K.f9291f.getHeight()));
            this.K.f9288c.setImageBitmap(this.M);
            h1();
        }
    }

    public final void m1() {
        if (this.L == null) {
            return;
        }
        File file = new File(b3.a.e(this), this.N);
        this.L.q0(new j.o.a(file).a(), r0.a.getMainExecutor(this), new a(file));
    }

    @Override
    public void t0() {
        this.N = getIntent().getStringExtra("quashes");
        k1();
        j1();
        X0();
    }

    @Override
    public void w0() {
        i d7 = i.d(getLayoutInflater());
        this.K = d7;
        setContentView(d7.a());
        N0(this.K.a());
    }

    @Override
    public boolean x0() {
        return false;
    }
}