package com.tencent.mm.plugin.appbrand.widget.input;

import android.content.Context;
import android.text.Editable;
import android.text.InputFilter;
import android.text.TextUtils;
import android.util.TypedValue;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.appbrand.widget.h.a;

public final class q extends y {
    private a iTW;
    private float ibD;
    private final InputFilter jfd = new 4(this);
    private float jfe = 0.0f;
    private float jff = 1.2f;
    private float jfg = getTextSize();
    private boolean jfh = false;
    private MotionEvent jfi;
    private boolean jfj = false;
    final ag<q> jfk = new ag(this);

    public q(Context context) {
        super(context);
        AppMethodBeat.i(123702);
        super.setSingleLine(false);
        super.setLineSpacing(0.0f, 1.0f);
        super.setVerticalScrollbarPosition(2);
        super.setSpannableFactory(new 1(this));
        super.a(new 2(this));
        super.setOnLongClickListener(new 3(this));
        this.ibD = (float) ViewConfiguration.get(context).getScaledTouchSlop();
        setAutoHeight(false);
        b(0.0f, false);
        AppMethodBeat.o(123702);
    }

    /* Access modifiers changed, original: final */
    public final Editable c(Editable editable) {
        AppMethodBeat.i(123703);
        Editable c = super.c(editable);
        if (!(this.iTW == null || TextUtils.isEmpty(c))) {
            c.setSpan(this.iTW, 0, c.length(), 18);
        }
        AppMethodBeat.o(123703);
        return c;
    }

    public final void setAutoHeight(boolean z) {
        AppMethodBeat.i(123704);
        this.jfh = z;
        setVerticalScrollBarEnabled(!this.jfh);
        AppMethodBeat.o(123704);
    }

    /* Access modifiers changed, original: protected|final */
    public final void aQO() {
        AppMethodBeat.i(123705);
        if (this.jfh) {
            if (getMeasuredHeight() > getMaxHeight()) {
                setMeasuredDimension(getMeasuredWidth(), getMaxHeight());
                AppMethodBeat.o(123705);
                return;
            } else if (getMeasuredHeight() < getMinHeight() && getMinHeight() > 0) {
                setMeasuredDimension(getMeasuredWidth(), getMinHeight());
            }
        }
        AppMethodBeat.o(123705);
    }

    public final void setGravity(int i) {
        AppMethodBeat.i(123706);
        super.setGravity(((i & -81) & -17) | 48);
        AppMethodBeat.o(123706);
    }

    public final void setSingleLine(boolean z) {
    }

    public final void setInputType(int i) {
        AppMethodBeat.i(123707);
        super.setInputType(131072 | i);
        AppMethodBeat.o(123707);
    }

    public final void setFilters(InputFilter[] inputFilterArr) {
        int i = 0;
        AppMethodBeat.i(123708);
        if (this.jfd != null) {
            if (inputFilterArr == null) {
                inputFilterArr = new InputFilter[0];
            }
            InputFilter[] inputFilterArr2 = new InputFilter[(inputFilterArr.length + 1)];
            while (i < inputFilterArr.length) {
                inputFilterArr2[i] = inputFilterArr[i];
                i++;
            }
            inputFilterArr2[i] = this.jfd;
            inputFilterArr = inputFilterArr2;
        }
        super.setFilters(inputFilterArr);
        AppMethodBeat.o(123708);
    }

    private void b(float f, boolean z) {
        AppMethodBeat.i(123709);
        if (f <= 0.0f) {
            f = (this.jff * this.jfg) + this.jfe;
        }
        if (this.iTW == null || this.iTW.ax(f)) {
            this.iTW = new a(f);
            if (!z) {
                AppMethodBeat.o(123709);
                return;
            } else if (hasFocus()) {
                invalidate();
                AppMethodBeat.o(123709);
                return;
            } else {
                aRl();
                AppMethodBeat.o(123709);
                return;
            }
        }
        AppMethodBeat.o(123709);
    }

    @Deprecated
    public final float getLineSpacingMultiplier() {
        AppMethodBeat.i(123710);
        float lineSpacingMultiplier = super.getLineSpacingMultiplier();
        AppMethodBeat.o(123710);
        return lineSpacingMultiplier;
    }

    @Deprecated
    public final float getLineSpacingExtra() {
        AppMethodBeat.i(123711);
        float lineSpacingExtra = super.getLineSpacingExtra();
        AppMethodBeat.o(123711);
        return lineSpacingExtra;
    }

    public final void setTextSize(int i, float f) {
        AppMethodBeat.i(123712);
        super.setTextSize(i, f);
        this.jfg = TypedValue.applyDimension(i, f, getResources().getDisplayMetrics());
        b(0.0f, true);
        AppMethodBeat.o(123712);
    }

    public final int getLineHeight() {
        AppMethodBeat.i(123713);
        int i;
        if (this.iTW != null) {
            i = this.iTW.height;
            AppMethodBeat.o(123713);
            return i;
        }
        i = super.getLineHeight();
        AppMethodBeat.o(123713);
        return i;
    }

    public final void setLineSpacing(float f, float f2) {
        AppMethodBeat.i(123714);
        this.jfe = f;
        this.jff = f2;
        b(0.0f, true);
        AppMethodBeat.o(123714);
    }

    public final void setLineSpace(float f) {
        AppMethodBeat.i(123715);
        setLineSpacing(f, this.jff);
        AppMethodBeat.o(123715);
    }

    public final void setLineHeight(float f) {
        AppMethodBeat.i(123716);
        if (f <= 0.0f) {
            AppMethodBeat.o(123716);
            return;
        }
        b(f, true);
        AppMethodBeat.o(123716);
    }

    public final View getInputPanel() {
        AppMethodBeat.i(123717);
        w cN = w.cN(this);
        AppMethodBeat.o(123717);
        return cN;
    }

    public final boolean aQP() {
        return true;
    }

    public final boolean aQQ() {
        return false;
    }

    public final void aQR() {
        AppMethodBeat.i(123718);
        aj.cS(this).restartInput(this);
        AppMethodBeat.o(123718);
    }

    public final boolean aOQ() {
        AppMethodBeat.i(123719);
        if (!this.jfh) {
            aRh();
            getMeasuredHeight();
        }
        if (isFocusable() || aQT()) {
            AppMethodBeat.o(123719);
            return false;
        }
        AppMethodBeat.o(123719);
        return true;
    }

    /* Access modifiers changed, original: protected|final */
    public final void onScrollChanged(int i, int i2, int i3, int i4) {
        AppMethodBeat.i(123720);
        super.onScrollChanged(i, i2, i3, i4);
        AppMethodBeat.o(123720);
    }

    public final void scrollTo(int i, int i2) {
        AppMethodBeat.i(123721);
        super.scrollTo(i, i2);
        AppMethodBeat.o(123721);
    }

    public final void scrollBy(int i, int i2) {
        AppMethodBeat.i(123722);
        super.scrollBy(i, i2);
        AppMethodBeat.o(123722);
    }

    public final boolean canScrollVertically(int i) {
        AppMethodBeat.i(123723);
        if (aRh() <= getHeight()) {
            AppMethodBeat.o(123723);
            return false;
        }
        boolean canScrollVertically = super.canScrollVertically(i);
        AppMethodBeat.o(123723);
        return canScrollVertically;
    }

    /* JADX WARNING: Removed duplicated region for block: B:54:0x0144  */
    /* JADX WARNING: Removed duplicated region for block: B:50:0x012f  */
    public final boolean onTouchEvent(android.view.MotionEvent r13) {
        /*
        r12 = this;
        r0 = 123724; // 0x1e34c float:1.73374E-40 double:6.1128E-319;
        com.tencent.matrix.trace.core.AppMethodBeat.i(r0);
        r0 = r12.aOQ();
        if (r0 == 0) goto L_0x035c;
    L_0x000c:
        r0 = r12.getParent();
        r0 = r0 instanceof com.tencent.mm.plugin.appbrand.widget.base.d;
        if (r0 == 0) goto L_0x035c;
    L_0x0014:
        r0 = r13.getActionMasked();
        if (r0 != 0) goto L_0x0026;
    L_0x001a:
        r0 = r12.getParent();
        r0 = (com.tencent.mm.plugin.appbrand.widget.base.d) r0;
        r0 = r0.E(r13);
        if (r0 == 0) goto L_0x0353;
    L_0x0026:
        r4 = r12.jfk;
        r0 = r4.TAG;
        r1 = "processTouchEvent";
        com.tencent.mm.plugin.appbrand.widget.base.a.a(r0, r1, r13);
        r0 = r4.jgG;
        r1 = r13.getActionIndex();
        r2 = r13.getX(r1);
        r3 = r13.getY(r1);
        r1 = r13.getActionMasked();
        if (r1 == 0) goto L_0x005b;
    L_0x0044:
        r1 = r4.jgJ;
        if (r1 != 0) goto L_0x005b;
    L_0x0048:
        r0 = r4.TAG;
        r1 = "[textscroll] no pointer down before, just return";
        com.tencent.mm.sdk.platformtools.ab.v(r0, r1);
        r4.aRq();
        r0 = 0;
        r1 = 123724; // 0x1e34c float:1.73374E-40 double:6.1128E-319;
        com.tencent.matrix.trace.core.AppMethodBeat.o(r1);
    L_0x005a:
        return r0;
    L_0x005b:
        r1 = 0;
        r5 = r13.getActionMasked();
        switch(r5) {
            case 0: goto L_0x0106;
            case 1: goto L_0x0099;
            case 2: goto L_0x014f;
            case 3: goto L_0x014a;
            default: goto L_0x0063;
        };
    L_0x0063:
        r5 = r4.jgG;
        r0 = r4.jgG;
        r3 = r0.getText();
        r0 = -1;
        r0 = r5.canScrollVertically(r0);
        if (r0 != 0) goto L_0x0079;
    L_0x0072:
        r0 = 1;
        r0 = r5.canScrollVertically(r0);
        if (r0 == 0) goto L_0x0080;
    L_0x0079:
        r0 = r13.getActionMasked();
        switch(r0) {
            case 0: goto L_0x018f;
            case 1: goto L_0x01c7;
            case 2: goto L_0x01dd;
            case 3: goto L_0x01c7;
            default: goto L_0x0080;
        };
    L_0x0080:
        r0 = 0;
    L_0x0081:
        r0 = r0 | r1;
        r1 = r4.TAG;
        r2 = "[textscroll] handled | ";
        r3 = java.lang.String.valueOf(r0);
        r2 = r2.concat(r3);
        com.tencent.mm.plugin.appbrand.widget.base.a.a(r1, r2, r13);
        r1 = 123724; // 0x1e34c float:1.73374E-40 double:6.1128E-319;
        com.tencent.matrix.trace.core.AppMethodBeat.o(r1);
        goto L_0x005a;
    L_0x0099:
        r5 = r4.TAG;
        r6 = "[apptouch] ACTION_UP, pointerDown %B";
        r7 = 1;
        r7 = new java.lang.Object[r7];
        r8 = 0;
        r9 = r4.jgK;
        r9 = java.lang.Boolean.valueOf(r9);
        r7[r8] = r9;
        com.tencent.mm.sdk.platformtools.ab.v(r5, r6, r7);
        r5 = r4.jgK;
        if (r5 == 0) goto L_0x00ea;
    L_0x00b1:
        r5 = r4.jgJ;
        if (r5 == 0) goto L_0x00ea;
    L_0x00b5:
        r5 = r4.jgG;
        r5 = com.tencent.mm.plugin.appbrand.jsapi.s.d.co(r5);
        r6 = r4.jgI;
        if (r6 == 0) goto L_0x00e2;
    L_0x00bf:
        r6 = r4.jgI;
        r6 = r6.x;
        r7 = r5.x;
        r6 = r6 - r7;
        r6 = java.lang.Math.abs(r6);
        r7 = 1065353216; // 0x3f800000 float:1.0 double:5.263544247E-315;
        r6 = (r6 > r7 ? 1 : (r6 == r7 ? 0 : -1));
        if (r6 > 0) goto L_0x00e2;
    L_0x00d0:
        r6 = r4.jgI;
        r6 = r6.y;
        r5 = r5.y;
        r5 = r6 - r5;
        r5 = java.lang.Math.abs(r5);
        r6 = 1065353216; // 0x3f800000 float:1.0 double:5.263544247E-315;
        r5 = (r5 > r6 ? 1 : (r5 == r6 ? 0 : -1));
        if (r5 <= 0) goto L_0x00ef;
    L_0x00e2:
        r0 = r4.TAG;
        r2 = "[apptouch] check tap on ACTION_UP, but view has moved.";
        com.tencent.mm.sdk.platformtools.ab.v(r0, r2);
    L_0x00ea:
        r4.aRq();
        goto L_0x0063;
    L_0x00ef:
        r5 = r4.jgJ;
        r5 = r4.a(r5, r13);
        if (r5 != 0) goto L_0x0100;
    L_0x00f7:
        r0 = r4.TAG;
        r2 = "[apptouch] check tap on ACTION_UP exceed tap scope";
        com.tencent.mm.sdk.platformtools.ab.v(r0, r2);
        goto L_0x00ea;
    L_0x0100:
        r0 = (com.tencent.mm.plugin.appbrand.widget.input.ab) r0;
        r0.N(r2, r3);
        goto L_0x00ea;
    L_0x0106:
        r1 = android.view.MotionEvent.obtain(r13);
        r4.jgJ = r1;
        r1 = com.tencent.mm.plugin.appbrand.jsapi.s.d.co(r0);
        r4.jgI = r1;
        if (r0 == 0) goto L_0x0142;
    L_0x0114:
        r2 = r0.getParent();
    L_0x0118:
        if (r2 == 0) goto L_0x0142;
    L_0x011a:
        r1 = r2 instanceof android.view.ViewGroup;
        if (r1 == 0) goto L_0x0142;
    L_0x011e:
        r1 = r2;
        r1 = (android.view.ViewGroup) r1;
        r1 = r1.shouldDelayChildPressedState();
        if (r1 == 0) goto L_0x013d;
    L_0x0127:
        r1 = 1;
    L_0x0128:
        r2 = r4.jgL;
        r0.removeCallbacks(r2);
        if (r1 == 0) goto L_0x0144;
    L_0x012f:
        r1 = r4.jgL;
        r2 = android.view.ViewConfiguration.getTapTimeout();
        r2 = (long) r2;
        r0.postDelayed(r1, r2);
    L_0x0139:
        r0 = 1;
        r1 = r0;
        goto L_0x0063;
    L_0x013d:
        r2 = r2.getParent();
        goto L_0x0118;
    L_0x0142:
        r1 = 0;
        goto L_0x0128;
    L_0x0144:
        r0 = r4.jgL;
        r0.run();
        goto L_0x0139;
    L_0x014a:
        r4.aRq();
        goto L_0x0063;
    L_0x014f:
        r5 = r4.jgH;
        r6 = -r5;
        r6 = (r2 > r6 ? 1 : (r2 == r6 ? 0 : -1));
        if (r6 < 0) goto L_0x0189;
    L_0x0156:
        r6 = -r5;
        r6 = (r3 > r6 ? 1 : (r3 == r6 ? 0 : -1));
        if (r6 < 0) goto L_0x0189;
    L_0x015b:
        r6 = r0.getWidth();
        r6 = (float) r6;
        r6 = r6 + r5;
        r2 = (r2 > r6 ? 1 : (r2 == r6 ? 0 : -1));
        if (r2 >= 0) goto L_0x0189;
    L_0x0165:
        r2 = r0.getHeight();
        r2 = (float) r2;
        r2 = r2 + r5;
        r2 = (r3 > r2 ? 1 : (r3 == r2 ? 0 : -1));
        if (r2 >= 0) goto L_0x0189;
    L_0x016f:
        r2 = 1;
    L_0x0170:
        if (r2 == 0) goto L_0x017a;
    L_0x0172:
        r2 = r4.jgJ;
        r2 = r4.a(r2, r13);
        if (r2 != 0) goto L_0x018b;
    L_0x017a:
        r2 = 0;
        r4.jgK = r2;
        r2 = r4.jgL;
        r0.removeCallbacks(r2);
        r2 = r4.jgM;
        r0.removeCallbacks(r2);
        goto L_0x0063;
    L_0x0189:
        r2 = 0;
        goto L_0x0170;
    L_0x018b:
        r0 = 1;
        r1 = r0;
        goto L_0x0063;
    L_0x018f:
        r0 = 0;
        r2 = r3.length();
        r6 = com.tencent.mm.plugin.appbrand.widget.input.ai.a.class;
        r0 = r3.getSpans(r0, r2, r6);
        r0 = (com.tencent.mm.plugin.appbrand.widget.input.ai.a[]) r0;
        r2 = 0;
    L_0x019d:
        r6 = r0.length;
        if (r2 >= r6) goto L_0x01a8;
    L_0x01a0:
        r6 = r0[r2];
        r3.removeSpan(r6);
        r2 = r2 + 1;
        goto L_0x019d;
    L_0x01a8:
        r0 = new com.tencent.mm.plugin.appbrand.widget.input.ai$a;
        r2 = r13.getX();
        r6 = r13.getY();
        r7 = r5.getScrollX();
        r5 = r5.getScrollY();
        r0.<init>(r2, r6, r7, r5);
        r2 = 0;
        r5 = 0;
        r6 = 17;
        r3.setSpan(r0, r2, r5, r6);
        r0 = 1;
        goto L_0x0081;
    L_0x01c7:
        r0 = com.tencent.mm.plugin.appbrand.widget.input.ai.g(r5);
        if (r0 == 0) goto L_0x01da;
    L_0x01cd:
        r2 = r0.length;
        if (r2 <= 0) goto L_0x01da;
    L_0x01d0:
        r2 = 0;
        r0 = r0[r2];
        r0 = r0.jgY;
        if (r0 == 0) goto L_0x01da;
    L_0x01d7:
        r0 = 1;
        goto L_0x0081;
    L_0x01da:
        r0 = 0;
        goto L_0x0081;
    L_0x01dd:
        r0 = 0;
        r2 = r3.length();
        r6 = com.tencent.mm.plugin.appbrand.widget.input.ai.a.class;
        r0 = r3.getSpans(r0, r2, r6);
        r0 = (com.tencent.mm.plugin.appbrand.widget.input.ai.a[]) r0;
        r2 = r0.length;
        if (r2 <= 0) goto L_0x0080;
    L_0x01ed:
        r2 = 0;
        r2 = r0[r2];
        r2 = r2.jgX;
        if (r2 != 0) goto L_0x022c;
    L_0x01f4:
        r2 = r5.getContext();
        r2 = android.view.ViewConfiguration.get(r2);
        r2 = r2.getScaledTouchSlop();
        r6 = r13.getX();
        r7 = 0;
        r7 = r0[r7];
        r7 = r7.avX;
        r6 = r6 - r7;
        r6 = java.lang.Math.abs(r6);
        r7 = (float) r2;
        r6 = (r6 > r7 ? 1 : (r6 == r7 ? 0 : -1));
        if (r6 >= 0) goto L_0x0226;
    L_0x0213:
        r6 = r13.getY();
        r7 = 0;
        r7 = r0[r7];
        r7 = r7.avY;
        r6 = r6 - r7;
        r6 = java.lang.Math.abs(r6);
        r2 = (float) r2;
        r2 = (r6 > r2 ? 1 : (r6 == r2 ? 0 : -1));
        if (r2 < 0) goto L_0x022c;
    L_0x0226:
        r2 = 0;
        r2 = r0[r2];
        r6 = 1;
        r2.jgX = r6;
    L_0x022c:
        r2 = 0;
        r2 = r0[r2];
        r2 = r2.jgX;
        if (r2 == 0) goto L_0x0080;
    L_0x0233:
        r2 = 0;
        r2 = r0[r2];
        r6 = 1;
        r2.jgY = r6;
        r2 = r13.getMetaState();
        r2 = r2 & 1;
        if (r2 != 0) goto L_0x0251;
    L_0x0241:
        r2 = 1;
        r2 = android.text.method.MetaKeyKeyListener.getMetaState(r3, r2);
        r6 = 1;
        if (r2 == r6) goto L_0x0251;
    L_0x0249:
        r2 = 2048; // 0x800 float:2.87E-42 double:1.0118E-320;
        r2 = android.text.method.MetaKeyKeyListener.getMetaState(r3, r2);
        if (r2 == 0) goto L_0x0290;
    L_0x0251:
        r2 = 1;
    L_0x0252:
        if (r2 == 0) goto L_0x0292;
    L_0x0254:
        r2 = r13.getX();
        r3 = 0;
        r3 = r0[r3];
        r3 = r3.avX;
        r3 = r2 - r3;
        r2 = r13.getY();
        r6 = 0;
        r6 = r0[r6];
        r6 = r6.avY;
        r2 = r2 - r6;
    L_0x0269:
        r6 = 0;
        r6 = r0[r6];
        r7 = r13.getX();
        r6.avX = r7;
        r6 = 0;
        r6 = r0[r6];
        r7 = r13.getY();
        r6.avY = r7;
        r6 = 0;
        r6 = r0[r6];
        r6 = r6.jgZ;
        if (r6 == 0) goto L_0x02a8;
    L_0x0282:
        r2 = 0;
        r2 = r0[r2];
        r3 = 0;
        r2.jgZ = r3;
        r2 = 0;
        r0 = r0[r2];
        r2 = 0;
        r0.jgX = r2;
        goto L_0x0080;
    L_0x0290:
        r2 = 0;
        goto L_0x0252;
    L_0x0292:
        r2 = 0;
        r2 = r0[r2];
        r2 = r2.avX;
        r3 = r13.getX();
        r3 = r2 - r3;
        r2 = 0;
        r2 = r0[r2];
        r2 = r2.avY;
        r6 = r13.getY();
        r2 = r2 - r6;
        goto L_0x0269;
    L_0x02a8:
        r6 = r5.getScrollX();
        r3 = (int) r3;
        r3 = r3 + r6;
        r6 = r5.getScrollY();
        r2 = (int) r2;
        r2 = r2 + r6;
        r6 = r5.getTotalPaddingTop();
        r7 = r5.getTotalPaddingBottom();
        r6 = r6 + r7;
        r7 = r5.getLayout();
        r8 = r7.getHeight();
        r9 = r5.getHeight();
        r6 = r9 - r6;
        r6 = r8 - r6;
        r2 = java.lang.Math.min(r2, r6);
        r6 = 0;
        r6 = java.lang.Math.max(r2, r6);
        r8 = r5.getScrollX();
        r9 = r5.getScrollY();
        r2 = r5.getTotalPaddingLeft();
        r10 = r5.getTotalPaddingRight();
        r2 = r2 + r10;
        r10 = r5.getWidth();
        r10 = r10 - r2;
        r2 = r7.getLineForVertical(r6);
        r11 = r7.getParagraphAlignment(r2);
        r2 = r7.getParagraphDirection(r2);
        if (r2 <= 0) goto L_0x0324;
    L_0x02fa:
        r2 = 1;
    L_0x02fb:
        r7 = r10 + 0;
        if (r7 >= r10) goto L_0x0339;
    L_0x02ff:
        r3 = android.text.Layout.Alignment.ALIGN_CENTER;
        if (r11 != r3) goto L_0x0326;
    L_0x0303:
        r2 = r10 - r7;
        r2 = r2 / 2;
        r2 = 0 - r2;
    L_0x0309:
        r5.scrollTo(r2, r6);
        r2 = r5.getScrollX();
        if (r8 != r2) goto L_0x0318;
    L_0x0312:
        r2 = r5.getScrollY();
        if (r9 == r2) goto L_0x0344;
    L_0x0318:
        r5.cancelLongPress();
        r2 = 0;
        r0 = r0[r2];
        r2 = 1;
        r0.arP = r2;
        r0 = 1;
        goto L_0x0081;
    L_0x0324:
        r2 = 0;
        goto L_0x02fb;
    L_0x0326:
        if (r2 == 0) goto L_0x032c;
    L_0x0328:
        r3 = android.text.Layout.Alignment.ALIGN_OPPOSITE;
        if (r11 == r3) goto L_0x0332;
    L_0x032c:
        if (r2 != 0) goto L_0x0337;
    L_0x032e:
        r2 = android.text.Layout.Alignment.ALIGN_NORMAL;
        if (r11 != r2) goto L_0x0337;
    L_0x0332:
        r2 = r10 - r7;
        r2 = 0 - r2;
        goto L_0x0309;
    L_0x0337:
        r2 = 0;
        goto L_0x0309;
    L_0x0339:
        r2 = 0;
        r2 = java.lang.Math.min(r3, r2);
        r3 = 0;
        r2 = java.lang.Math.max(r2, r3);
        goto L_0x0309;
    L_0x0344:
        r2 = 0;
        r0 = r0[r2];
        r0 = r0.arP;
        if (r0 == 0) goto L_0x034e;
    L_0x034b:
        r0 = 1;
        goto L_0x0081;
    L_0x034e:
        com.tencent.mm.plugin.appbrand.widget.input.ai.g(r5);
        goto L_0x0080;
    L_0x0353:
        r0 = 0;
        r1 = 123724; // 0x1e34c float:1.73374E-40 double:6.1128E-319;
        com.tencent.matrix.trace.core.AppMethodBeat.o(r1);
        goto L_0x005a;
    L_0x035c:
        r0 = r13.getActionMasked();
        switch(r0) {
            case 0: goto L_0x03aa;
            case 1: goto L_0x036f;
            case 2: goto L_0x03b4;
            case 3: goto L_0x036f;
            default: goto L_0x0363;
        };
    L_0x0363:
        r0 = super.onTouchEvent(r13);
        r1 = 123724; // 0x1e34c float:1.73374E-40 double:6.1128E-319;
        com.tencent.matrix.trace.core.AppMethodBeat.o(r1);
        goto L_0x005a;
    L_0x036f:
        r0 = 0;
        r12.jfj = r0;
        r0 = r12.jfi;
        if (r0 == 0) goto L_0x037e;
    L_0x0376:
        r0 = r12.jfi;
        r0.recycle();
        r0 = 0;
        r12.jfi = r0;
    L_0x037e:
        r0 = r12.jfj;
        if (r0 == 0) goto L_0x039b;
    L_0x0382:
        r0 = r13.getActionIndex();
        r0 = r13.getX(r0);
        r1 = r13.getActionIndex();
        r1 = r13.getY(r1);
        r0 = com.tencent.mm.plugin.appbrand.widget.input.aj.a.a(r12, r0, r1);
        if (r0 < 0) goto L_0x039b;
    L_0x0398:
        r12.setSelection(r0);
    L_0x039b:
        r0 = r12.getParent();
        if (r0 != 0) goto L_0x0363;
    L_0x03a1:
        r0 = 1;
        r1 = 123724; // 0x1e34c float:1.73374E-40 double:6.1128E-319;
        com.tencent.matrix.trace.core.AppMethodBeat.o(r1);
        goto L_0x005a;
    L_0x03aa:
        r0 = android.view.MotionEvent.obtain(r13);
        r12.jfi = r0;
        r0 = 1;
        r12.jfj = r0;
        goto L_0x0363;
    L_0x03b4:
        r0 = r12.jfj;
        if (r0 == 0) goto L_0x0363;
    L_0x03b8:
        r0 = r12.jfi;
        r1 = r12.jfi;
        r1 = r1.getActionIndex();
        r0 = r0.getX(r1);
        r1 = r12.jfi;
        r2 = r12.jfi;
        r2 = r2.getActionIndex();
        r1 = r1.getY(r2);
        r2 = r13.getActionIndex();
        r2 = r13.getX(r2);
        r3 = r13.getActionIndex();
        r3 = r13.getY(r3);
        r0 = r0 - r2;
        r0 = java.lang.Math.abs(r0);
        r2 = r12.ibD;
        r0 = (r0 > r2 ? 1 : (r0 == r2 ? 0 : -1));
        if (r0 > 0) goto L_0x03f7;
    L_0x03eb:
        r0 = r1 - r3;
        r0 = java.lang.Math.abs(r0);
        r1 = r12.ibD;
        r0 = (r0 > r1 ? 1 : (r0 == r1 ? 0 : -1));
        if (r0 <= 0) goto L_0x0363;
    L_0x03f7:
        r12.cancelLongPress();
        r0 = 0;
        r12.setPressed(r0);
        r0 = 0;
        r12.jfj = r0;
        goto L_0x0363;
        */
        throw new UnsupportedOperationException("Method not decompiled: com.tencent.mm.plugin.appbrand.widget.input.q.onTouchEvent(android.view.MotionEvent):boolean");
    }

    public final void N(float f, float f2) {
        AppMethodBeat.i(123725);
        if (isEnabled()) {
            if (aOQ()) {
                int a = aj.a.a(this, f, f2);
                if (a >= 0) {
                    setSelection(a);
                }
            }
            super.performClick();
            AppMethodBeat.o(123725);
            return;
        }
        AppMethodBeat.o(123725);
    }

    public final boolean performHapticFeedback(int i, int i2) {
        AppMethodBeat.i(123726);
        boolean performHapticFeedback = super.performHapticFeedback(i, i2);
        AppMethodBeat.o(123726);
        return performHapticFeedback;
    }
}
