正在查看: 万能钥匙 v1.1.23 应用的 ImageCropActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 万能钥匙 v1.1.23 应用的 ImageCropActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.wifitutu.widget.imagepicker.ui;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import androidx.core.content.FileProvider;
import c70.a;
import c70.d;
import com.meituan.robust.ChangeQuickRedirect;
import com.meituan.robust.PatchProxy;
import com.wifitutu.widget.imagepicker.bean.ImageItem;
import com.wifitutu.widget.imagepicker.view.CropImageView;
import java.io.File;
import java.util.ArrayList;
import x60.c;
import x60.f;
import x60.g;
import x60.h;
public class ImageCropActivity extends ImageBaseActivity implements View.OnClickListener, CropImageView.c {
public static ChangeQuickRedirect changeQuickRedirect;
public CropImageView P;
public Bitmap Q;
public boolean R;
public int S;
public int T;
public ArrayList<ImageItem> U;
public c V;
public int M(BitmapFactory.Options options, int i, int i2) {
int i3 = options.outWidth;
int i4 = options.outHeight;
if (i4 > i2 || i3 > i) {
return i3 > i4 ? i3 / i : i4 / i2;
}
return 1;
}
@Override
public void j(File file) {
if (PatchProxy.proxy(new Object[]{file}, this, changeQuickRedirect, false, 37102, new Class[]{File.class}, Void.TYPE).isSupported) {
return;
}
this.U.remove(0);
ImageItem imageItem = new ImageItem();
imageItem.b = file.getAbsolutePath();
try {
imageItem.c = FileProvider.getUriForFile(this, d.a(this), file);
} catch (Throwable unused) {
}
this.U.add(imageItem);
Intent intent = new Intent();
intent.putExtra("extra_result_items", this.U);
setResult(1004, intent);
finish();
}
@Override
public void onClick(View view) {
if (PatchProxy.proxy(new Object[]{view}, this, changeQuickRedirect, false, 37101, new Class[]{View.class}, Void.TYPE).isSupported) {
return;
}
int id = view.getId();
if (id == f.btn_back) {
setResult(0);
finish();
} else if (id == f.btn_ok) {
this.P.saveBitmapToFile(this.V.g(this), this.S, this.T, this.R);
}
}
@Override
public void onCreate(Bundle bundle) {
if (PatchProxy.proxy(new Object[]{bundle}, this, changeQuickRedirect, false, 37100, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
return;
}
super.onCreate(bundle);
setContentView(g.activity_image_crop);
this.V = c.l();
findViewById(f.btn_back).setOnClickListener(this);
Button button = (Button) findViewById(f.btn_ok);
button.setText(getString(h.ip_complete));
button.setOnClickListener(this);
((TextView) findViewById(f.tv_des)).setText(getString(h.ip_photo_crop));
CropImageView cropImageView = (CropImageView) findViewById(f.cv_crop_image);
this.P = cropImageView;
cropImageView.setOnBitmapSaveCompleteListener(this);
this.S = this.V.m();
this.T = this.V.n();
this.R = this.V.v();
ArrayList<ImageItem> q = this.V.q();
this.U = q;
String str = q.get(0).b;
this.P.setFocusStyle(this.V.r());
this.P.setFocusWidth(this.V.j());
this.P.setFocusHeight(this.V.i());
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeFile(str, options);
DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
options.inSampleSize = M(options, displayMetrics.widthPixels, displayMetrics.heightPixels);
options.inJustDecodeBounds = false;
Bitmap decodeFile = BitmapFactory.decodeFile(str, options);
this.Q = decodeFile;
CropImageView cropImageView2 = this.P;
cropImageView2.setImageBitmap(cropImageView2.rotate(decodeFile, a.a(str)));
}
public void onDestroy() {
if (PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 37103, new Class[0], Void.TYPE).isSupported) {
return;
}
super.onDestroy();
this.P.setOnBitmapSaveCompleteListener(null);
Bitmap bitmap = this.Q;
if (bitmap == null || bitmap.isRecycled()) {
return;
}
this.Q.recycle();
this.Q = null;
}
@Override
public void s(File file) {
}
}