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

import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.fts.ui.widget.FTSLocalPageRelevantView;
import com.tencent.mm.plugin.websearch.api.d;
import com.tencent.mm.protocal.protobuf.brd;
import com.tencent.mm.sdk.platformtools.ab;
import java.util.List;

class FTSMainUI$9 implements d {
    final /* synthetic */ FTSMainUI mJJ;

    FTSMainUI$9(FTSMainUI fTSMainUI) {
        this.mJJ = fTSMainUI;
    }

    public final void a(boolean z, brd brd, String str, String str2) {
        AppMethodBeat.i(61874);
        if (this.mJJ.query.equals(str2)) {
            if (!z) {
                FTSMainUI.f(this.mJJ).setVisibility(8);
            } else if (FTSMainUI.b(this.mJJ).getVisibility() == 0) {
                int i;
                FTSLocalPageRelevantView f = FTSMainUI.f(this.mJJ);
                if (brd == null || brd.vHk == null) {
                    ab.w("MicroMsg.FTS.FTSLocalPageRelevantView", "configRelevantDatas param nil!");
                    i = 0;
                } else {
                    List ca = FTSLocalPageRelevantView.ca(brd.vHk);
                    if (ca.size() <= 0) {
                        ab.w("MicroMsg.FTS.FTSLocalPageRelevantView", "configRelevantDatas size 0 items!");
                        i = 0;
                    } else {
                        f.query = str2;
                        f.hlm = str;
                        f.mMc = brd.vHk;
                        if (f.jbJ == null) {
                            f.jbJ = new LinearLayout(f.getContext());
                            f.jbJ.setOrientation(1);
                            LayoutParams layoutParams = (LayoutParams) f.getLayoutParams();
                            layoutParams.width = -1;
                            layoutParams.height = -2;
                            f.addView(f.jbJ, layoutParams);
                        }
                        f.b(ca, f.jbJ);
                        f.requestLayout();
                        i = 1;
                    }
                }
                if (i != 0) {
                    FTSMainUI.f(this.mJJ).setVisibility(0);
                    AppMethodBeat.o(61874);
                    return;
                }
            }
            AppMethodBeat.o(61874);
            return;
        }
        ab.i("MicroMsg.FTS.FTSMainUI", "IRelevantSearchCallback callback with query %s, current query is %s ", new Object[]{str2, this.mJJ.query});
        AppMethodBeat.o(61874);
    }
}
