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

import a.f.a.m;
import a.f.b.j;
import a.f.b.k;
import a.l;
import a.y;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.RecyclerView.i;
import android.view.View;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.story.model.b.a;
import com.tencent.mm.ui.MMActivity;
import java.util.ArrayList;
import java.util.List;

@l(dWo = {1, 1, 13}, dWp = {"\u00008\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u0018\u00002\u00020\u0001:\u0001\u0011B\u0005¢\u0006\u0002\u0010\u0002J\b\u0010\u0007\u001a\u00020\bH\u0014J\u0014\u0010\t\u001a\u00020\n2\f\u0010\u000b\u001a\b\u0012\u0004\u0012\u00020\r0\fJ\u0012\u0010\u000e\u001a\u00020\n2\b\u0010\u000f\u001a\u0004\u0018\u00010\u0010H\u0016R\u0012\u0010\u0003\u001a\u00060\u0004R\u00020\u0000X.¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0006X.¢\u0006\u0002\n\u0000¨\u0006\u0012"}, dWq = {"Lcom/tencent/mm/plugin/story/ui/StoryCommentsUI;", "Lcom/tencent/mm/ui/MMActivity;", "()V", "commentAdapter", "Lcom/tencent/mm/plugin/story/ui/StoryCommentsUI$CommentUnreadAdapter;", "commentRecycler", "Landroid/support/v7/widget/RecyclerView;", "getLayoutId", "", "onCommentsLoaded", "", "comments", "", "Lcom/tencent/mm/plugin/story/model/comment/StoryCommentItem;", "onCreate", "savedInstanceState", "Landroid/os/Bundle;", "CommentUnreadAdapter", "plugin-story_release"})
public final class StoryCommentsUI extends MMActivity {
    private RecyclerView seK;
    private a seL;

    @l(dWo = {1, 1, 13}, dWp = {"\u0000\u0014\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0000\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u0005H\n¢\u0006\u0002\b\u0006"}, dWq = {"<anonymous>", "", "position", "", "item", "Lcom/tencent/mm/plugin/story/model/comment/StoryCommentItem;", "invoke"})
    static final class b extends k implements m<Integer, a, y> {
        public static final b seU = new b();

        static {
            AppMethodBeat.i(110030);
            AppMethodBeat.o(110030);
        }

        b() {
            super(2);
        }

        public final /* synthetic */ Object m(Object obj, Object obj2) {
            AppMethodBeat.i(110029);
            ((Number) obj).intValue();
            j.p((a) obj2, "item");
            y yVar = y.AUy;
            AppMethodBeat.o(110029);
            return yVar;
        }
    }

    public void onWindowFocusChanged(boolean z) {
        super.onWindowFocusChanged(z);
        AppMethodBeat.at(this, z);
    }

    public final void onCreate(Bundle bundle) {
        AppMethodBeat.i(110031);
        super.onCreate(bundle);
        View findViewById = findViewById(2131828077);
        j.o(findViewById, "findViewById(R.id.story_comment_recycler)");
        this.seK = (RecyclerView) findViewById;
        RecyclerView recyclerView = this.seK;
        if (recyclerView == null) {
            j.avw("commentRecycler");
        }
        recyclerView.setLayoutManager((i) new LinearLayoutManager());
        this.seL = new a(this);
        recyclerView = this.seK;
        if (recyclerView == null) {
            j.avw("commentRecycler");
        }
        a aVar = this.seL;
        if (aVar == null) {
            j.avw("commentAdapter");
        }
        recyclerView.setAdapter((RecyclerView.a) aVar);
        a aVar2 = this.seL;
        if (aVar2 == null) {
            j.avw("commentAdapter");
        }
        aVar2.seN = (m) b.seU;
        ArrayList arrayList = new ArrayList();
        aVar2 = this.seL;
        if (aVar2 == null) {
            j.avw("commentAdapter");
        }
        List list = arrayList;
        j.p(list, "storyComments");
        aVar2.seM.clear();
        aVar2.seM.addAll(list);
        aVar2.notifyDataSetChanged();
        AppMethodBeat.o(110031);
    }

    public final int getLayoutId() {
        return 2130970873;
    }
}
