正在查看: Tasker v6.5.11 应用的 DoodleEdit.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Tasker v6.5.11 应用的 DoodleEdit.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package net.dinglisch.android.taskerm;
import android.content.ComponentName;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BlurMaskFilter;
import android.graphics.DashPathEffect;
import android.graphics.EmbossMaskFilter;
import android.graphics.MaskFilter;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageView;
import net.dinglisch.android.taskerm.DoodleView;
import net.dinglisch.android.taskerm.fn;
public class DoodleEdit extends MyActivity {
private View[] A;
private String[] B;
private FrameLayout[] C;
private int D = 0;
private int E = 0;
private lk F;
private DoodleView v;
private Button w;
private ImageView x;
private ImageView y;
private ImageView z;
class a implements View.OnClickListener {
a() {
}
@Override
public void onClick(View view) {
DoodleEdit.this.E0();
}
}
class b implements View.OnClickListener {
final int i;
b(int i) {
this.i = i;
}
@Override
public void onClick(View view) {
DoodleEdit.this.A0(this.i);
Paint paint = DoodleEdit.this.v.getPaint();
if (this.i == 0) {
lp.a(DoodleEdit.this, 0, 2131890933, 1);
DoodleEdit.this.x.setEnabled(false);
DoodleEdit.this.y.setEnabled(false);
DoodleEdit.this.v.j();
paint.reset();
int parseInt = Integer.parseInt(DoodleEdit.this.w.getText().toString()) + 4;
paint.setStrokeWidth(parseInt);
DoodleEdit.this.D0(parseInt);
paint.setStyle(Paint.Style.STROKE);
paint.setStrokeCap(Paint.Cap.ROUND);
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));
} else if (DoodleEdit.this.v.g()) {
DoodleEdit.this.x.setEnabled(true);
DoodleEdit.this.y.setEnabled(true);
DoodleEdit.this.v.i();
DoodleEdit doodleEdit = DoodleEdit.this;
doodleEdit.D0((int) doodleEdit.v.getPaint().getStrokeWidth());
}
paint.setColor(dh.b(DoodleEdit.this.B[this.i]));
}
}
class c implements View.OnLongClickListener {
final int i;
class a extends Handler {
a() {
}
@Override
public void handleMessage(Message message) {
if (message.what == 0) {
DoodleEdit.this.B[c.this.i] = dh.d(message.getData().getInt("colour"));
DoodleEdit.this.A[c.this.i].performClick();
}
}
}
c(int i) {
this.i = i;
}
@Override
public boolean onLongClick(View view) {
b1.y(DoodleEdit.this, new a(), dh.b(DoodleEdit.this.B[this.i])).x(DoodleEdit.this);
return true;
}
}
class d extends Handler {
d() {
}
@Override
public void handleMessage(Message message) {
if (message.what == 0) {
DoodleEdit.this.v.a();
}
}
}
class e extends Handler {
final int[] a;
e(int[] iArr) {
this.a = iArr;
}
@Override
public void handleMessage(Message message) {
if (message.what == 1) {
int i = message.getData().getInt("index");
Paint paint = DoodleEdit.this.v.getPaint();
Paint.Cap cap = Paint.Cap.ROUND;
Paint.Style style = Paint.Style.STROKE;
DashPathEffect dashPathEffect = null;
switch (this.a[i]) {
case 2131888776:
style = Paint.Style.FILL;
break;
case 2131888777:
dashPathEffect = new DashPathEffect(new float[]{20.0f, 20.0f}, 0.0f);
break;
case 2131888778:
dashPathEffect = new DashPathEffect(new float[]{10.0f, 20.0f}, 0.0f);
break;
case 2131888779:
dashPathEffect = new DashPathEffect(new float[]{3.0f, 20.0f}, 0.0f);
break;
case 2131888780:
break;
case 2131888781:
cap = Paint.Cap.BUTT;
break;
default:
return;
}
DoodleEdit.this.E = i;
paint.setPathEffect(dashPathEffect);
paint.setStrokeCap(cap);
paint.setStyle(style);
}
}
}
class f extends Handler {
final int[] a;
f(int[] iArr) {
this.a = iArr;
}
@Override
public void handleMessage(Message message) {
MaskFilter embossMaskFilter;
if (message.what == 1) {
int i = message.getData().getInt("index");
switch (this.a[i]) {
case 2131888835:
embossMaskFilter = new EmbossMaskFilter(new float[]{1.0f, 1.0f, 1.0f}, 0.4f, 6.0f, 3.5f);
break;
case 2131888836:
embossMaskFilter = new BlurMaskFilter(8.0f, BlurMaskFilter.Blur.INNER);
break;
case 2131888837:
embossMaskFilter = new BlurMaskFilter(8.0f, BlurMaskFilter.Blur.NORMAL);
break;
case 2131888838:
embossMaskFilter = new BlurMaskFilter(8.0f, BlurMaskFilter.Blur.OUTER);
break;
case 2131888839:
embossMaskFilter = new BlurMaskFilter(8.0f, BlurMaskFilter.Blur.SOLID);
break;
default:
embossMaskFilter = null;
break;
}
DoodleEdit.this.D = i;
DoodleEdit.this.v.getPaint().setMaskFilter(embossMaskFilter);
}
}
}
class g implements fn.b {
g() {
}
@Override
public void a(int i) {
DoodleEdit.this.v.getPaint().setStrokeWidth(i);
DoodleEdit.this.D0(i);
}
@Override
public void b(int i) {
}
}
class h implements View.OnClickListener {
h() {
}
@Override
public void onClick(View view) {
DoodleEdit.this.F0();
}
}
class i implements View.OnClickListener {
i() {
}
@Override
public void onClick(View view) {
DoodleEdit.this.C0();
}
}
class j implements View.OnClickListener {
j() {
}
@Override
public void onClick(View view) {
DoodleEdit.this.v.n();
}
}
class k implements DoodleView.a {
k() {
}
@Override
public void a(boolean z) {
DoodleEdit.this.z.setVisibility(z ? 0 : 4);
}
}
class l implements View.OnClickListener {
l() {
}
@Override
public void onClick(View view) {
DoodleEdit.this.G0();
}
}
public void A0(int i2) {
for (int i3 = 0; i3 < this.C.length; i3++) {
int b2 = dh.b(this.B[i3]);
if (i3 == i2) {
this.C[i3].setBackgroundColor(b2);
} else {
this.C[i3].setBackgroundColor(0);
}
this.A[i3].setBackgroundColor(b2);
}
}
private void B0() {
int I2 = dq.I2(240);
int I22 = dq.I2(240);
Bitmap n4 = this.F.n4(this, I2, I22);
if (n4 == null) {
this.v.d(I2, I22);
} else {
this.v.setBitmap(n4);
}
this.B[0] = "#FF000000";
for (int i2 = 1; i2 < this.A.length; i2++) {
this.B[i2] = this.F.p4(i2 - 1);
}
A0(1);
this.v.setEnabled(true);
lp.d(this, 2131890932);
Paint paint = this.v.getPaint();
paint.setAntiAlias(true);
paint.setDither(true);
paint.setColor(dh.b(this.B[1]));
paint.setStrokeWidth(12.0f);
paint.setStyle(Paint.Style.STROKE);
paint.setStrokeJoin(Paint.Join.ROUND);
paint.setStrokeCap(Paint.Cap.ROUND);
}
public void C0() {
int[] iArr = {2131888780, 2131888781, 2131888779, 2131888778, 2131888777, 2131888776};
wj.D(this, new e(iArr), 2131887532).Q(this.E).I(vh.s(getResources(), iArr)).C(this);
}
public void D0(int i2) {
this.w.setText(String.valueOf(i2));
}
public void E0() {
new fn(this).a(2131887459, Integer.parseInt(this.w.getText().toString()), 2, 60, new g()).show();
}
public void F0() {
TextBoxDialogFragment.Y(this, new d(), 2131887317);
}
public void G0() {
int[] iArr = {2131888840, 2131888837, 2131888839, 2131888836, 2131888838, 2131888835};
wj.D(this, new f(iArr), 2131887531).I(vh.s(getResources(), iArr)).Q(this.D).C(this);
}
public static Intent w0(lk lkVar) {
Intent intent = new Intent();
intent.setComponent(new ComponentName(th.B(), DoodleEdit.class.getName()));
intent.putExtra("doodle", lkVar.U(0).c0());
return intent;
}
private void x0() {
this.v = (DoodleView) findViewById(2131296844);
findViewById(2131296484).setOnClickListener(new h());
ImageView imageView = (ImageView) findViewById(2131296483);
this.x = imageView;
imageView.setOnClickListener(new i());
ImageView imageView2 = (ImageView) findViewById(2131296486);
this.z = imageView2;
imageView2.setOnClickListener(new j());
this.z.setVisibility(4);
this.v.setBufferListener(new k());
ImageView imageView3 = (ImageView) findViewById(2131296485);
this.y = imageView3;
imageView3.setOnClickListener(new l());
Button button = (Button) findViewById(2131296463);
this.w = button;
button.setOnClickListener(new a());
View[] viewArr = new View[lk.t4() + 1];
this.A = viewArr;
this.B = new String[viewArr.length];
this.C = new FrameLayout[viewArr.length];
int[] iArr = {2131296715, 2131296716, 2131296717, 2131296718, 2131296719, 2131296720, 2131296721};
int[] iArr2 = {2131296722, 2131296723, 2131296724, 2131296725, 2131296726, 2131296727, 2131296728};
for (int i2 = 0; i2 < 7; i2++) {
this.A[i2] = findViewById(iArr[i2]);
this.C[i2] = (FrameLayout) findViewById(iArr2[i2]);
this.A[i2].setOnClickListener(new b(i2));
if (i2 != 0) {
this.A[i2].setOnLongClickListener(new c(i2));
}
}
}
private void z0() {
this.F.z4(this.v.b());
int i2 = 1;
while (true) {
String[] strArr = this.B;
if (i2 >= strArr.length) {
Intent intent = new Intent();
intent.putExtra("doodle", this.F.U(0).c0());
setResult(-1, intent);
finish();
return;
}
this.F.y4(i2 - 1, strArr[i2]);
i2++;
}
}
@Override
public void onBackPressed() {
z0();
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
setResult(0);
setContentView(2131493231);
x0();
net.dinglisch.android.taskerm.a.T(this, false);
if (bundle == null) {
bundle = getIntent().getExtras();
}
y0(new lk(new qi(bundle.getBundle("doodle"))));
}
@Override
public void onDestroy() {
super.onDestroy();
DoodleView doodleView = this.v;
if (doodleView != null) {
doodleView.h();
this.v = null;
}
this.w = null;
this.x = null;
this.y = null;
this.z = null;
this.A = null;
this.B = null;
this.C = null;
this.F = null;
}
@Override
public boolean onOptionsItemSelected(MenuItem menuItem) {
int itemId = menuItem.getItemId();
if (itemId == 1) {
finish();
} else if (itemId == 16908332) {
z0();
}
return true;
}
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
super.onPrepareOptionsMenu(menu);
menu.clear();
net.dinglisch.android.taskerm.a.d(this, 1, menu);
return true;
}
public void y0(lk lkVar) {
this.F = lkVar;
B0();
}
}