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

import a.l;
import android.content.Context;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.bp.d;
import com.tencent.mm.plugin.story.api.o;
import com.tencent.mm.plugin.story.d.a.a;
import com.tencent.mm.plugin.story.d.a.b;
import com.tencent.mm.plugin.story.g.h;
import com.tencent.mm.plugin.story.h.j;
import com.tencent.mm.plugin.story.ui.StoryBrowseUI;
import com.tencent.mm.ui.MMActivity;
import com.tencent.ytcommon.BuildConfig;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

@l(dWo = {1, 1, 13}, dWp = {"\u0000Z\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u0002\n\u0002\b\b\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010 \n\u0002\b\u0004\u0018\u0000 &2\u00020\u00012\u00020\u0002:\u0001&B\u0005¢\u0006\u0002\u0010\u0003J\b\u0010\u0012\u001a\u00020\u0013H\u0014J(\u0010\u0014\u001a\u00020\u00152\u0006\u0010\u0016\u001a\u00020\u00132\u0016\u0010\u0017\u001a\u0012\u0012\u0004\u0012\u00020\u000f0\u0005j\b\u0012\u0004\u0012\u00020\u000f`\u0007H\u0002J\b\u0010\u0018\u001a\u00020\u0015H\u0002J\b\u0010\u0019\u001a\u00020\u0015H\u0002J\b\u0010\u001a\u001a\u00020\u0015H\u0002J\b\u0010\u001b\u001a\u00020\u0015H\u0002J\u0012\u0010\u001c\u001a\u00020\u00152\b\u0010\u001d\u001a\u0004\u0018\u00010\u001eH\u0016J\b\u0010\u001f\u001a\u00020\u0015H\u0014J\b\u0010 \u001a\u00020\u0015H\u0016J\u001e\u0010!\u001a\u00020\u00152\f\u0010\"\u001a\b\u0012\u0004\u0012\u00020\u00060#2\u0006\u0010$\u001a\u00020\u000bH\u0016J\b\u0010%\u001a\u00020\u0015H\u0014R\u001e\u0010\u0004\u001a\u0012\u0012\u0004\u0012\u00020\u00060\u0005j\b\u0012\u0004\u0012\u00020\u0006`\u0007X\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\b\u001a\u0004\u0018\u00010\tX\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\n\u001a\u00020\u000bX\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\f\u001a\u00020\rX.¢\u0006\u0002\n\u0000R\u000e\u0010\u000e\u001a\u00020\u000fX\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u0010\u001a\u0004\u0018\u00010\u0011X\u000e¢\u0006\u0002\n\u0000¨\u0006'"}, dWq = {"Lcom/tencent/mm/plugin/story/ui/album/StoryFavAlbumUI;", "Lcom/tencent/mm/ui/MMActivity;", "Lcom/tencent/mm/plugin/story/contract/AlbumContract$IFavAlbumView;", "()V", "curDataList", "Ljava/util/ArrayList;", "Lcom/tencent/mm/plugin/story/storage/StoryInfo;", "Lkotlin/collections/ArrayList;", "favPanel", "Lcom/tencent/mm/plugin/story/ui/album/StoryFavoritePanel;", "isSelf", "", "mPresenter", "Lcom/tencent/mm/plugin/story/contract/AlbumContract$IFavAlbumPresenter;", "mUsername", "", "tipTv", "Landroid/widget/TextView;", "getLayoutId", "", "goFavGallery", "", "position", "dateList", "goFavSelector", "initActionBar", "initViews", "loadData", "onCreate", "savedInstanceState", "Landroid/os/Bundle;", "onDestroy", "onIsAll", "onLoadFavFinish", "datas", "", "isAllEmpty", "onResume", "Companion", "plugin-story_release"})
public final class StoryFavAlbumUI extends MMActivity implements b {
    private static final String TAG = TAG;
    public static final a sgG = new a((byte) 0);
    private boolean czr = true;
    private TextView gJE;
    private String igi = BuildConfig.FLAVOR;
    private ArrayList<j> sgD = new ArrayList();
    private StoryFavoritePanel sgE;
    private a sgF;

    @l(dWo = {1, 1, 13}, dWp = {"\u0000\u0010\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\u00020\u00012\u000e\u0010\u0002\u001a\n \u0004*\u0004\u0018\u00010\u00030\u0003H\n¢\u0006\u0002\b\u0005"}, dWq = {"<anonymous>", "", "it", "Landroid/view/View;", "kotlin.jvm.PlatformType", "onClick"})
    static final class c implements OnClickListener {
        final /* synthetic */ StoryFavAlbumUI sgH;

        c(StoryFavAlbumUI storyFavAlbumUI) {
            this.sgH = storyFavAlbumUI;
        }

        public final void onClick(View view) {
            AppMethodBeat.i(138867);
            Intent intent = new Intent();
            intent.putExtra("Contact_User", this.sgH.igi);
            intent.putExtra("CONTACT_INFO_UI_SOURCE", 12);
            d.b((Context) this.sgH, "profile", ".ui.ContactInfoUI", intent);
            AppMethodBeat.o(138867);
        }
    }

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

    public StoryFavAlbumUI() {
        AppMethodBeat.i(138876);
        AppMethodBeat.o(138876);
    }

    public static final /* synthetic */ a d(StoryFavAlbumUI storyFavAlbumUI) {
        AppMethodBeat.i(138879);
        a aVar = storyFavAlbumUI.sgF;
        if (aVar == null) {
            a.f.b.j.avw("mPresenter");
        }
        AppMethodBeat.o(138879);
        return aVar;
    }

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

    public final int getLayoutId() {
        return 2130970848;
    }

    /* JADX WARNING: Missing block: B:3:0x0019, code skipped:
            if (r0 == null) goto L_0x001b;
     */
    public final void onCreate(android.os.Bundle r6) {
        /*
        r5 = this;
        r4 = 138871; // 0x21e77 float:1.946E-40 double:6.86114E-319;
        com.tencent.matrix.trace.core.AppMethodBeat.i(r4);
        r5.dxR();
        super.onCreate(r6);
        r0 = r5.getIntent();
        if (r0 == 0) goto L_0x001b;
    L_0x0012:
        r1 = "username";
        r0 = r0.getStringExtra(r1);
        if (r0 != 0) goto L_0x001e;
    L_0x001b:
        r0 = "";
    L_0x001e:
        r5.igi = r0;
        r0 = TAG;
        r1 = new java.lang.StringBuilder;
        r2 = "initViews username=";
        r1.<init>(r2);
        r2 = r5.igi;
        r1 = r1.append(r2);
        r1 = r1.toString();
        com.tencent.mm.sdk.platformtools.ab.i(r0, r1);
        r0 = com.tencent.mm.kernel.g.RP();
        r0 = r0.Ry();
        r1 = 2;
        r0 = r0.get(r1);
        if (r0 != 0) goto L_0x0052;
    L_0x0046:
        r0 = new a.v;
        r1 = "null cannot be cast to non-null type kotlin.String";
        r0.<init>(r1);
        com.tencent.matrix.trace.core.AppMethodBeat.o(r4);
        throw r0;
    L_0x0052:
        r0 = (java.lang.String) r0;
        r1 = r5.igi;
        r0 = com.tencent.mm.sdk.platformtools.bo.isEqual(r0, r1);
        r5.czr = r0;
        r0 = r5.czr;
        if (r0 == 0) goto L_0x0104;
    L_0x0060:
        r0 = 2131305994; // 0x7f09260a float:1.8230175E38 double:1.0530050724E-314;
        r5.setMMTitle(r0);
    L_0x0066:
        r0 = new com.tencent.mm.plugin.story.ui.album.StoryFavAlbumUI$b;
        r0.<init>(r5);
        r0 = (android.view.MenuItem.OnMenuItemClickListener) r0;
        r5.setBackBtn(r0);
        r1 = new com.tencent.mm.plugin.story.f.m;
        r0 = r5;
        r0 = (com.tencent.mm.plugin.story.d.a.b) r0;
        r1.<init>(r0);
        r0 = r1;
        r0 = (com.tencent.mm.plugin.story.d.a.a) r0;
        r5.sgF = r0;
        r0 = r5.sgF;
        if (r0 != 0) goto L_0x0087;
    L_0x0081:
        r1 = "mPresenter";
        a.f.b.j.avw(r1);
    L_0x0087:
        r1 = r5.igi;
        r0.onCreate(r1);
        r0 = 2131827990; // 0x7f111d16 float:1.9288908E38 double:1.0532629727E-314;
        r0 = r5.findViewById(r0);
        r0 = (android.widget.TextView) r0;
        r5.gJE = r0;
        r0 = r5.czr;
        if (r0 != 0) goto L_0x0168;
    L_0x009b:
        r0 = r5.gJE;
        if (r0 == 0) goto L_0x00a4;
    L_0x009f:
        r1 = 8;
        r0.setVisibility(r1);
    L_0x00a4:
        r0 = 2131827991; // 0x7f111d17 float:1.928891E38 double:1.053262973E-314;
        r0 = r5.findViewById(r0);
        r0 = (com.tencent.mm.plugin.story.ui.album.StoryFavoritePanel) r0;
        r5.sgE = r0;
        r0 = r5.sgE;
        if (r0 == 0) goto L_0x00bc;
    L_0x00b3:
        r1 = com.tencent.mm.plugin.story.ui.album.StoryFavoritePanel.sgX;
        r1 = com.tencent.mm.plugin.story.ui.album.StoryFavoritePanel.cCj();
        r0.setup(r1);
    L_0x00bc:
        r1 = r5.sgE;
        if (r1 == 0) goto L_0x00ca;
    L_0x00c0:
        r0 = new com.tencent.mm.plugin.story.ui.album.StoryFavAlbumUI$d;
        r0.<init>(r5);
        r0 = (a.f.a.b) r0;
        r1.setMOnAddItemClickListener(r0);
    L_0x00ca:
        r1 = r5.sgE;
        if (r1 == 0) goto L_0x00d8;
    L_0x00ce:
        r0 = new com.tencent.mm.plugin.story.ui.album.StoryFavAlbumUI$e;
        r0.<init>(r5);
        r0 = (a.f.a.m) r0;
        r1.setMOnFavItemClickListener(r0);
    L_0x00d8:
        r1 = r5.sgE;
        if (r1 == 0) goto L_0x00e6;
    L_0x00dc:
        r0 = new com.tencent.mm.plugin.story.ui.album.StoryFavAlbumUI$f;
        r0.<init>(r5);
        r0 = (android.support.v7.widget.RecyclerView.m) r0;
        r1.a(r0);
    L_0x00e6:
        r0 = r5.sgF;
        if (r0 != 0) goto L_0x00f0;
    L_0x00ea:
        r1 = "mPresenter";
        a.f.b.j.avw(r1);
    L_0x00f0:
        r0.cxl();
        r0 = r5.sgF;
        if (r0 != 0) goto L_0x00fd;
    L_0x00f7:
        r1 = "mPresenter";
        a.f.b.j.avw(r1);
    L_0x00fd:
        r0.cxm();
        com.tencent.matrix.trace.core.AppMethodBeat.o(r4);
        return;
    L_0x0104:
        r0 = com.tencent.mm.plugin.messenger.foundation.a.j.class;
        r0 = com.tencent.mm.kernel.g.K(r0);
        r1 = "MMKernel.service(IMessengerStorage::class.java)";
        a.f.b.j.o(r0, r1);
        r0 = (com.tencent.mm.plugin.messenger.foundation.a.j) r0;
        r0 = r0.XM();
        r1 = r5.igi;
        r1 = r0.aoO(r1);
        r0 = r5.dxU();
        r0 = (android.content.Context) r0;
        if (r1 == 0) goto L_0x0161;
    L_0x0124:
        r1 = r1.Oj();
        if (r1 == 0) goto L_0x0161;
    L_0x012a:
        r1 = (java.lang.CharSequence) r1;
        r2 = r1;
    L_0x012d:
        r1 = 16908308; // 0x1020014 float:2.3877285E-38 double:8.353814E-317;
        r1 = r5.findViewById(r1);
        r3 = "findViewById<TextView>(android.R.id.text1)";
        a.f.b.j.o(r1, r3);
        r1 = (android.widget.TextView) r1;
        r1 = r1.getTextSize();
        r0 = com.tencent.mm.pluginsdk.ui.e.j.b(r0, r2, r1);
        r1 = new java.lang.StringBuilder;
        r1.<init>();
        r0 = r1.append(r0);
        r1 = 2131305995; // 0x7f09260b float:1.8230177E38 double:1.053005073E-314;
        r1 = r5.getString(r1);
        r0 = r0.append(r1);
        r0 = r0.toString();
        r5.setMMTitle(r0);
        goto L_0x0066;
    L_0x0161:
        r1 = "";
        r1 = (java.lang.CharSequence) r1;
        r2 = r1;
        goto L_0x012d;
    L_0x0168:
        r0 = r5.gJE;
        if (r0 == 0) goto L_0x0170;
    L_0x016c:
        r1 = 0;
        r0.setVisibility(r1);
    L_0x0170:
        r1 = r5.gJE;
        if (r1 == 0) goto L_0x0188;
    L_0x0174:
        r0 = r5.getResources();
        r2 = 2131305988; // 0x7f092604 float:1.8230162E38 double:1.0530050694E-314;
        r0 = r0.getString(r2);
        r0 = android.text.Html.fromHtml(r0);
        r0 = (java.lang.CharSequence) r0;
        r1.setText(r0);
    L_0x0188:
        r1 = r5.gJE;
        if (r1 == 0) goto L_0x00a4;
    L_0x018c:
        r0 = new com.tencent.mm.plugin.story.ui.album.StoryFavAlbumUI$c;
        r0.<init>(r5);
        r0 = (android.view.View.OnClickListener) r0;
        r1.setOnClickListener(r0);
        goto L_0x00a4;
        */
        throw new UnsupportedOperationException("Method not decompiled: com.tencent.mm.plugin.story.ui.album.StoryFavAlbumUI.onCreate(android.os.Bundle):void");
    }

    public final void onResume() {
        AppMethodBeat.i(138872);
        super.onResume();
        a aVar = this.sgF;
        if (aVar == null) {
            a.f.b.j.avw("mPresenter");
        }
        aVar.cxm();
        AppMethodBeat.o(138872);
    }

    public final void onDestroy() {
        AppMethodBeat.i(138873);
        super.onDestroy();
        a aVar = this.sgF;
        if (aVar == null) {
            a.f.b.j.avw("mPresenter");
        }
        aVar.bMO();
        AppMethodBeat.o(138873);
    }

    public final void f(List<j> list, boolean z) {
        AppMethodBeat.i(138874);
        a.f.b.j.p(list, "datas");
        StoryFavoritePanel storyFavoritePanel;
        if ((!((Collection) list).isEmpty() ? 1 : null) == null && z) {
            this.sgD.clear();
            TextView textView = this.gJE;
            if (textView != null) {
                textView.setVisibility(8);
            }
            storyFavoritePanel = this.sgE;
            if (storyFavoritePanel != null) {
                AppCompatActivity dxU = dxU();
                a.f.b.j.o(dxU, "context");
                String string = dxU.getResources().getString(2131305993);
                a.f.b.j.o(string, "context.resources.getStr…album_favorite_empty_tip)");
                storyFavoritePanel.abd(string);
                AppMethodBeat.o(138874);
                return;
            }
            AppMethodBeat.o(138874);
            return;
        }
        this.sgD.clear();
        this.sgD.addAll(list);
        storyFavoritePanel = this.sgE;
        if (storyFavoritePanel != null) {
            storyFavoritePanel.g(list, this.czr);
            AppMethodBeat.o(138874);
            return;
        }
        AppMethodBeat.o(138874);
    }

    public final void cxn() {
        AppMethodBeat.i(138875);
        StoryFavoritePanel storyFavoritePanel = this.sgE;
        if (storyFavoritePanel != null) {
            storyFavoritePanel.cxn();
            AppMethodBeat.o(138875);
            return;
        }
        AppMethodBeat.o(138875);
    }

    public static final /* synthetic */ void b(StoryFavAlbumUI storyFavAlbumUI) {
        AppMethodBeat.i(138877);
        storyFavAlbumUI.startActivityForResult(new Intent((Context) storyFavAlbumUI, StoryFavSelectUI.class), 2);
        AppMethodBeat.o(138877);
    }

    public static final /* synthetic */ void a(StoryFavAlbumUI storyFavAlbumUI, int i, ArrayList arrayList) {
        AppMethodBeat.i(138878);
        long i2 = o.rQN.i(arrayList, storyFavAlbumUI.igi);
        Intent intent = new Intent((Context) storyFavAlbumUI, StoryBrowseUI.class);
        intent.putExtra("data_seed_key", i2);
        intent.putExtra("username", storyFavAlbumUI.igi);
        intent.putExtra("v_position", i);
        intent.putExtra("gallery_story_need_action", false);
        storyFavAlbumUI.startActivityForResult(intent, 3);
        h hVar = h.scu;
        h.cAs().bG(15);
        AppMethodBeat.o(138878);
    }
}
