package com.tencent.mm.plugin.story.ui.view.editor;

import a.f.b.j;
import a.l;
import android.support.v7.widget.RecyclerView;
import android.view.KeyEvent;
import android.widget.Button;
import android.widget.TextView;
import android.widget.TextView.OnEditorActionListener;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.story.model.audio.b;
import com.tencent.mm.plugin.story.model.audio.b$a;
import com.tencent.mm.plugin.story.ui.a.e;
import com.tencent.mm.plugin.story.ui.view.editor.EditorAudioSearchView.a;
import com.tencent.mm.sdk.platformtools.bo;
import java.util.LinkedList;

@l(dWo = {1, 1, 13}, dWp = {"\u0000\u001c\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0000\u0010\u0000\u001a\u00020\u00012\u000e\u0010\u0002\u001a\n \u0004*\u0004\u0018\u00010\u00030\u00032\u0006\u0010\u0005\u001a\u00020\u00062\u000e\u0010\u0007\u001a\n \u0004*\u0004\u0018\u00010\b0\bH\n¢\u0006\u0002\b\t"}, dWq = {"<anonymous>", "", "textView", "Landroid/widget/TextView;", "kotlin.jvm.PlatformType", "actionId", "", "keyEvent", "Landroid/view/KeyEvent;", "onEditorAction"})
final class EditorAudioSearchView$h implements OnEditorActionListener {
    final /* synthetic */ EditorAudioSearchView skR;

    EditorAudioSearchView$h(EditorAudioSearchView editorAudioSearchView) {
        this.skR = editorAudioSearchView;
    }

    public final boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
        AppMethodBeat.i(110481);
        if (3 == i) {
            CharSequence text;
            String obj;
            if (EditorAudioSearchView.h(this.skR) != null) {
                String h = EditorAudioSearchView.h(this.skR);
                j.o(textView, "textView");
                text = textView.getText();
                if (!bo.isEqual(h, text != null ? text.toString() : null)) {
                    EditorAudioSearchView.f(this.skR);
                    b$a b_a = b.rUx;
                    b.cyT().cH(2);
                    b_a = b.rUx;
                    b$a.cyU();
                    b_a = b.rUx;
                    b.cyT().cK(this.skR.getMRelatedRecId());
                }
            }
            EditorAudioSearchView editorAudioSearchView = this.skR;
            j.o(textView, "textView");
            text = textView.getText();
            if (text != null) {
                obj = text.toString();
            } else {
                obj = null;
            }
            EditorAudioSearchView.a(editorAudioSearchView, obj);
            if (!bo.isNullOrNil(EditorAudioSearchView.h(this.skR))) {
                e c = EditorAudioSearchView.c(this.skR);
                if (c != null) {
                    c.setSelection(null);
                }
                c = EditorAudioSearchView.c(this.skR);
                if (c != null) {
                    c.setSelection(null);
                }
                RecyclerView i2 = EditorAudioSearchView.i(this.skR);
                if (i2 != null) {
                    i2.bY(0);
                }
                e c2 = EditorAudioSearchView.c(this.skR);
                if (c2 != null) {
                    c2.dG(new LinkedList());
                }
                Button j = EditorAudioSearchView.j(this.skR);
                if (j != null) {
                    j.setEnabled(false);
                }
                EditorAudioSearchView.a(this.skR, 0);
                EditorAudioSearchView.e(this.skR);
                EditorAudioSearchView.a(this.skR, 0);
                c = EditorAudioSearchView.c(this.skR);
                if (c != null) {
                    c.sfv = EditorAudioSearchView.h(this.skR);
                }
                EditorAudioSearchView.m(this.skR);
                EditorAudioSearchView.n(this.skR);
                EditorAudioSearchView.o(this.skR);
                EditorAudioSearchView.b(this.skR, false);
                a callback = this.skR.getCallback();
                if (callback != null) {
                    callback.cCv();
                }
            }
        }
        AppMethodBeat.o(110481);
        return false;
    }
}
