package com.ss.android.ugc.aweme.notification.view;

import X.7he;
import X.7qE;
import X.C0295Crj;
import X.C3531EHv;
import X.C3681ENp;
import X.C4519EiJ;
import X.C4794Emk;
import X.C4969EpZ;
import X.M12;
import android.app.Activity;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import androidx.fragment.app.Fragment;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.TabFragmentNode;
import com.ss.android.ugc.aweme.main.uiApiImpl.HomePageUIFrameServiceImpl;

public final class NotificationTab extends TabFragmentNode {
    public final Context LIZIZ;
    public View.OnClickListener LIZJ;
    public final C0295Crj LIZLLL = 7he.LIZ(new C3681ENp(this));

    static {
        Covode.recordClassIndex(95977);
    }

    private final C4969EpZ LIZIZ() {
        return (C4969EpZ) this.LIZLLL.getValue();
    }

    public final String LJ() {
        return "NOTIFICATION";
    }

    public final String cC_() {
        return "notification_page";
    }

    public final String ap_() {
        return LIZIZ().LJIIJ;
    }

    public final Class<? extends Fragment> LJI() {
        return HomePageUIFrameServiceImpl.LJ().LIZIZ("NOTIFICATION");
    }

    public final void LIZLLL() {
        if (this.LIZJ == null) {
            this.LIZJ = new C3531EHv(this.LIZIZ);
        }
        View.OnClickListener onClickListener = this.LIZJ;
        if (onClickListener != null) {
            onClickListener.onClick((View) null);
        }
    }

    public final Bundle LJII() {
        Intent intent;
        Context context = this.LIZIZ;
        if (context != null) {
            while (true) {
                if (!(context instanceof Activity)) {
                    if (context instanceof ContextWrapper) {
                        context = ((ContextWrapper) context).getBaseContext();
                        if (context == null) {
                            break;
                        }
                    } else {
                        break;
                    }
                } else {
                    Activity activity = (Activity) context;
                    if (activity != null && (intent = activity.getIntent()) != null) {
                        return LIZ(intent);
                    }
                }
            }
        }
        return null;
    }

    public static Bundle LIZ(Intent intent) {
        try {
            return intent.getExtras();
        } catch (Exception unused) {
            return null;
        }
    }

    public NotificationTab(Context context) {
        M12.LIZ(context);
        this.LIZIZ = context;
    }

    public final View LIZ(C4519EiJ eiJ) {
        M12.LIZ(eiJ);
        if (!7qE.LJI.LIZJ()) {
            return eiJ.LIZ((C4794Emk) LIZIZ());
        }
        View LIZLLL2 = HomePageUIFrameServiceImpl.LJ().LIZLLL();
        if (LIZLLL2 == null) {
            return eiJ.LIZ((C4794Emk) LIZIZ());
        }
        return LIZLLL2;
    }
}
