导航菜单

页面标题

页面副标题

Tasker v6.6.3 - EventEdit.java 源代码

正在查看: Tasker v6.6.3 应用的 EventEdit.java JAVA 源代码文件

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


package net.dinglisch.android.taskerm;

import android.content.ActivityNotFoundException;
import android.content.DialogInterface;
import android.content.Intent;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.SeekBar;
import android.widget.Spinner;
import android.widget.SpinnerAdapter;
import com.joaomgcd.taskerm.spawn.RFactory;
import java.util.ArrayList;
import java.util.List;
import net.dinglisch.android.taskerm.FileSelect;
import net.dinglisch.android.taskerm.HTMLView;
import net.dinglisch.android.taskerm.ji;

public class EventEdit extends HasArgsEdit implements SensorEventListener, AdapterView.OnItemSelectedListener, xf.a, ze.e {
    private static int A0 = 2;
    private static int B0 = 3;
    private static int z0;
    private Spinner m0;
    private CheckBox n0;
    private LinearLayout o0;
    private LinearLayout p0;
    private float q0;
    private float r0;
    private float s0;
    private List<Float> t0;
    private List<Float> u0;
    private List<Float> v0;
    private j2 x0;
    private int w0 = B0;
    public yf.e0 y0 = new yf.e0(this);

    class a extends Handler {
        final j2 a;

        a(j2 j2Var) {
            this.a = j2Var;
        }

        @Override
        public void handleMessage(Message message) {
            if (message.what == 1) {
                if (EventEdit.this.D == -1) {
                    o7.G("EventEdit", "noteCatSelect handleMessage: editing arg -1");
                    return;
                }
                String str = bi.b[message.getData().getInt("index")];
                EventEdit eventEdit = EventEdit.this;
                pp.o(eventEdit.v[eventEdit.D], str, "/");
                j2 j2Var = this.a;
                EventEdit eventEdit2 = EventEdit.this;
                int i = eventEdit2.D;
                j2Var.o0(i, pp.m1(eventEdit2.v[i]));
            }
        }
    }

    class b extends Handler {
        final j2 a;

        b(j2 j2Var) {
            this.a = j2Var;
        }

        @Override
        public void handleMessage(Message message) {
            if (message.what == 1) {
                if (EventEdit.this.D == -1) {
                    o7.G("EventEdit", "taskSelect handleMessage: editing arg -1");
                    return;
                }
                String str = EventEdit.this.L0().v().get(message.getData().getInt("index"));
                this.a.o0(EventEdit.this.D, str);
                EventEdit eventEdit = EventEdit.this;
                eventEdit.v[eventEdit.D].setText(str);
            }
        }
    }

    class c extends Handler {
        c() {
        }

        @Override
        public void handleMessage(Message message) {
            if (message.what != 0) {
                EventEdit.this.K2();
                return;
            }
            try {
                EventEdit.this.startActivityForResult(bi.j(), -1);
            } catch (ActivityNotFoundException unused) {
                pp.a0(EventEdit.this, 2131887782, new Object[0]);
                EventEdit.this.K2();
            }
        }
    }

    class d extends Handler {
        d() {
        }

        @Override
        public void handleMessage(Message message) {
            if (message.what == 0) {
                MyAccessibilityService.w(EventEdit.this);
            } else {
                EventEdit.this.K2();
            }
        }
    }

    class e implements DialogInterface.OnDismissListener {
        final c2 i;
        final View q;

        e(c2 c2Var, View view) {
            this.i = c2Var;
            this.q = view;
        }

        @Override
        public void onDismiss(DialogInterface dialogInterface) {
            if (EventEdit.this.N2(this.i.w())) {
                this.q.setVisibility(0);
            }
            EventEdit.this.z = null;
        }
    }

    class f implements DialogInterface.OnCancelListener {
        final View i;

        f(View view) {
            this.i = view;
        }

        @Override
        public void onCancel(DialogInterface dialogInterface) {
            if (EventEdit.this.x0 == null) {
                EventEdit.this.finish();
            } else {
                this.i.setVisibility(0);
            }
            EventEdit.this.z = null;
        }
    }

    class g extends Handler {
        g() {
        }

        @Override
        public void handleMessage(Message message) {
            if (message.what == 0) {
                EventEdit.this.b3(1, 1);
            }
        }
    }

    public void K2() {
        Intent intent = new Intent();
        intent.putExtra("scntxt", this.x0.X(0).c0());
        setResult(-1, intent);
        finish();
    }

    private void M2(int i) {
        j2 j2Var = this.x0;
        if (j2Var == null) {
            MyActivity.L(this, "handleChoosePress tEvent null");
            return;
        }
        this.v[i].requestFocus();
        String O = i2.O(j2Var.j(), i);
        if (O.equals("pkgName")) {
            this.D = i;
            startActivityForResult(AppSelect.G0(this, true, false, false, false, true, false, null, null), 8);
        } else if (O.equals("pkgLabel")) {
            this.D = i;
            startActivityForResult(AppSelect.G0(this, true, false, false, false, true, false, null, null), 9);
        } else if (O.contains("btn")) {
            this.D = i;
            c2(2131887405);
        } else if (O.contains("bta")) {
            this.D = i;
            c2(2131887404);
        } else if (O.contains("simc")) {
            this.y0.W3(this.v, i);
        } else if (O.equals("inpval")) {
            this.y0.a2(this.v, i);
        } else if (O.equals("p") || O.equals("sms")) {
            xg.w(this, this.v[i], true);
            this.D = i;
        } else if (O.equals("ncat")) {
            this.D = i;
            k2(new a(j2Var));
        } else if (O.equals("m")) {
            o2(new b(j2Var), L0());
        } else if (O.equals("acc")) {
            pp.h0(this, 2131888240, new Object[0]);
        } else if (O.equals("f")) {
            g2(i, FileSelect.e.File, null);
        } else if (O.equals("fme")) {
            this.y0.Z3(i, M0(0));
        } else if (O.equals("sset")) {
            this.y0.D4(this.V, this.v);
        } else if (O.equals("nfctid")) {
            this.y0.z4(this.v);
        } else if (O.equals("nfctcont")) {
            this.y0.B4(this.v);
        } else if (O.equals("apppakc")) {
            this.y0.E1(this.v, i);
        } else if (O.equals("notcatoreo")) {
            this.y0.k2(this.v, i);
        } else if (O.equals("buttprsti")) {
            this.y0.I1(this.v, i);
        }
        if (this.y0.Y3(i)) {
            this.y0.O3(new yf.b(i, j2Var));
        }
    }

    public boolean N2(int i) {
        if (i != -1) {
            this.y0.T3(i);
            this.y0.C3(i);
            com.joaomgcd.taskerm.util.t9.f0(this, i);
            j2 j2Var = this.x0;
            if (j2Var == null) {
                this.x0 = new j2(i);
            } else {
                j2Var.u1(i);
            }
            invalidateOptionsMenu();
            if (this.x0.e0() == 0 && i2.B(i) == null && !i2.c(i)) {
                K2();
                return false;
            }
            if ((i == 3001 || i == 3000) && !this.w.contains("accMax")) {
                gi.h(this, 2131891305, 2131887150);
            } else if (i == 201) {
                this.y0.s4();
            } else if (i == 2079) {
                this.y0.u4();
            } else if (this.y0.E3(i)) {
                this.y0.K3(this.x0);
            }
            W2(-1);
            this.y0.L3(this.x0, null);
        }
        return true;
    }

    private void P2(int i) {
        this.v[i].requestFocus();
        if ((this.x0.j() == 3050 || this.x0.j() == 3060) && i == 0) {
            p2(2131887428, false, this.x0, null);
        } else {
            p2(2131887427, false, this.x0, null);
        }
    }

    public void R2(SensorEvent sensorEvent) {
        float[] fArr = sensorEvent.values;
        float f2 = fArr[0];
        this.q0 = f2;
        float f3 = fArr[1];
        this.r0 = f3;
        float f4 = fArr[2];
        this.s0 = f4;
        if (this.w0 != z0 || f2 == 0.0f || f3 == 0.0f || f4 == 0.0f) {
            return;
        }
        pp.j0(this, 2131891251, new Object[0]);
        T2();
        this.w0 = A0;
    }

    private boolean S2() {
        try {
            if (!d3()) {
                return false;
            }
            V2();
            j2 j2Var = this.x0;
            if (j2Var != null && i2.Y(j2Var) && MyAccessibilityService.a() && !MyAccessibilityService.q()) {
                X2();
                return false;
            }
            j2 j2Var2 = this.x0;
            if (j2Var2 != null && i2.Z(j2Var2.j()) && !bi.v()) {
                a3();
                return false;
            }
            j2 j2Var3 = this.x0;
            if (j2Var3 == null || j2Var3.j() != 2079 || com.joaomgcd.taskerm.util.ac.f2(this).i0()) {
                K2();
                return true;
            }
            this.y0.p0(com.joaomgcd.taskerm.dialog.a.G7(this));
            return false;
        } catch (NullPointerException unused) {
            o7.f("EventEdit", "saveAndExit: npe");
            return false;
        }
    }

    private void T2() {
        pp.L3(this, 50L);
        this.t0.add(Float.valueOf(this.q0));
        this.u0.add(Float.valueOf(this.r0));
        this.v0.add(Float.valueOf(this.s0));
    }

    private void U2(boolean z) {
        SensorManager b0 = this.y0.b0();
        if (b0 == null) {
            pp.a0(this, 2131887727, new Object[0]);
            return;
        }
        Sensor defaultSensor = b0.getDefaultSensor(1);
        if (defaultSensor == null) {
            pp.a0(this, 2131887863, oh.g(this, 2131891134, new Object[0]));
            return;
        }
        if (!z) {
            this.w0 = B0;
            this.y0.D0(b0, this);
        } else {
            if (!this.y0.i0(b0, this, defaultSensor, 0)) {
                pp.a0(this, 2131887863, oh.g(this, 2131891134, new Object[0]));
                return;
            }
            this.t0 = new ArrayList();
            this.u0 = new ArrayList();
            this.v0 = new ArrayList();
            this.w0 = z0;
        }
    }

    private void V2() {
        int intValue;
        this.x0.C1(this.m0.getSelectedItemPosition());
        this.x0.v1(this.n0.isChecked());
        int j = this.x0.j();
        if (this.y0.p3()) {
            this.x0.p(K0());
        }
        int i = 0;
        while (i < this.x0.e0()) {
            String m1 = pp.m1(this.v[i]);
            int t0 = this.x0.t0(i);
            if (t0 == 0) {
                if (i2.V(getResources(), j, i, this.x0) != null) {
                    intValue = this.V[i].getSelectedItemPosition();
                } else if (this.y0.h4(i)) {
                    intValue = this.P[i].getProgress();
                } else if (m1.length() == 0) {
                    intValue = (j == 8 && i == 1) ? -1 : 0;
                } else {
                    Integer E3 = pp.E3(m1);
                    if (E3 == null) {
                        this.x0.y(i).L(m1);
                        intValue = Integer.MAX_VALUE;
                    } else {
                        intValue = E3.intValue();
                    }
                }
                if (intValue != Integer.MAX_VALUE) {
                    this.x0.B1(i, intValue);
                }
            } else if (t0 == 1) {
                this.x0.o0(i, m1);
            } else if (t0 != 2) {
                if (t0 == 3) {
                    this.x0.y1(i, this.U[i].isChecked());
                } else if (t0 != 5) {
                    o7.k("EventEdit", "edit: setEventFromUI: bad arg type");
                }
            }
            i++;
        }
    }

    private void W2(int r26) {
        throw new UnsupportedOperationException("Method not decompiled: net.dinglisch.android.taskerm.EventEdit.W2(int):void");
    }

    private void X2() {
        TextBoxDialogFragment.F(this, new d(), 2131887412, oh.g(this, this.x0.j() == 2000 ? 2131887266 : 2131887265, new Object[0]), 2131886894, 2131886892, -1, 0).E(this);
    }

    private void Y2() {
        View findViewById = findViewById(2131296768);
        c2 c2Var = new c2(this);
        j2 j2Var = this.x0;
        if (j2Var != null) {
            c2Var.A(j2Var.j());
        }
        j2 j2Var2 = this.x0;
        if (j2Var2 == null) {
            c2Var.x(true);
        } else {
            c2Var.y(false, i2.q(j2Var2.j()));
        }
        c2Var.setOnDismissListener(new e(c2Var, findViewById));
        c2Var.setOnCancelListener(new f(findViewById));
        findViewById.setVisibility(4);
        this.y0.U3();
        c2Var.show();
        this.z = c2Var;
    }

    private void Z2() {
        ep.t0(this, new g()).E(this);
    }

    private void a3() {
        TextBoxDialogFragment.F(this, new c(), 2131887513, oh.g(this, 2131887273, new Object[0]), 2131886894, 2131886892, -1, 0).E(this);
    }

    public void b3(int i, int i2) {
        Intent intent = new Intent(this, (Class<?>) Settings.class);
        intent.putExtra("tno", i);
        intent.putExtra("flags", i2);
        startActivity(intent);
    }

    private boolean d3() {
        Integer E3;
        int j = this.x0.j();
        if (!c3()) {
            return false;
        }
        for (int i = 0; i < this.x0.e0(); i++) {
            String str = pp.m1(this.Q[i]) + " ";
            String m1 = pp.m1(this.v[i]);
            int t0 = this.x0.t0(i);
            if (t0 == 0) {
                if (this.y0.h4(i)) {
                    m1 = Integer.toString(this.P[i].getProgress());
                }
                if (i2.V(getResources(), j, i, this.x0) == null) {
                    if (m1.length() != 0) {
                        E3 = pp.E3(m1);
                    } else {
                        if (i2.E(j, i)) {
                            return pp.a0(this, 2131887931, str);
                        }
                        E3 = 0;
                    }
                    if (E3 != null) {
                        int F = i2.F(j, i);
                        int G = i2.G(j, i);
                        if (E3.intValue() < G || E3.intValue() > F) {
                            return pp.b0(this, str + oh.g(this, 2131886184, new Object[0]) + " (" + G + "-" + F + ")", new Object[0]);
                        }
                    } else {
                        continue;
                    }
                } else {
                    continue;
                }
            } else if (t0 == 1) {
                if (m1.length() == 0 && (i2.e0(j, i) || (j == 3050 && pp.m1(this.v[0]).equals(wp.I0(77))))) {
                    pp.a0(this, 2131887842, str);
                    return false;
                }
                if (j == 3000 && !i2.a0(pp.m1(this.v[1]), new ArrayList(), new ArrayList(), new ArrayList())) {
                    pp.a0(this, 2131887806, new Object[0]);
                    return false;
                }
            } else if (t0 == 5 && !this.x0.a(i).z()) {
                return pp.a0(this, 2131887858, new Object[0]);
            }
        }
        String m12 = pp.m1(this.v[0]);
        if ((j != 3050 && j != 3060) || !wp.S0(m12) || wp.U0(m12)) {
            return this.y0.k4();
        }
        pp.a0(this, 2131890323, new Object[0]);
        return false;
    }

    public j2 L2() {
        return this.x0;
    }

    @Override
    public w4 O0() {
        return L2();
    }

    public void O2() {
        float f2;
        float f3;
        float f4;
        pp.L3(this, 50L);
        U2(false);
        StringBuilder sb = new StringBuilder(1024);
        float f5 = this.w.getFloat("accMR", 3.5f);
        int i = 0;
        float f6 = 0.0f;
        float f7 = 0.0f;
        float f8 = 0.0f;
        while (true) {
            if (i < this.t0.size()) {
                float floatValue = this.t0.get(i).floatValue();
                float floatValue2 = this.u0.get(i).floatValue();
                float floatValue3 = this.v0.get(i).floatValue();
                if (i > 0) {
                    f2 = Math.abs(floatValue - f6);
                    f3 = Math.abs(floatValue2 - f7);
                    f4 = Math.abs(floatValue3 - f8);
                } else {
                    f2 = 0.0f;
                    f3 = 0.0f;
                    f4 = 0.0f;
                }
                if (i != 0 && f2 < f5 && f3 < f5 && f4 < f5) {
                    pp.a0(this, 2131887807, new Object[0]);
                    break;
                }
                if (i > 0) {
                    sb.append(",\n");
                }
                sb.append(pp.p0(this.t0.get(i).floatValue(), 2));
                sb.append(", ");
                sb.append(pp.p0(this.u0.get(i).floatValue(), 2));
                sb.append(", ");
                sb.append(pp.p0(this.v0.get(i).floatValue(), 2));
                i++;
                f6 = floatValue;
                f7 = floatValue2;
                f8 = floatValue3;
            } else if (sb.length() > 1024) {
                pp.a0(this, 2131887809, new Object[0]);
            } else {
                pp.j0(this, 2131887808, Integer.valueOf(i));
                this.x0.o0(1, sb.toString());
                this.v[1].setText(sb.toString());
            }
        }
        this.t0 = null;
        this.u0 = null;
        this.v0 = null;
    }

    public boolean Q2() {
        gf.b i1;
        j2 j2Var = this.x0;
        if (j2Var == null || (i1 = j2Var.i1()) == null) {
            return false;
        }
        return i1.E(this);
    }

    @Override
    public void U1(int i) {
        W2(i);
    }

    protected boolean c3() {
        if (Z0()) {
            return super.C2(!Q2(), false, true);
        }
        return true;
    }

    @Override
    public void g(com.joaomgcd.taskerm.util.ac acVar, com.joaomgcd.taskerm.util.se seVar) {
        if (this.y0.R3(acVar, seVar)) {
            return;
        }
        Y2();
    }

    @Override
    public void onAccuracyChanged(Sensor sensor, int i) {
    }

    @Override
    public void onActivityResult(int i, int i2, Intent intent) {
        if (this.y0.w1(i, i2, intent) || this.y0.M3(i, i2, intent) || super.n1(i, i2, intent)) {
            return;
        }
        if (xg.l(i)) {
            if (xg.n(i, i2, intent, getContentResolver(), this.v[this.D], 2, false)) {
                return;
            }
            pp.n0(this, 2131887780, new Object[0]);
            return;
        }
        j2 j2Var = this.x0;
        if (j2Var == null) {
            return;
        }
        if (i != 1) {
            if (i == 7) {
                if (i2 == -1) {
                    W0(intent.getExtras().getString("path"), i2.O(j2Var.j(), this.D), false, false);
                    return;
                }
                return;
            } else {
                if (i == 6 && i2 == -1) {
                    f1 f1Var = new f1(new ii(intent.getBundleExtra("ssc")));
                    if (f1Var.h1() == 0) {
                        j2Var.e1(this.D).q();
                    } else {
                        j2Var.x1(this.D, f1Var.t1());
                    }
                    W2(this.D);
                    return;
                }
                return;
            }
        }
        this.D = 0;
        if (i2 != -1) {
            if (i2 == 0) {
                o7.f("EventEdit", "Cancelled");
                return;
            }
            o7.f("EventEdit", "R: " + i2);
            return;
        }
        Bundle s = ji.s(intent);
        if (s != null) {
            if (!ji.i0(s)) {
                pp.a0(this, 2131887886, new Object[0]);
                return;
            }
            j2Var.z1(0, s);
            ji.f0(j2Var, j2Var.j(), ji.c.Event);
            W2(this.D);
            W2(2);
            W2(1);
        }
    }

    @Override
    public void onClick(View view) {
        if (super.o1(view, this.x0)) {
            if (this.J.equals(view)) {
                r2(2131887428, false, this.x0, null, this.y0.D3(N0(this.x0)) ? this.y0.z3(this.x0.i1()) : null);
            }
            if (this.K.equals(view)) {
                this.y0.Z1(N0(this.x0));
                return;
            }
            return;
        }
        for (int i = 0; i < 17; i++) {
            if (view == this.Z[i]) {
                this.y0.c4(this.x0, i);
            }
            if (view == this.c0[i]) {
                j2 j2Var = this.x0;
                if (j2Var == null) {
                    MyActivity.L(this, "onClick tEvent null");
                    return;
                }
                this.D = 0;
                Intent G = ji.G(this, ji.c.Event, j2Var.a(0), j2Var.j(), null);
                if (G != null) {
                    startActivityForResult(G, 1);
                }
            } else if (view == this.a0[i]) {
                this.P[i].incrementProgressBy(1);
                SeekBar seekBar = this.P[i];
                onProgressChanged(seekBar, seekBar.getProgress(), true);
            } else if (view == this.b0[i]) {
                this.P[i].incrementProgressBy(-1);
                SeekBar seekBar2 = this.P[i];
                onProgressChanged(seekBar2, seekBar2.getProgress(), true);
            } else if (view == this.e0[i]) {
                M2(i);
            } else if (view == this.f0[i]) {
                P2(i);
            } else if (view != this.X[i]) {
                MyCheckBox myCheckBox = this.U[i];
                if (view == myCheckBox && !this.y0.P3(i, myCheckBox.isChecked())) {
                    D1(i, false);
                }
            } else if (this.x0.t0(i) == 2) {
                this.D = i;
                boolean z = this.x0.j() == 2000;
                net.dinglisch.android.taskerm.d e1 = this.x0.e1(i);
                startActivityForResult(AppSelect.G0(this, false, false, false, false, z, false, null, e1.k() ? new f1(e1) : null), 6);
            }
        }
    }

    @Override
    public void onCreate(Bundle bundle) {
        super.p1(bundle, 2131493235);
        G1(true, 2131891300, 2131890068);
        setTitle(oh.g(this, 2131886728, new Object[0]));
        this.p0 = (LinearLayout) findViewById(2131297265);
        this.o0 = (LinearLayout) findViewById(2131296272);
        t1(10, this.B ? 106479 : 73711);
        for (int i = 0; i < 10; i++) {
            this.Z[i].setOnClickListener(this);
            this.c0[i].setOnClickListener(this);
            this.a0[i].setOnClickListener(this);
            this.b0[i].setOnClickListener(this);
            this.U[i].setOnClickListener(this);
        }
        this.n0 = (CheckBox) findViewById(2131296270);
        Spinner spinner = (Spinner) findViewById(2131297271);
        this.m0 = spinner;
        spinner.setAdapter((SpinnerAdapter) pp.f1(this, RFactory.layout.mysimple_list_item));
        q1(false);
        pp.M2(this, 2131297268, 2131891242);
        pp.M2(this, 2131296271, 2131889992);
        Bundle bundleExtra = bundle == null ? getIntent().getBundleExtra("scntxt") : bundle.getBundle("tevt");
        if (bundleExtra != null) {
            this.x0 = new j2(new ii(bundleExtra));
            W2(-1);
        } else if (bundle == null) {
            Y2();
        }
        j2 j2Var = this.x0;
        if (!((j2Var == null || i2.q(j2Var.j()) != 999) ? false : xo.e(this, 1, 2131890891, 1))) {
            xo.e(this, 0, 2131890892, 2);
        }
        super.Z1(this, 5);
        this.y0.g0();
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        net.dinglisch.android.taskerm.a.M(this, 8, 2131891187, menu);
        j2 j2Var = this.x0;
        if (j2Var != null) {
            if (j2Var.k1() != null) {
                net.dinglisch.android.taskerm.a.v(this, 7777, menu);
            }
            int j = this.x0.j();
            if (j == 3000 || j == 3001) {
                net.dinglisch.android.taskerm.a.t(this, 564, menu);
            }
        }
        return super.r1(menu, 2131888892, 2131888862);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        this.m0 = null;
        this.n0 = null;
        this.o0 = null;
        this.p0 = null;
        this.t0 = null;
        this.u0 = null;
        this.v0 = null;
        this.x0 = null;
        this.y0.h0();
    }

    @Override
    public void onItemSelected(AdapterView<?> adapterView, View view, int i, long j) {
        int j2 = this.x0.j();
        int i2 = 0;
        while (true) {
            if (i2 >= this.x0.e0()) {
                i2 = -1;
                break;
            } else if (adapterView.equals(this.V[i2])) {
                break;
            } else {
                i2++;
            }
        }
        if (j2 == 447) {
            W2(2);
        }
        this.y0.Z2(i2, i);
    }

    @Override
    public boolean onKeyDown(int i, KeyEvent keyEvent) {
        if (i != 4) {
            j2 j2Var = this.x0;
            if (j2Var == null) {
                o7.k("EventEdit", "onKeyDown: null tEvent");
            } else if (keyEvent == null) {
                o7.k("EventEdit", "onKeyDown: null event");
            } else if (j2Var.j() == 3000 && (i == 27 || i == 5 || i == 84 || i == 82 || i == 25 || i == 24)) {
                if (keyEvent.getRepeatCount() == 0) {
                    if (this.w0 == A0) {
                        T2();
                    }
                } else if (keyEvent.getRepeatCount() == 1) {
                    if (this.w0 == B0) {
                        U2(true);
                    } else {
                        O2();
                    }
                }
                return true;
            }
        } else if (!S2()) {
            return true;
        }
        return super.onKeyDown(i, keyEvent);
    }

    @Override
    public void onNothingSelected(AdapterView<?> adapterView) {
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem menuItem) {
        int itemId = menuItem.getItemId();
        if (itemId == 6) {
            setResult(0, null);
            finish();
            return true;
        }
        if (itemId == 8) {
            Y2();
            return true;
        }
        if (itemId == 564) {
            if (ep.r0(this)) {
                Z2();
            } else {
                b3(1, 1);
            }
            return true;
        }
        if (itemId == 7777) {
            HTMLView.H0(this, HasArgsEdit.P0("eh", this.x0.k1()), -1, HTMLView.g.Inform);
            return true;
        }
        if (itemId != 16908332) {
            return s1(menuItem, "help/eh_index.html", "activity_eventedit.html");
        }
        S2();
        return true;
    }

    @Override
    protected void onPause() {
        if (this.w0 != B0) {
            U2(false);
        }
        super.onPause();
        this.y0.Q3();
    }

    @Override
    public void onProgressChanged(SeekBar seekBar, int i, boolean z) {
        if (z) {
            seekBar.requestFocus();
            int i2 = 0;
            while (true) {
                if (i2 >= 7) {
                    break;
                }
                if (seekBar.equals(this.P[i2])) {
                    try {
                        this.R[i2].setText(i2.M(this.x, this.x0.j(), i2, seekBar.getProgress()));
                        break;
                    } catch (Throwable th2) {
                        xg.e2.R1(this, th2);
                    }
                } else {
                    i2++;
                }
            }
        }
        for (int i3 = 0; i3 < this.x0.e0(); i3++) {
            this.y0.a3(i3, i);
        }
    }

    @Override
    public void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) {
        super.onRequestPermissionsResult(i, strArr, iArr);
        this.y0.x1(i, strArr, iArr);
    }

    @Override
    protected void onResume() {
        super.onResume();
        this.y0.S3();
    }

    @Override
    protected void onSaveInstanceState(Bundle bundle) {
        super.onSaveInstanceState(bundle);
        if (this.x0 != null) {
            V2();
            bundle.putBundle("tevt", this.x0.X(0).c0());
        }
    }

    @Override
    public void onSensorChanged(final SensorEvent sensorEvent) {
        this.y0.O(new Runnable() {
            @Override
            public final void run() {
                EventEdit.this.R2(sensorEvent);
            }
        });
    }

    @Override
    public void onStartTrackingTouch(SeekBar seekBar) {
        EditText N0 = N0(this.x0);
        if (D2(N0)) {
            N0.clearFocus();
        }
    }

    @Override
    public void onStopTrackingTouch(SeekBar seekBar) {
    }

    @Override
    protected boolean w0() {
        return this.y0.g3();
    }

    @Override
    public boolean y0() {
        return this.y0.p3();
    }
}