package com.tencent.mm.plugin.sns.ui;

import android.text.Editable;
import android.text.TextWatcher;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.sns.c.a;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.ytcommon.BuildConfig;

class SnsEditText$1 implements TextWatcher {
    final /* synthetic */ SnsEditText rrR;

    SnsEditText$1(SnsEditText snsEditText) {
        this.rrR = snsEditText;
    }

    public final void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
        AppMethodBeat.i(38930);
        if (charSequence != null) {
            try {
                if (charSequence.length() >= a.qFE) {
                    if (charSequence.length() - SnsEditText.a(this.rrR) > a.qFE) {
                        SnsEditText.a(this.rrR, charSequence.length() - SnsEditText.a(this.rrR));
                    }
                    AppMethodBeat.o(38930);
                    return;
                }
            } catch (Exception e) {
                ab.printErrStackTrace("MicroMsg.SnsEditText", e, BuildConfig.FLAVOR, new Object[0]);
                AppMethodBeat.o(38930);
                return;
            }
        }
        SnsEditText.a(this.rrR, 0);
        AppMethodBeat.o(38930);
    }

    public final void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
        AppMethodBeat.i(38931);
        if (charSequence != null) {
            SnsEditText.b(this.rrR, charSequence.length());
        }
        AppMethodBeat.o(38931);
    }

    public final void afterTextChanged(Editable editable) {
    }
}
