正在查看: Tasker v6.6.3 应用的 SceneEditElement.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Tasker v6.6.3 应用的 SceneEditElement.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package net.dinglisch.android.taskerm;
import android.app.ActionBar;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.ActionMode;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.ScrollView;
import android.widget.SeekBar;
import android.widget.Spinner;
import android.widget.SpinnerAdapter;
import android.widget.TextView;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import net.dinglisch.android.taskerm.FileSelect;
import net.dinglisch.android.taskerm.HTMLView;
import net.dinglisch.android.taskerm.MacroEditView;
import net.dinglisch.android.taskerm.bk;
import net.dinglisch.android.taskerm.ck;
import net.dinglisch.android.taskerm.fp;
import net.dinglisch.android.taskerm.g7;
import net.dinglisch.android.taskerm.jl;
import net.dinglisch.android.taskerm.mj;
import net.dinglisch.android.taskerm.qj;
import net.dinglisch.android.taskerm.rk;
import net.dinglisch.android.taskerm.sh;
import net.dinglisch.android.taskerm.xk;
import net.dinglisch.android.taskerm.yj;
import net.dinglisch.android.taskerm.zj;
public class SceneEditElement extends HasArgsEdit implements View.OnClickListener, AdapterView.OnItemSelectedListener, jl.l {
private static HashMap<String, m> N0;
private EditText A0;
private Spinner B0;
private qj C0;
private mj E0;
private String F0;
protected EditText m0;
private jl n0;
private ImageView o0;
private RelativeLayout p0;
private sh q0;
private MacroEditView r0;
private TextView s0;
private TextView t0;
private LinearLayout u0;
private ScrollView v0;
private LinearLayout w0;
private ListView x0;
private View y0;
private CheckBox z0;
private int D0 = 0;
private boolean G0 = false;
private int H0 = 0;
private GeomEditView I0 = null;
private ViewGroup J0 = null;
private int K0 = 0;
private int L0 = 0;
private int M0 = 0;
class a implements Runnable {
final int i;
a(int i) {
this.i = i;
}
@Override
public void run() {
SceneEditElement.this.v0.setScrollY(this.i);
}
}
class b implements sh.j {
class a implements Runnable {
final int i;
a(int i) {
this.i = i;
}
@Override
public void run() {
SceneEditElement.this.q0.S(this.i);
}
}
b() {
}
@Override
public void a(int i, int i2, boolean z) {
}
@Override
public void b(boolean z) {
}
@Override
public void c(int i) {
}
@Override
public void d(int i) {
}
@Override
public void e(int i, int i2, int i3, int i4) {
}
@Override
public boolean f(int i, int i2, boolean z) {
SceneEditElement sceneEditElement = SceneEditElement.this;
sceneEditElement.L0 = sceneEditElement.K0;
SceneEditElement.this.K0 = i;
View currentFocus = SceneEditElement.this.getWindow().getCurrentFocus();
if (currentFocus != null && currentFocus.getClass() == EditText.class) {
pp.c3(SceneEditElement.this, (EditText) currentFocus, false, -1, -1L);
}
SceneEditElement sceneEditElement2 = SceneEditElement.this;
if (sceneEditElement2.r3(sceneEditElement2.K0, i2)) {
SceneEditElement.this.T3(i2, null, z);
} else {
SceneEditElement.this.p0.post(new a(SceneEditElement.this.K0));
SceneEditElement sceneEditElement3 = SceneEditElement.this;
sceneEditElement3.K0 = sceneEditElement3.L0;
}
if (SceneEditElement.this.I0 != null) {
int i3 = SceneEditElement.this.B3(i2) ? 0 : 8;
SceneEditElement.this.I0.setVisibility(i3);
SceneEditElement.this.J0.setVisibility(i3);
}
SceneEditElement.this.invalidateOptionsMenu();
return true;
}
@Override
public boolean g(int i) {
return false;
}
}
static class c {
static final int[] a;
static final int[] b;
static {
int[] iArr = new int[qj.k.values().length];
b = iArr;
try {
iArr[qj.k.SLIDER.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
b[qj.k.PICKER.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
b[qj.k.RECT.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
b[qj.k.OVAL.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
int[] iArr2 = new int[xk.d.values().length];
a = iArr2;
try {
iArr2[xk.d.File.ordinal()] = 1;
} catch (NoSuchFieldError unused5) {
}
try {
a[xk.d.Direct.ordinal()] = 2;
} catch (NoSuchFieldError unused6) {
}
}
}
class d extends jh {
d(Context context, rg rgVar, ImageView imageView, ImageView imageView2, ImageView imageView3) {
super(context, rgVar, imageView, imageView2, imageView3);
}
@Override
public boolean onActionItemClicked(ActionMode actionMode, MenuItem menuItem) {
int itemId = menuItem.getItemId();
if (itemId == 2) {
SceneEditElement.this.g3(d().f());
SceneEditElement.this.v();
} else if (itemId == 3) {
g(SceneEditElement.this.x0);
} else if (itemId == 4) {
h(true);
actionMode.invalidate();
return true;
}
return true;
}
@Override
public boolean onCreateActionMode(ActionMode actionMode, Menu menu) {
super.onCreateActionMode(actionMode, menu);
return SceneEditElement.this.U(actionMode);
}
@Override
public void onDestroyActionMode(ActionMode actionMode) {
super.onDestroyActionMode(actionMode);
SceneEditElement.this.U(null);
h(false);
}
@Override
public void onItemCheckedStateChanged(ActionMode actionMode, int i, long j, boolean z) {
if (!b()) {
super.onItemCheckedStateChanged(actionMode, i, j, z);
} else {
SceneEditElement.this.E3(d().f(), i);
SceneEditElement.this.v();
}
}
@Override
public boolean onPrepareActionMode(ActionMode actionMode, Menu menu) {
super.e(actionMode, menu, false);
if (this.g == -1) {
return false;
}
SceneEditElement sceneEditElement = SceneEditElement.this;
net.dinglisch.android.taskerm.a.k(sceneEditElement, 2, menu);
if (!d().b()) {
net.dinglisch.android.taskerm.a.P(SceneEditElement.this, 3, menu);
}
if (Settings.A1(sceneEditElement) == 5 && d().getCount() > 1) {
net.dinglisch.android.taskerm.a.B(sceneEditElement, 4, menu);
}
return true;
}
}
class e implements TextWatcher {
e() {
}
@Override
public void afterTextChanged(Editable editable) {
if (!SceneEditElement.this.G0 || editable.length() >= 2) {
return;
}
SceneEditElement.this.C0.x0().C5(editable.toString());
SceneEditElement.this.W3();
}
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
}
class f implements View.OnClickListener {
f() {
}
@Override
public void onClick(View view) {
gi.h(SceneEditElement.this, 2131889655, 2131887192);
}
}
class g implements View.OnTouchListener {
g() {
}
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
jl jlVar = SceneEditElement.this.n0;
SceneEditElement sceneEditElement = SceneEditElement.this;
return jlVar.h0(sceneEditElement, sceneEditElement.x0, SceneEditElement.this.y(), motionEvent);
}
}
class h implements AdapterView.OnItemClickListener {
h() {
}
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long j) {
SceneEditElement.this.b4(i);
}
}
class i implements MacroEditView.k {
final int a;
i(int i) {
this.a = i;
}
@Override
public void a() {
}
@Override
public void b() {
SceneEditElement.this.U3(this.a);
}
@Override
public void onCancel() {
SceneEditElement.this.U3(this.a);
}
}
class j extends Handler {
j() {
}
@Override
public void handleMessage(Message message) {
if (message.what == 0) {
SceneEditElement sceneEditElement = SceneEditElement.this;
sceneEditElement.v[sceneEditElement.D].setText(wg.d(message.getData().getInt("colour")));
}
}
}
class k extends Handler {
final int a;
k(int i) {
this.a = i;
}
@Override
public void handleMessage(Message message) {
if (message.what == 1) {
SceneEditElement.this.p3().C3(this.a, gl.q(SceneEditElement.this, bk.c.values()[message.getData().getInt("index")]));
SceneEditElement.this.V3(this.a);
xo.d(SceneEditElement.this, 2131890916);
}
}
}
class l implements Runnable {
final int i;
l(int i) {
this.i = i;
}
@Override
public void run() {
SceneEditElement.this.x0.setScrollY(this.i);
}
}
public class m {
String a;
int b;
int c;
public m() {
}
}
private boolean A3(int i2) {
return s3() && k3() == i2;
}
public boolean B3(int i2) {
return i2 == 0;
}
private boolean C3(int i2) {
return (B3(i2) || D3(i2) || A3(i2) || this.C0.h1() <= 0) ? false : true;
}
private boolean D3(int i2) {
return u3() && i2 == m3();
}
public void E3(List<Integer> list, int i2) {
zj u0 = this.C0.u0();
u0.G4(list, i2);
u0.I4();
}
private void F3() {
ListView listView = (ListView) findViewById(2131297060);
this.x0 = listView;
listView.setCacheColorHint(0);
this.y0 = findViewById(2131297220);
ImageView imageView = (ImageView) findViewById(2131296523);
this.o0 = imageView;
imageView.setOnClickListener(this);
this.x0.setChoiceMode(3);
this.x0.setItemsCanFocus(false);
this.x0.setOnTouchListener(new g());
this.x0.setOnItemClickListener(new h());
if (this.C0.x2()) {
rg n4 = this.C0.u0().n4(this, this.n0, g7.g.Build, null);
this.x0.setAdapter((ListAdapter) n4);
K3(n4);
}
this.w0 = (LinearLayout) findViewById(2131296767);
ScrollView scrollView = (ScrollView) findViewById(2131296768);
this.v0 = scrollView;
x1(scrollView);
MacroEditView macroEditView = (MacroEditView) findViewById(2131297573);
this.r0 = macroEditView;
macroEditView.setVisibility(4);
this.r0.setProjectId(this.M0);
TextView textView = (TextView) findViewById(2131296905);
this.s0 = textView;
textView.setVisibility(4);
this.s0.setText(oh.g(this, 2131891195, new Object[0]));
TextView textView2 = (TextView) findViewById(2131297574);
this.t0 = textView2;
textView2.setVisibility(4);
this.t0.setText(oh.g(this, 2131891280, new Object[0]));
LinearLayout linearLayout = (LinearLayout) findViewById(2131296879);
this.u0 = linearLayout;
linearLayout.setVisibility(4);
}
private boolean H3() {
if (C3(f3())) {
if (I3(f3())) {
if (this.r0.n1(!r0.getSelected().x())) {
J3(f3());
}
}
return false;
}
if (!d4()) {
return false;
}
N3();
M3();
Intent intent = new Intent();
if (this.C0.F2()) {
pk pkVar = (pk) this.C0;
if (pkVar.w4() > 0 && pkVar.x4() == 0) {
pkVar.O4(0);
}
} else if (this.C0.B2()) {
GeomEditView geomEditView = this.I0;
if (geomEditView != null) {
mj.g gVar = mj.g.Port;
int f2 = geomEditView.f(gVar);
int e2 = this.I0.e(gVar);
GeomEditView geomEditView2 = this.I0;
mj.g gVar2 = mj.g.Land;
intent.putExtra("gm", mj.J1(f2, e2, geomEditView2.f(gVar2), this.I0.e(gVar2)));
}
} else if (this.C0.E1() == qj.k.PICKER) {
for (mj.g gVar3 : mj.g.values()) {
if (this.C0.U0(gVar3) < 40) {
this.C0.t3(gVar3, 40);
}
}
}
intent.putExtra("el", this.C0.X(0).c0());
G3(this.E0.getName(), this.C0.getName(), f3(), e3());
setResult(-1, intent);
finish();
return true;
}
private boolean I3(int i2) {
int c4 = c4(i2);
if (this.C0.h(c4)) {
wj N02 = this.C0.N0(c4);
Class<?> cls = N02.getClass();
if (cls == yj.class) {
yj yjVar = (yj) N02;
yjVar.m(yj.a.values()[this.B0.getSelectedItemPosition()]);
String m1 = pp.m1(this.A0);
if (!TextUtils.isEmpty(m1)) {
yjVar.n(Integer.parseInt(m1));
}
this.C0.j3(c4, yjVar);
return true;
}
if (cls == xj.class) {
xj xjVar = (xj) N02;
xjVar.j(this.z0.isChecked());
xjVar.k(pp.m1(this.A0));
this.C0.j3(c4, xjVar);
return true;
}
o7.k("EE", "saveFilterValues: unhandled type");
}
return true;
}
private void J3(int i2) {
int i3;
fn selected = this.r0.getSelected();
int c4 = c4(i2);
if (selected.c1() > 0) {
this.r0.f0(-1);
i3 = this.r0.getSelectedID();
} else {
h3(selected.P0());
i3 = -1;
}
int B1 = this.C0.B1(c4);
if (B1 != -1 && i3 != B1) {
h3(B1);
}
this.C0.G3(c4, i3);
}
private void K3(rg rgVar) {
this.x0.setMultiChoiceModeListener(new d(this, rgVar, this.o0, null, null));
}
private void L3(int i2) {
this.H0 = i2;
}
private void M3() {
GeomEditView geomEditView = this.I0;
if (geomEditView != null) {
geomEditView.i();
if (this.C0.B2()) {
this.I0.setSceneGeometry(this.E0);
} else {
this.I0.setElementGeometry(this.C0);
}
}
}
private void N3() {
int intValue;
qj p3 = p3();
for (int i2 = 0; i2 < p3.e0(); i2++) {
int t0 = p3.t0(i2);
if (t0 == 0) {
if (p3.v1(getResources(), i2) != null) {
intValue = this.V[i2].getSelectedItemPosition();
} else if (!p3.s2(i2)) {
String m1 = pp.m1(this.v[i2]);
if (p3.t2(i2, 0) && wp.K(m1)) {
p3.y(i2).L(m1);
intValue = Integer.MAX_VALUE;
} else {
intValue = m1.length() == 0 ? 0 : pp.E3(m1).intValue();
}
} else if (this.y[i2]) {
C1(this.C0, i2);
intValue = Integer.MAX_VALUE;
} else {
intValue = this.P[i2].getProgress();
int b1 = p3.b1(i2);
if (b1 > Integer.MIN_VALUE) {
intValue += b1;
}
}
if (intValue != Integer.MAX_VALUE) {
p3.v3(i2, intValue);
}
} else if (t0 == 1) {
p3.D3(i2, pp.m1(this.v[i2]));
} else if (t0 == 3) {
p3.d3(i2, this.U[i2].isChecked());
} else if (t0 == 4) {
B1(this.C0, i2);
}
}
}
private void O3() {
qj p3 = p3();
for (int i2 = 0; i2 < p3.e0(); i2++) {
this.y[i2] = p3.t0(i2) == 0 && p3.r2(i2) && p3.y(i2).I();
}
}
private void P3(int i2) {
this.N[0].setVisibility((A3(i2) || D3(i2)) ? 8 : 0);
}
private void Q3() {
int i2 = (u3() && f3() == m3()) ? 0 : 8;
this.y0.setVisibility(i2);
this.o0.setVisibility(i2);
W3();
}
private void R3(int i2) {
int f3 = f3();
if (C3(f3)) {
this.r0.setTopAction(i2);
} else if (D3(f3)) {
new Handler().postDelayed(new l(i2), 200L);
} else {
new Handler().postDelayed(new a(i2), 200L);
}
}
private void S3() {
ActionBar actionBar = getActionBar();
if (actionBar == null) {
return;
}
actionBar.setSubtitle(this.C0.E1() == qj.k.PROPERTIES ? this.E0.getName() : this.C0.getName());
}
public void T3(int i2, fn fnVar, boolean z) {
int i3;
L3(i2);
int i4 = 0;
int i5 = 8;
int i6 = 4;
if (C3(i2)) {
z3(i2, fnVar, z);
i3 = x3(i2);
xo.d(this, 2131890955);
i6 = 0;
i4 = 4;
} else if (D3(i2)) {
S3();
i3 = 8;
i5 = 0;
i4 = 4;
} else {
S3();
w3();
P3(i2);
i3 = 8;
}
this.w0.setVisibility(i4);
this.t0.setVisibility(i6);
this.r0.setVisibility(i6);
this.u0.setVisibility(i3);
this.s0.setVisibility(i3);
this.y0.setVisibility(i5);
this.o0.setVisibility(i5);
}
public String U3(int i2) {
String g2 = B3(i2) ? oh.g(this, 2131887016, new Object[0]) : A3(i2) ? oh.g(this, 2131888773, new Object[0]) : D3(i2) ? this.C0.i1(getResources()) : oh.g(this, this.C0.R0()[c4(i2)], new Object[0]);
if (this.C0.B2() && this.q0.x() < 3 && i2 == 0 && g2.length() < 3) {
g2 = " " + g2 + " ";
}
this.q0.J(i2, g2);
return g2;
}
public void V3(int r27) {
throw new UnsupportedOperationException("Method not decompiled: net.dinglisch.android.taskerm.SceneEditElement.V3(int):void");
}
public void W3() {
RelativeLayout relativeLayout = (RelativeLayout) findViewById(2131297550);
this.p0 = relativeLayout;
relativeLayout.removeAllViews();
this.q0 = sh.A(this, this.p0, 0, 0, fp.x(this));
if (fp.k(this) == fp.a.Tangerine) {
this.q0.P(2130968984);
}
this.q0.V(new b());
this.q0.U(12);
this.q0.m(this, true);
if (u3()) {
this.q0.m(this, true);
}
if (s3()) {
this.q0.m(this, true);
}
if (f4()) {
for (int i2 = 0; i2 < this.C0.h1(); i2++) {
if (g4(i2)) {
this.q0.m(this, true);
}
}
}
for (int i3 = 0; i3 < this.q0.x(); i3++) {
U3(i3);
this.q0.G(i3);
}
this.q0.S(f3());
}
private void X3() {
a1.y(this, new j(), wg.b(pp.m1(this.v[this.D]))).x(this);
}
private void Y3(uj ujVar) {
startActivityForResult(DoodleEdit.w0(ujVar), 51);
}
private void Z3() {
HTMLView.H0(this, this.C0.V0(), -1, HTMLView.g.Inform);
}
private void a4(int i2) {
fj.D(this, new k(i2), 2131887568).I(bk.j5(getResources())).C(this);
}
public void b4(int i2) {
this.D = i2;
Intent intent = new Intent(this, (Class<?>) ListItemEdit.class);
if (i2 != -1) {
intent.putExtra("item", this.C0.u0().t4(i2).X(0).c0());
intent.putExtra("showSelect", this.C0.u0().H4());
intent.putExtra("imageSelectFlags", 383);
}
startActivityForResult(intent, 52);
}
private void c3() {
if (x0()) {
return;
}
LinearLayout linearLayout = (LinearLayout) findViewById(2131296405);
View inflate = LayoutInflater.from(this).inflate(2131492906, (ViewGroup) null);
LinearLayout linearLayout2 = (LinearLayout) LayoutInflater.from(this).inflate(2131492905, (ViewGroup) null);
TextView textView = (TextView) linearLayout2.findViewById(2131297021);
ImageView imageView = (ImageView) linearLayout2.findViewById(2131296510);
textView.setText(oh.g(this, 2131889655, new Object[0]));
if (p3().B2()) {
imageView.setVisibility(8);
} else {
imageView.setOnClickListener(new f());
}
this.I0 = new GeomEditView(this);
if (this.C0.B2()) {
this.I0.setGeomFromScene(this.E0);
this.I0.setWantPosition(false);
} else {
this.I0.setGeomFromElement(p3());
}
this.I0.setUIFromOri(this.E0.q1());
this.I0.setInitOri(this.E0.q1());
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -2);
LinearLayout linearLayout3 = new LinearLayout(this);
linearLayout3.setLayoutParams(layoutParams);
linearLayout3.setOrientation(0);
linearLayout3.setPadding(0, getResources().getDimensionPixelSize(2131165272), 0, 0);
LinearLayout linearLayout4 = new LinearLayout(this);
linearLayout4.setLayoutParams(layoutParams);
linearLayout4.setOrientation(1);
linearLayout.addView(linearLayout3, 1);
linearLayout3.addView(inflate, fp.Y(1), -1);
linearLayout3.addView(linearLayout4);
linearLayout4.addView(linearLayout2);
linearLayout4.addView(this.I0);
this.J0 = linearLayout2;
}
private int c4(int i2) {
int j3 = i2 - j3();
int i3 = 0;
while (i3 < this.C0.h1() && (!g4(i3) || j3 - 1 >= 0)) {
i3++;
}
return i3;
}
private int d3(qj qjVar, int i2, int i3) {
return (qj.I2(qjVar.E1()) && i2 == 3) ? i3 - 100 : i3;
}
private boolean d4() {
throw new UnsupportedOperationException("Method not decompiled: net.dinglisch.android.taskerm.SceneEditElement.d4():boolean");
}
private int e3() {
int f3 = f3();
return C3(f3) ? this.r0.getTopAction() : D3(f3) ? this.x0.getScrollY() : this.x0.getScrollY();
}
private boolean e4() {
int i2 = this.D0;
return (i2 & 4) == 0 && ((i2 & 32) == 0 || !this.C0.z2());
}
private int f3() {
return this.H0;
}
private boolean f4() {
return (this.D0 & 8) == 0;
}
public void g3(List<Integer> list) {
zj u0 = this.C0.u0();
u0.p4(list);
u0.I4();
U3(m3());
}
private boolean g4(int i2) {
boolean z = true;
if (this.C0.B2()) {
lk x0 = this.C0.x0();
if (i2 == this.C0.b0(qj.i.Key) && x0.y5()) {
z = false;
}
if (i2 == this.C0.b0(qj.i.IconClick) && (!x0.w5() || !x0.s5())) {
z = false;
}
if (i2 == this.C0.b0(qj.i.ItemSelected) && (!x0.w5() || x0.A1(7).length() == 0)) {
z = false;
}
}
if (this.C0.E1() == qj.k.TEXT && i2 == this.C0.b0(qj.i.Stroke) && ((rk) this.C0).O4() == rk.c.Scroll) {
z = false;
}
if (this.C0.e2(i2) && mj.C2(this.C0.B1(i2))) {
return false;
}
return z;
}
private void h3(int i2) {
if (fo.G3(i2)) {
return;
}
fo j2 = fo.j2(this);
if (!j2.U(i2) || j2.T(i2).x()) {
return;
}
j2.i1(i2);
}
private void i3() {
this.p0 = null;
this.q0.M();
this.q0 = null;
jl jlVar = this.n0;
if (jlVar != null) {
jlVar.i0();
this.n0 = null;
}
this.o0 = null;
this.m0 = null;
MacroEditView macroEditView = this.r0;
if (macroEditView != null) {
macroEditView.M0();
this.r0 = null;
}
this.s0 = null;
this.t0 = null;
this.u0 = null;
this.v0 = null;
this.w0 = null;
this.x0 = null;
this.y0 = null;
this.z0 = null;
this.A0 = null;
this.B0 = null;
this.I0 = null;
this.J0 = null;
this.C0 = null;
this.E0 = null;
}
private int j3() {
?? s3 = s3();
int i2 = s3;
if (t3()) {
i2 = s3 + 1;
}
return u3() ? i2 + 1 : i2;
}
private int k3() {
boolean t3 = t3();
return u3() ? (t3 ? 1 : 0) + 1 : t3 ? 1 : 0;
}
public static m l3(String str) {
HashMap<String, m> hashMap = N0;
if (hashMap == null || !hashMap.containsKey(str)) {
return null;
}
return N0.get(str);
}
private int m3() {
return t3() ? 1 : 0;
}
private xk.d o3() {
return xk.d.values()[U0(1)];
}
public qj p3() {
return A3(f3()) ? this.C0.z0() : this.C0;
}
private void q3(int i2) {
qj p3 = p3();
String y1 = p3.y1(i2);
if (p3.A2() && i2 == p3.w0().c5()) {
a4(i2);
return;
}
if (p3.L2() && i2 == 2 && o3() == xk.d.File) {
this.D = i2;
g2(i2, FileSelect.e.File, null);
return;
}
if (y1.equals("col")) {
this.D = i2;
X3();
} else if (y1.equals("f")) {
this.D = i2;
g2(i2, FileSelect.e.File, null);
} else if (y1.equals("font")) {
this.D = i2;
g2(i2, FileSelect.e.File, ".ttf");
}
}
public boolean r3(int i2, int i3) {
if (D3(i2)) {
return true;
}
if (B3(i2) || A3(i2)) {
if (d4()) {
N3();
if (!B3(i2)) {
return true;
}
M3();
return true;
}
} else if (I3(i2)) {
if (this.r0.n1(!r5.getSelected().x())) {
J3(i2);
return true;
}
}
return false;
}
private boolean s3() {
return this.C0.k();
}
private boolean t3() {
return true;
}
private boolean u3() {
qj qjVar;
boolean z = (this.D0 & 16) == 0 && this.C0.Z1();
if (z && (qjVar = this.C0) != null) {
if (qjVar.A2() && this.C0.w0().Y4() != ck.a.Manual) {
z = false;
}
if (this.C0.B2() && !this.C0.x0().w5()) {
return false;
}
}
return z;
}
private void v3() {
F3();
w3();
Q3();
}
private void w3() {
this.G0 = false;
t1(9, 4095);
for (int i2 = 0; i2 < 9; i2++) {
this.a0[i2].setOnClickListener(this);
this.b0[i2].setOnClickListener(this);
this.X[i2].setOnClickListener(this);
this.Y[i2].setOnClickListener(this);
this.U[i2].setOnClickListener(this);
}
this.d0[1].setOnClickListener(this);
this.d0[2].setOnClickListener(this);
this.d0[4].setOnClickListener(this);
if (this.C0.B2()) {
this.v[7].addTextChangedListener(new e());
}
this.f0[1].setOnClickListener(this);
P3(0);
c3();
O3();
V3(-1);
super.Z1(this, 9);
}
private int x3(int i2) {
int c4 = c4(i2);
if (!this.C0.h(c4)) {
return 8;
}
wj N02 = this.C0.N0(c4);
Class<?> cls = N02.getClass();
this.u0.removeAllViews();
LayoutInflater layoutInflater = getLayoutInflater();
if (cls == yj.class) {
yj yjVar = (yj) N02;
layoutInflater.inflate(2131494216, this.u0);
pp.M2(this, 2131297243, 2131889581);
pp.M2(this, 2131297242, 2131889737);
Spinner spinner = (Spinner) findViewById(2131297508);
this.B0 = spinner;
spinner.setAdapter((SpinnerAdapter) pp.h1(this, yj.f(getResources())));
this.B0.setSelection(yjVar.e(), false);
EditText editText = (EditText) findViewById(2131296863);
this.A0 = editText;
editText.setText(String.valueOf(yjVar.g()));
gi.o(this.A0, 2);
return 0;
}
if (cls != xj.class) {
return 0;
}
xj xjVar = (xj) N02;
layoutInflater.inflate(2131494215, this.u0);
if (this.C0.S0()[c4] == qj.i.LinkClick) {
pp.M2(this, 2131297242, 2131890053);
} else {
pp.M2(this, 2131297242, 2131891209);
}
pp.M2(this, 2131297241, 2131889992);
this.z0 = (CheckBox) findViewById(2131296604);
this.A0 = (EditText) findViewById(2131296863);
this.z0.setChecked(xjVar.e());
this.A0.setText(xjVar.i() ? xjVar.h() : "");
return 0;
}
private void y3() {
this.n0.b0(this, "EE", this.x0, this.o0, null, null, null, false, true, (ImageView) findViewById(2131297342), (ImageView) findViewById(2131297340), null, this);
}
private void z3(int i2, fn fnVar, boolean z) {
int c4 = c4(i2);
this.r0.s0(this, new i(i2), 2131891280, 66, z);
this.r0.setRelevantVariableNames(this.C0.P0(c4));
this.r0.setEditingSceneData(this.E0.getName(), this.E0.F1());
int B1 = this.C0.B1(c4);
if (fnVar != null) {
B1 = fnVar.P0();
} else if (B1 == -1) {
fnVar = fo.Z1();
} else if (fo.l2(this).U(B1)) {
fnVar = null;
} else {
pp.n0(this, 2131887920, new Object[0]);
fnVar = fo.Z1();
}
this.r0.setTask(fnVar, B1);
}
public void G3(String str, String str2, int i2, int i3) {
if (N0 == null) {
N0 = new HashMap<>();
}
m mVar = new m();
mVar.a = str2;
mVar.b = i2;
mVar.c = i3;
N0.put(str, mVar);
}
@Override
public w4 O0() {
return null;
}
@Override
public void U1(int i2) {
V3(i2);
}
@Override
public void e(jl.k kVar, int i2) {
List<Integer> linkedList;
if (y()) {
linkedList = ((rg) this.x0.getAdapter()).f();
v();
} else {
linkedList = new LinkedList<>();
linkedList.add(Integer.valueOf(this.n0.H()));
}
if (kVar == jl.k.DropBin) {
g3(linkedList);
} else if (i2 != -1) {
E3(linkedList, i2);
}
}
@Override
public void g(com.joaomgcd.taskerm.util.ac acVar, com.joaomgcd.taskerm.util.se seVar) {
}
public ck.a n3() {
if (this.C0.B2()) {
return ck.a.Manual;
}
int Z4 = this.C0.w0().Z4();
int selectedItemPosition = this.V[Z4].getSelectedItemPosition();
ck.a[] values = ck.a.values();
if (selectedItemPosition >= 0 && selectedItemPosition < values.length) {
return values[selectedItemPosition];
}
o7.G("EE", "element " + this.C0.getName() + ": argNo " + Z4 + ": bad fill type index: " + selectedItemPosition);
return ck.a.Manual;
}
@Override
protected void onActivityResult(int i2, int i3, Intent intent) {
qj p3 = p3();
if (MacroEditView.v0(i2)) {
this.r0.L0(i2, i3, intent);
return;
}
if (i3 == -1) {
if (i2 == 7) {
W0(intent.getExtras().getString("path"), "f", false, false);
return;
}
if (i2 == 52) {
h7 h7Var = new h7(new ii(intent.getBundleExtra("item")));
zj zjVar = (zj) p3();
if (this.D == -1) {
zjVar.m4(h7Var);
this.D = zjVar.w4() - 1;
} else {
zjVar.u4().set(this.D, h7Var);
}
if (h7Var.q()) {
zjVar.N4(this.D);
} else {
zjVar.q4(this.D);
}
zjVar.I4();
return;
}
if (i2 == 51) {
this.C0 = new uj(new ii(intent.getBundleExtra("doodle")));
V3(1);
return;
}
if (i2 == 3) {
p3.j0(this.D).r0(this.F.getPath());
V3(this.D);
return;
}
if (i2 != 2) {
if (i2 == 50 || i2 == 4) {
net.dinglisch.android.taskerm.g r0 = ImageSelect.r0(intent);
if (r0 == null) {
r0 = new net.dinglisch.android.taskerm.g();
}
if (i2 != 50) {
p3.u0().C4(getPackageManager(), this.D, r0);
return;
}
p3.u3(this.D, r0);
V3(this.D);
if (this.C0.B2()) {
W3();
return;
}
return;
}
return;
}
mj mjVar = new mj(new ii(intent.getBundleExtra("sc")));
p3.C3(this.D, mjVar);
p3.u0().K4();
V3(this.D);
if (this.C0.F2()) {
p3.U3(mjVar);
GeomEditView geomEditView = this.I0;
if (geomEditView != null) {
geomEditView.setWidthFromScene(mjVar);
this.I0.setHeightFromScene(mjVar);
return;
}
return;
}
if (this.C0.z2()) {
p3.W3(mjVar);
GeomEditView geomEditView2 = this.I0;
if (geomEditView2 != null) {
geomEditView2.setWidthFromScene(mjVar);
}
}
}
}
@Override
public void onBackPressed() {
H3();
}
@Override
public void onClick(View view) {
qj p3 = p3();
int id = view.getId();
if (id == 2131296510) {
Z3();
return;
}
if (id == 2131296523) {
b4(-1);
return;
}
for (int i2 = 0; i2 < p3.e0(); i2++) {
if (view == this.e0[i2]) {
q3(i2);
} else if (view == this.U[i2]) {
if (p3.L2() && i2 == 3 && this.U[i2].isChecked() && o3() != xk.d.Direct) {
xo.e(this, 1, 2131890985, 1);
}
} else if (view == this.f0[i2]) {
this.D = i2;
wp.O0(this.v[i2]);
if (p3.t0(i2) == 4) {
p2(2131887571, false, p3, null);
} else if (p3.y1(i2).equals("col")) {
p2(2131887571, false, p3, null);
} else {
p2(2131887428, true, p3, null);
}
} else if (view == this.d0[i2]) {
String w1 = w1(this.C0, i2);
V3(i2);
v1(this.C0, i2, w1, false);
} else if (view == this.a0[i2]) {
this.P[i2].incrementProgressBy(1);
SeekBar seekBar = this.P[i2];
onProgressChanged(seekBar, seekBar.getProgress(), true);
} else if (view == this.b0[i2]) {
this.P[i2].incrementProgressBy(-1);
SeekBar seekBar2 = this.P[i2];
onProgressChanged(seekBar2, seekBar2.getProgress(), true);
} else if (view == this.Y[i2]) {
this.D = i2;
u2(p3.j0(i2).A0(this));
} else if (view == this.X[i2]) {
if (p3.J2(qj.k.DOODLE) && i2 == 1) {
Y3((uj) p3);
} else if (p3.t0(i2) == 4) {
this.D = i2;
startActivityForResult(ImageSelect.s0(this, 511), 50);
} else if (p3.t0(i2) == 6) {
v2(i2, p3.r1(i2), 13);
}
}
}
}
@Override
public void onCreate(Bundle bundle) {
int i2;
int i3;
Bundle bundle2;
Bundle bundle3;
Bundle bundle4;
Intent intent = getIntent();
com.joaomgcd.taskerm.util.t2.e(intent);
super.p1(bundle, 2131494214);
ActionBar actionBar = getActionBar();
net.dinglisch.android.taskerm.a.T(this, true);
if (fp.f()) {
zq.a(getActionBar(), 0.0f);
}
this.n0 = new jl();
if (bundle != null) {
bundle3 = bundle.getBundle("el");
bundle4 = bundle.getBundle("sc");
this.M0 = bundle.getInt("projectid");
this.D0 = bundle.getInt("flags", 0);
i2 = bundle.getInt("curtab");
i3 = bundle.getInt("curpos");
bundle2 = bundle.containsKey("task") ? bundle.getBundle("task") : null;
} else {
i2 = 0;
i3 = 0;
bundle2 = null;
bundle3 = null;
bundle4 = null;
}
if (bundle3 == null && intent != null) {
bundle3 = intent.getBundleExtra("el");
bundle4 = intent.getBundleExtra("sc");
this.M0 = intent.getIntExtra("projectid", -1);
this.D0 = intent.getIntExtra("flags", 0);
i2 = intent.getIntExtra("curtab", 0);
i3 = intent.getIntExtra("curpos", 0);
}
int i4 = i3;
if (bundle3 == null) {
o7.k("EE", "no element bundle");
finish();
} else {
this.C0 = qj.g0(new ii(bundle3));
}
if (bundle4 == null) {
o7.k("EE", "no element bundle");
finish();
} else {
mj mjVar = new mj(new ii(bundle4));
this.E0 = mjVar;
mjVar.D3(getResources().getConfiguration().orientation);
}
this.F0 = this.C0.getName();
if (this.C0.E1() == qj.k.PROPERTIES) {
actionBar.setTitle(oh.g(this, 2131886899, new Object[0]));
} else {
actionBar.setTitle(oh.g(this, 2131886727, new Object[0]));
}
v3();
W3();
if (bundle != null) {
T3(f3(), bundle2 == null ? null : new fn(new ii(bundle2)), true);
}
y3();
qj qjVar = this.C0;
if (qjVar != null && qjVar.z2()) {
xo.e(this, 0, 2131890918, 2);
}
S3();
if (i2 != 0) {
this.q0.D(i2, true);
}
if (i4 != 0) {
R3(i4);
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
qj qjVar = this.C0;
if (qjVar != null && !qjVar.B2()) {
menu.add(0, 109, 0, oh.g(this, 2131888172, new Object[0]) + ": " + oh.g(this, qj.g1(this.C0.E1()), new Object[0]));
}
boolean r1 = super.r1(menu, 2131888892, -1);
if (C3(f3())) {
net.dinglisch.android.taskerm.a.N(this, 110, menu);
}
return r1;
}
@Override
public void onDestroy() {
super.onDestroy();
i3();
}
@Override
public void onItemSelected(AdapterView<?> adapterView, View view, int i2, long j2) {
qj p3 = p3();
if (p3.D2()) {
V3(3);
return;
}
if (p3.B2()) {
if (adapterView.equals(this.V[0])) {
p3.x0().B5(i2);
for (int i3 : lk.X4()) {
V3(i3);
}
}
W3();
return;
}
if (p3.A2()) {
ck w0 = p3.w0();
if (adapterView.equals(this.V[w0.Z4()])) {
w0.f5(ck.a.values()[i2]);
Q3();
V3(w0.e5());
return;
} else {
if (adapterView.equals(this.V[3])) {
p3.v0().m5(zj.a.values()[i2]);
return;
}
return;
}
}
if (!p3.L2()) {
if (p3.E1() == qj.k.TEXT && adapterView.equals(this.V[7])) {
((rk) this.C0).R4(rk.c.values()[i2]);
W3();
return;
}
return;
}
int i4 = c.a[o3().ordinal()];
if (i4 == 1 || i4 == 2) {
this.U[3].setChecked(true);
} else {
this.U[3].setChecked(false);
}
V3(2);
}
@Override
public void onNothingSelected(AdapterView<?> adapterView) {
}
@Override
public boolean onOptionsItemSelected(MenuItem menuItem) {
int itemId = menuItem.getItemId();
if (itemId == 6) {
finish();
return true;
}
if (itemId == 16908332) {
H3();
return true;
}
if (itemId == 109) {
Z3();
return true;
}
if (itemId != 110) {
return s1(menuItem, null, this.C0.B2() ? "activity_scenepropertiesedit.html" : "activity_elementedit.html");
}
if (this.r0.n1(!r5.getSelected().x())) {
this.r0.setTask(null, -1);
}
return true;
}
@Override
public void onProgressChanged(SeekBar seekBar, int i2, boolean z) {
qj p3 = p3();
if (z) {
seekBar.requestFocus();
for (int i3 = 0; i3 < p3.e0(); i3++) {
if (seekBar.equals(this.P[i3])) {
int progress = seekBar.getProgress();
int b1 = p3().b1(i3);
if (b1 > Integer.MIN_VALUE) {
progress += b1;
}
this.R[i3].setText(Integer.toString(d3(p3, i3, progress)));
if (p3.D2()) {
if (i3 == 4) {
V3(5);
return;
} else {
if (i3 == 6) {
V3(7);
return;
}
return;
}
}
if (p3.J2(qj.k.DOODLE)) {
if (i3 == 2) {
((uj) p3).z4(i2);
V3(1);
return;
}
return;
}
if (p3.J2(qj.k.TEXTEDIT)) {
if (i3 == 8) {
p3.v3(8, i2 + p3.b1(8));
V3(8);
return;
}
return;
}
if (p3.J2(qj.k.IMAGE) && i3 == 2) {
((ak) p3).v4(i2);
V3(1);
return;
}
return;
}
}
}
}
@Override
protected void onSaveInstanceState(Bundle bundle) {
super.onSaveInstanceState(bundle);
bundle.putBundle("el", this.C0.X(0).c0());
bundle.putBundle("sc", this.E0.X(0).c0());
bundle.putInt("flags", this.D0);
bundle.putInt("curtab", f3());
bundle.putInt("curpos", e3());
if (C3(f3())) {
bundle.putBundle("task", this.r0.getSelected().X(0).c0());
} else {
bundle.putBundle("task", null);
}
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
}