导航菜单

页面标题

页面副标题

Mint v5.7.3 - NewsLetterActivityNew.java 源代码

正在查看: Mint v5.7.3 应用的 NewsLetterActivityNew.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.htmedia.mint.ui.activity;

import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.ContextCompat;
import androidx.core.content.res.ResourcesCompat;
import androidx.databinding.DataBindingUtil;
import androidx.lifecycle.ViewModelProvider;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.google.android.material.tabs.TabLayout;
import com.google.gson.Gson;
import com.htmedia.mint.AppController;
import com.htmedia.mint.pojo.NewsLetterAuthorData;
import com.htmedia.mint.pojo.NewsLetterAuthorPojo;
import com.htmedia.mint.pojo.NewsLetterData;
import com.htmedia.mint.pojo.NewsLetterItemNew;
import com.htmedia.mint.pojo.NewsLetterResponseModel;
import com.htmedia.mint.pojo.config.Config;
import com.htmedia.mint.pojo.subscription.userdetail.MintSubscriptionDetail;
import com.htmedia.mint.ui.fragments.EPaperPayWallBottomSheetFragment;
import com.htmedia.mint.utils.q;
import com.htmedia.sso.network.ApiClient;
import com.htmedia.sso.network.ApiServices;
import com.htmedia.sso.network.CustomObserver;
import com.snowplowanalytics.snowplow.tracker.constants.Parameters;
import com.thoughtbot.expandablerecyclerview.BuildConfig;
import in.juspay.hypersdk.core.PaymentConstants;
import java.util.ArrayList;
import java.util.HashMap;
import kotlin.Metadata;
import org.json.JSONObject;
import x4.uq0;
import x4.wq0;

@Metadata(d1 = {"\u0000\u009a\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\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\u000b\n\u0000\n\u0002\u0018\u0002\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\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\t\u0018\u00002\u00020\u00012\u00020\u00022\u00020\u0003B\u0005¢\u0006\u0002\u0010\u0004J\b\u0010\u001f\u001a\u00020 H\u0002J\b\u0010!\u001a\u00020 H\u0002J\u001c\u0010\"\u001a\u00020 2\b\u0010#\u001a\u0004\u0018\u00010$2\b\u0010%\u001a\u0004\u0018\u00010\u0019H\u0016J\b\u0010&\u001a\u00020 H\u0002J\"\u0010'\u001a\u00020 2\u0006\u0010(\u001a\u00020)2\u0006\u0010*\u001a\u00020)2\b\u0010+\u001a\u0004\u0018\u00010,H\u0014J\u0012\u0010-\u001a\u00020 2\b\u0010.\u001a\u0004\u0018\u00010/H\u0014J\u0012\u00100\u001a\u00020 2\b\u00101\u001a\u0004\u0018\u00010\u0019H\u0016J\b\u00102\u001a\u00020 H\u0014J\u0012\u00103\u001a\u00020 2\b\u00104\u001a\u0004\u0018\u000105H\u0016J\u0012\u00106\u001a\u00020 2\b\u00104\u001a\u0004\u0018\u000105H\u0016J\u0012\u00107\u001a\u00020 2\b\u00104\u001a\u0004\u0018\u000105H\u0016J\u0010\u00108\u001a\u00020 2\u0006\u0010+\u001a\u000209H\u0002J\b\u0010:\u001a\u00020 H\u0002J\u0017\u0010;\u001a\u00020 2\b\u0010<\u001a\u0004\u0018\u00010)H\u0002¢\u0006\u0002\u0010=J\u0012\u0010>\u001a\u00020 2\b\u00104\u001a\u0004\u0018\u000105H\u0002J\b\u0010?\u001a\u00020 H\u0002J8\u0010@\u001a\u00020 2\u0016\u0010\u000b\u001a\u0012\u0012\u0004\u0012\u00020\r0\fj\b\u0012\u0004\u0012\u00020\r`\u000e2\u0016\u0010\u000f\u001a\u0012\u0012\u0004\u0012\u00020\r0\fj\b\u0012\u0004\u0012\u00020\r`\u000eH\u0002J\b\u0010A\u001a\u00020 H\u0002R\u000e\u0010\u0005\u001a\u00020\u0006X\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010\u0007\u001a\u00020\bX\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010\t\u001a\u00020\nX\u0082\u000e¢\u0006\u0002\n\u0000R\u001e\u0010\u000b\u001a\u0012\u0012\u0004\u0012\u00020\r0\fj\b\u0012\u0004\u0012\u00020\r`\u000eX\u0082.¢\u0006\u0002\n\u0000R\u001e\u0010\u000f\u001a\u0012\u0012\u0004\u0012\u00020\r0\fj\b\u0012\u0004\u0012\u00020\r`\u000eX\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010\u0010\u001a\u00020\u0011X\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010\u0012\u001a\u00020\u0013X\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010\u0014\u001a\u00020\u0015X\u0082.¢\u0006\u0002\n\u0000R\u0016\u0010\u0016\u001a\n\u0012\u0004\u0012\u00020\u0017\u0018\u00010\fX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0018\u001a\u00020\u0019X\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u001a\u001a\u0004\u0018\u00010\u001bX\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u001c\u001a\u0004\u0018\u00010\u001dX\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u001e\u001a\u0004\u0018\u00010\u001bX\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006B"}, d2 = {"Lcom/htmedia/mint/ui/activity/NewsLetterActivityNew;", "Lcom/htmedia/mint/ui/activity/BaseActivity;", "Lcom/google/android/material/tabs/TabLayout$OnTabSelectedListener;", "Lcom/htmedia/mint/presenter/MarketGenericViewInterface;", "()V", "binding", "Lcom/htmedia/mint/databinding/ActivityNewsletterNewBinding;", PaymentConstants.Category.CONFIG, "Lcom/htmedia/mint/pojo/config/Config;", "isNightMode", BuildConfig.FLAVOR, "mFreesLetter", "Ljava/util/ArrayList;", "Lcom/htmedia/mint/pojo/NewsLetterItemNew;", "Lkotlin/collections/ArrayList;", "mSubscriberNewsLetter", "mViewModel", "Lcom/htmedia/mint/ui/viewModels/NewsLetterViewModel;", "marketGenericPresenter", "Lcom/htmedia/mint/presenter/MarketsGenericPresenter;", "newsLetterAdapter", "Lcom/htmedia/mint/ui/adapters/NewsLetterViewPagerAdapter;", "newsLetterAuthorList", "Lcom/htmedia/mint/pojo/NewsLetterAuthorData;", "origin", BuildConfig.FLAVOR, "tabBinding", "Lcom/htmedia/mint/databinding/TablayoutPremiumBinding;", "tabBindingFree", "Lcom/htmedia/mint/databinding/TablayoutFreeBinding;", "tabBindingPremium", "getNewsLetterAuthorList", BuildConfig.FLAVOR, "getNewsLetterData", "getResponse", "jsonObject", "Lorg/json/JSONObject;", "tag", "goBack", "onActivityResult", "requestCode", BuildConfig.FLAVOR, "resultCode", Parameters.DATA, "Landroid/content/Intent;", "onCreate", "savedInstanceState", "Landroid/os/Bundle;", "onError", "response", "onResume", "onTabReselected", "tab", "Lcom/google/android/material/tabs/TabLayout$Tab;", "onTabSelected", "onTabUnselected", "setNewsletterList", "Lcom/htmedia/mint/pojo/NewsLetterData;", "setNightMode", "setTabProperty", "position", "(Ljava/lang/Integer;)V", "setTabSelection", "setToolBar", "setupNewsLetterRv", "setupViewModel", "app_productionRelease"}, k = 1, mv = {1, 9, 0}, xi = 48)
public final class NewsLetterActivityNew extends com.htmedia.mint.ui.activity.a implements TabLayout.OnTabSelectedListener, k6.u0 {
    private ArrayList<NewsLetterAuthorData> a;
    private k6.x0 b;
    private String c = BuildConfig.FLAVOR;
    private wq0 d;
    private uq0 e;
    private q7.o4 f;
    private ArrayList<NewsLetterItemNew> g;
    private ArrayList<NewsLetterItemNew> h;
    private Config i;
    private x4.s1 j;
    private y7.m3 o;
    private boolean p;

    @Metadata(d1 = {"\u0000\u0017\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\n\u0012\u0006\u0012\u0004\u0018\u00010\u00020\u0001J\u0012\u0010\u0003\u001a\u00020\u00042\b\b\u0001\u0010\u0005\u001a\u00020\u0002H\u0016¨\u0006\u0006"}, d2 = {"com/htmedia/mint/ui/activity/NewsLetterActivityNew$getNewsLetterData$1", "Lcom/htmedia/sso/network/CustomObserver;", "Lcom/htmedia/mint/pojo/NewsLetterResponseModel;", "onNext", BuildConfig.FLAVOR, "response", "app_productionRelease"}, k = 1, mv = {1, 9, 0}, xi = 48)
    public static final class a extends CustomObserver<NewsLetterResponseModel> {
        a() {
            super(NewsLetterActivityNew.this, true);
        }

        @Override
        public void onNext(NewsLetterResponseModel response) {
            kotlin.jvm.internal.m.g(response, "response");
            super.onNext((a) response);
            if (response.getData() != null) {
                ArrayList<NewsLetterItemNew> arrayList = new ArrayList<>();
                arrayList.addAll(response.getData().getFREE());
                arrayList.addAll(response.getData().getPAID());
                y7.m3 m3Var = NewsLetterActivityNew.this.o;
                x4.s1 s1Var = null;
                if (m3Var == null) {
                    kotlin.jvm.internal.m.w("mViewModel");
                    m3Var = null;
                }
                m3Var.a = arrayList;
                NewsLetterActivityNew newsLetterActivityNew = NewsLetterActivityNew.this;
                NewsLetterData data = response.getData();
                kotlin.jvm.internal.m.f(data, "getData(...)");
                newsLetterActivityNew.O(data);
                MintSubscriptionDetail l = AppController.j().l();
                if (l != null ? l.isSubscriptionActive() : false) {
                    x4.s1 s1Var2 = NewsLetterActivityNew.this.j;
                    if (s1Var2 == null) {
                        kotlin.jvm.internal.m.w("binding");
                    } else {
                        s1Var = s1Var2;
                    }
                    TabLayout.Tab tabAt = s1Var.c.getTabAt(1);
                    if (tabAt != null) {
                        tabAt.select();
                    }
                }
            }
        }
    }

    private final void M() {
        String newsletter_authors_url = AppController.j().g().getNewsletter_authors_url();
        k6.x0 x0Var = new k6.x0(this, this);
        this.b = x0Var;
        x0Var.a(0, newsletter_authors_url, newsletter_authors_url, null, null, false, false);
    }

    private final void N() {
        String str;
        if (com.htmedia.mint.utils.f0.G1(this, "userName") != null) {
            str = com.htmedia.mint.utils.f0.G1(this, "userEmail");
            kotlin.jvm.internal.m.f(str, "getUserInfo(...)");
        } else {
            str = BuildConfig.FLAVOR;
        }
        ((ApiServices) ApiClient.getClientwithOutHeader().create(ApiServices.class)).getNewsletterData(AppController.j().g().getNewsLetterNetcore().getGetAllNewsletter() + "?email=" + str + "&domain=LM").s(sg.a.b()).k(ag.a.a()).a(new a());
    }

    public final void O(NewsLetterData newsLetterData) {
        this.g = new ArrayList<>();
        this.h = new ArrayList<>();
        ArrayList<NewsLetterItemNew> arrayList = this.g;
        ArrayList<NewsLetterItemNew> arrayList2 = null;
        if (arrayList == null) {
            kotlin.jvm.internal.m.w("mFreesLetter");
            arrayList = null;
        }
        arrayList.addAll(newsLetterData.getFREE());
        ArrayList<NewsLetterItemNew> arrayList3 = this.h;
        if (arrayList3 == null) {
            kotlin.jvm.internal.m.w("mSubscriberNewsLetter");
            arrayList3 = null;
        }
        arrayList3.addAll(newsLetterData.getPAID());
        ArrayList<NewsLetterItemNew> arrayList4 = this.g;
        if (arrayList4 == null) {
            kotlin.jvm.internal.m.w("mFreesLetter");
            arrayList4 = null;
        }
        ArrayList<NewsLetterItemNew> arrayList5 = this.h;
        if (arrayList5 == null) {
            kotlin.jvm.internal.m.w("mSubscriberNewsLetter");
        } else {
            arrayList2 = arrayList5;
        }
        U(arrayList4, arrayList2);
    }

    private final void P() {
        x4.s1 s1Var = null;
        if (!AppController.j().E()) {
            getWindow().setStatusBarColor(-1);
            getWindow().getDecorView().setSystemUiVisibility(8192);
            x4.s1 s1Var2 = this.j;
            if (s1Var2 == null) {
                kotlin.jvm.internal.m.w("binding");
                s1Var2 = null;
            }
            s1Var2.c.setTabTextColors(ContextCompat.getColor(this, 2131100598), ContextCompat.getColor(this, 2131100598));
            x4.s1 s1Var3 = this.j;
            if (s1Var3 == null) {
                kotlin.jvm.internal.m.w("binding");
                s1Var3 = null;
            }
            s1Var3.c.setBackground(ContextCompat.getDrawable(this, 2131233719));
            x4.s1 s1Var4 = this.j;
            if (s1Var4 == null) {
                kotlin.jvm.internal.m.w("binding");
                s1Var4 = null;
            }
            s1Var4.d.setNavigationIcon(2131231330);
            x4.s1 s1Var5 = this.j;
            if (s1Var5 == null) {
                kotlin.jvm.internal.m.w("binding");
                s1Var5 = null;
            }
            s1Var5.d.setTitleTextColor(ResourcesCompat.getColor(getResources(), 2131101008, (Resources.Theme) null));
            return;
        }
        getWindow().setStatusBarColor(-16777216);
        getWindow().getDecorView().setSystemUiVisibility(0);
        x4.s1 s1Var6 = this.j;
        if (s1Var6 == null) {
            kotlin.jvm.internal.m.w("binding");
            s1Var6 = null;
        }
        s1Var6.c.setTabTextColors(ContextCompat.getColor(this, 2131100599), ContextCompat.getColor(this, 2131100599));
        x4.s1 s1Var7 = this.j;
        if (s1Var7 == null) {
            kotlin.jvm.internal.m.w("binding");
            s1Var7 = null;
        }
        s1Var7.c.setBackground(ContextCompat.getDrawable(this, 2131233720));
        x4.s1 s1Var8 = this.j;
        if (s1Var8 == null) {
            kotlin.jvm.internal.m.w("binding");
            s1Var8 = null;
        }
        s1Var8.d.setBackgroundColor(getResources().getColor(2131100008));
        x4.s1 s1Var9 = this.j;
        if (s1Var9 == null) {
            kotlin.jvm.internal.m.w("binding");
            s1Var9 = null;
        }
        s1Var9.d.setTitleTextColor(ResourcesCompat.getColor(getResources(), 2131101009, (Resources.Theme) null));
        x4.s1 s1Var10 = this.j;
        if (s1Var10 == null) {
            kotlin.jvm.internal.m.w("binding");
        } else {
            s1Var = s1Var10;
        }
        s1Var.d.setNavigationIcon(2131231333);
    }

    private final void Q(Integer num) {
        TextView textView;
        TextView textView2;
        TextView textView3;
        TextView textView4;
        TextView textView5;
        TextView textView6;
        TextView textView7;
        TextView textView8;
        TextView textView9;
        if (num != null && num.intValue() == 0) {
            if (this.p) {
                uq0 uq0Var = this.e;
                if (uq0Var != null && (textView9 = uq0Var.a) != null) {
                    textView9.setTextColor(ContextCompat.getColor(this, 2131100599));
                }
                wq0 wq0Var = this.d;
                if (wq0Var != null && (textView8 = wq0Var.a) != null) {
                    textView8.setTextColor(ContextCompat.getColor(this, 2131100599));
                }
            } else {
                uq0 uq0Var2 = this.e;
                if (uq0Var2 != null && (textView7 = uq0Var2.a) != null) {
                    textView7.setTextColor(ContextCompat.getColor(this, 2131100598));
                }
                wq0 wq0Var2 = this.d;
                if (wq0Var2 != null && (textView6 = wq0Var2.a) != null) {
                    textView6.setTextColor(ContextCompat.getColor(this, 2131100598));
                }
            }
            uq0 uq0Var3 = this.e;
            TextView textView10 = uq0Var3 != null ? uq0Var3.a : null;
            if (textView10 != null) {
                textView10.setTypeface(ResourcesCompat.getFont(this, 2131296266));
            }
            wq0 wq0Var3 = this.d;
            textView3 = wq0Var3 != null ? wq0Var3.a : null;
            if (textView3 == null) {
                return;
            }
            textView3.setTypeface(ResourcesCompat.getFont(this, 2131296270));
            return;
        }
        if (this.p) {
            uq0 uq0Var4 = this.e;
            if (uq0Var4 != null && (textView5 = uq0Var4.a) != null) {
                textView5.setTextColor(ContextCompat.getColor(this, 2131100599));
            }
            wq0 wq0Var4 = this.d;
            if (wq0Var4 != null && (textView4 = wq0Var4.a) != null) {
                textView4.setTextColor(ContextCompat.getColor(this, 2131100599));
            }
        } else {
            uq0 uq0Var5 = this.e;
            if (uq0Var5 != null && (textView2 = uq0Var5.a) != null) {
                textView2.setTextColor(ContextCompat.getColor(this, 2131100598));
            }
            wq0 wq0Var5 = this.d;
            if (wq0Var5 != null && (textView = wq0Var5.a) != null) {
                textView.setTextColor(ContextCompat.getColor(this, 2131100598));
            }
        }
        uq0 uq0Var6 = this.e;
        TextView textView11 = uq0Var6 != null ? uq0Var6.a : null;
        if (textView11 != null) {
            textView11.setTypeface(ResourcesCompat.getFont(this, 2131296270));
        }
        wq0 wq0Var6 = this.d;
        textView3 = wq0Var6 != null ? wq0Var6.a : null;
        if (textView3 == null) {
            return;
        }
        textView3.setTypeface(ResourcesCompat.getFont(this, 2131296266));
    }

    private final void R(TabLayout.Tab tab) {
        if (AppController.j().E()) {
            TabLayout.TabView tabView = tab != null ? tab.view : null;
            if (tabView == null) {
                return;
            }
            tabView.setBackground(ResourcesCompat.getDrawable(getResources(), 2131234142, (Resources.Theme) null));
            return;
        }
        TabLayout.TabView tabView2 = tab != null ? tab.view : null;
        if (tabView2 == null) {
            return;
        }
        tabView2.setBackground(ResourcesCompat.getDrawable(getResources(), 2131234141, (Resources.Theme) null));
    }

    private final void S() {
        Toolbar findViewById = findViewById(2131430942);
        kotlin.jvm.internal.m.e(findViewById, "null cannot be cast to non-null type androidx.appcompat.widget.Toolbar");
        Toolbar toolbar = findViewById;
        toolbar.setContentInsetStartWithNavigation(0);
        setSupportActionBar(toolbar);
        ActionBar supportActionBar = getSupportActionBar();
        kotlin.jvm.internal.m.d(supportActionBar);
        supportActionBar.setDisplayShowTitleEnabled(false);
        toolbar.setTitle("Back");
        x4.s1 s1Var = null;
        toolbar.setTitleTextColor(ResourcesCompat.getColor(getResources(), 2131100950, (Resources.Theme) null));
        toolbar.setNavigationIcon(2131231330);
        toolbar.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                NewsLetterActivityNew.T(NewsLetterActivityNew.this, view);
            }
        });
        x4.s1 s1Var2 = this.j;
        if (s1Var2 == null) {
            kotlin.jvm.internal.m.w("binding");
        } else {
            s1Var = s1Var2;
        }
        s1Var.e.setVisibility(8);
    }

    public static final void T(NewsLetterActivityNew newsLetterActivityNew, View view) {
        kotlin.jvm.internal.m.g(newsLetterActivityNew, "this$0");
        newsLetterActivityNew.goBack();
    }

    private final void U(ArrayList<NewsLetterItemNew> arrayList, ArrayList<NewsLetterItemNew> arrayList2) {
        x4.s1 s1Var = this.j;
        q7.o4 o4Var = null;
        if (s1Var == null) {
            kotlin.jvm.internal.m.w("binding");
            s1Var = null;
        }
        s1Var.b.setLayoutManager(new LinearLayoutManager(this));
        y7.m3 m3Var = this.o;
        if (m3Var == null) {
            kotlin.jvm.internal.m.w("mViewModel");
            m3Var = null;
        }
        this.f = new q7.o4(this, arrayList, m3Var);
        x4.s1 s1Var2 = this.j;
        if (s1Var2 == null) {
            kotlin.jvm.internal.m.w("binding");
            s1Var2 = null;
        }
        RecyclerView recyclerView = s1Var2.b;
        q7.o4 o4Var2 = this.f;
        if (o4Var2 == null) {
            kotlin.jvm.internal.m.w("newsLetterAdapter");
        } else {
            o4Var = o4Var2;
        }
        recyclerView.setAdapter(o4Var);
    }

    private final void goBack() {
        if (getIntent().getExtras() != null) {
            Bundle extras = getIntent().getExtras();
            kotlin.jvm.internal.m.d(extras);
            if (extras.containsKey("isNotification")) {
                Bundle extras2 = getIntent().getExtras();
                kotlin.jvm.internal.m.d(extras2);
                if (extras2.getInt("isNotification") > q.m.SPLASH.ordinal()) {
                    startActivity(new Intent((Context) this, (Class<?>) HomeActivity.class));
                }
            }
        }
        finish();
    }

    private final void setupViewModel() {
        this.o = (y7.m3) new ViewModelProvider(this).get(y7.m3.class);
    }

    @Override
    public void getResponse(JSONObject jsonObject, String tag) {
        if (jsonObject != null) {
            this.a = ((NewsLetterAuthorPojo) new Gson().fromJson(jsonObject.toString(), NewsLetterAuthorPojo.class)).getData();
            y7.m3 m3Var = this.o;
            if (m3Var == null) {
                kotlin.jvm.internal.m.w("mViewModel");
                m3Var = null;
            }
            m3Var.b = this.a;
            N();
        }
    }

    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super/*androidx.fragment.app.FragmentActivity*/.onActivityResult(requestCode, resultCode, data);
        if (requestCode == 102 && resultCode == -1) {
            HashMap hashMap = new HashMap();
            String G1 = com.htmedia.mint.utils.f0.G1(this, "userSecondaryEmail");
            if (TextUtils.isEmpty(G1)) {
                G1 = com.htmedia.mint.utils.f0.G1(this, "userEmail");
            }
            if (G1 != null) {
                hashMap.put("userEmail", G1);
            }
            if (com.htmedia.mint.utils.f0.G1(this, "userName") != null) {
                String G12 = com.htmedia.mint.utils.f0.G1(this, "userName");
                kotlin.jvm.internal.m.f(G12, "getUserInfo(...)");
                hashMap.put("userName", G12);
            }
            if (!hashMap.isEmpty()) {
                com.htmedia.mint.utils.o0.i(hashMap);
            }
            EPaperPayWallBottomSheetFragment findFragmentByTag = getSupportFragmentManager().findFragmentByTag("epaper_paywall");
            if (findFragmentByTag instanceof EPaperPayWallBottomSheetFragment) {
                findFragmentByTag.dismissAllowingStateLoss();
                com.htmedia.mint.utils.f0.A2(this, null);
            }
            MintSubscriptionDetail l = AppController.j().l();
            if (l == null) {
                M();
            } else if (l.isAdFreeUserToReLauch()) {
                com.htmedia.mint.utils.f0.R2(new Intent((Context) this, (Class<?>) HomeActivity.class), this);
            } else {
                M();
            }
            invalidateOptionsMenu();
        }
    }

    protected void onCreate(Bundle savedInstanceState) {
        View customView;
        View customView2;
        super/*androidx.fragment.app.FragmentActivity*/.onCreate(savedInstanceState);
        x4.s1 contentView = DataBindingUtil.setContentView(this, 2131624006);
        kotlin.jvm.internal.m.f(contentView, "setContentView(...)");
        this.j = contentView;
        Config g = AppController.j().g();
        kotlin.jvm.internal.m.f(g, "getConfigNew(...)");
        this.i = g;
        x4.s1 s1Var = this.j;
        if (s1Var == null) {
            kotlin.jvm.internal.m.w("binding");
            s1Var = null;
        }
        s1Var.c.addOnTabSelectedListener(this);
        x4.s1 s1Var2 = this.j;
        if (s1Var2 == null) {
            kotlin.jvm.internal.m.w("binding");
            s1Var2 = null;
        }
        s1Var2.c(Boolean.valueOf(AppController.j().E()));
        x4.s1 s1Var3 = this.j;
        if (s1Var3 == null) {
            kotlin.jvm.internal.m.w("binding");
            s1Var3 = null;
        }
        TabLayout.Tab tabAt = s1Var3.c.getTabAt(0);
        this.e = (tabAt == null || (customView2 = tabAt.getCustomView()) == null) ? null : uq0.c(customView2);
        x4.s1 s1Var4 = this.j;
        if (s1Var4 == null) {
            kotlin.jvm.internal.m.w("binding");
            s1Var4 = null;
        }
        TabLayout.Tab tabAt2 = s1Var4.c.getTabAt(1);
        this.d = (tabAt2 == null || (customView = tabAt2.getCustomView()) == null) ? null : wq0.c(customView);
        uq0 uq0Var = this.e;
        TextView textView = uq0Var != null ? uq0Var.a : null;
        if (textView != null) {
            textView.setText("Free");
        }
        wq0 wq0Var = this.d;
        TextView textView2 = wq0Var != null ? wq0Var.a : null;
        if (textView2 != null) {
            textView2.setText("Premium");
        }
        this.p = AppController.j().E();
        Bundle extras = getIntent().getExtras();
        this.c = String.valueOf(extras != null ? extras.getString("origin") : null);
        S();
        setupViewModel();
        M();
        P();
        com.htmedia.mint.utils.k1.x(com.htmedia.mint.utils.k1.l(this), "/NewsLetter");
        com.htmedia.mint.utils.n.A(this, com.htmedia.mint.utils.n.U0, "free/newsletter", com.htmedia.mint.utils.n.p0, null, this.c);
    }

    @Override
    public void onError(String response) {
    }

    protected void onResume() {
        super/*androidx.fragment.app.FragmentActivity*/.onResume();
        x4.s1 s1Var = this.j;
        if (s1Var == null) {
            kotlin.jvm.internal.m.w("binding");
            s1Var = null;
        }
        R(s1Var.c.getTabAt(0));
        Q(0);
    }

    public void onTabReselected(TabLayout.Tab tab) {
    }

    public void onTabSelected(TabLayout.Tab tab) {
        ArrayList<NewsLetterItemNew> arrayList = null;
        Q(tab != null ? Integer.valueOf(tab.getPosition()) : null);
        Integer valueOf = tab != null ? Integer.valueOf(tab.getPosition()) : null;
        if (valueOf != null && valueOf.intValue() == 0) {
            x4.s1 s1Var = this.j;
            if (s1Var == null) {
                kotlin.jvm.internal.m.w("binding");
                s1Var = null;
            }
            s1Var.b.smoothScrollToPosition(0);
            q7.o4 o4Var = this.f;
            if (o4Var != null) {
                if (o4Var == null) {
                    kotlin.jvm.internal.m.w("newsLetterAdapter");
                    o4Var = null;
                }
                ArrayList<NewsLetterItemNew> arrayList2 = this.g;
                if (arrayList2 == null) {
                    kotlin.jvm.internal.m.w("mFreesLetter");
                } else {
                    arrayList = arrayList2;
                }
                o4Var.i(arrayList);
            } else {
                ArrayList<NewsLetterItemNew> arrayList3 = this.g;
                if (arrayList3 == null) {
                    kotlin.jvm.internal.m.w("mFreesLetter");
                    arrayList3 = null;
                }
                ArrayList<NewsLetterItemNew> arrayList4 = this.h;
                if (arrayList4 == null) {
                    kotlin.jvm.internal.m.w("mSubscriberNewsLetter");
                } else {
                    arrayList = arrayList4;
                }
                U(arrayList3, arrayList);
            }
            R(tab);
            com.htmedia.mint.utils.n.A(this, com.htmedia.mint.utils.n.U0, "free/newsletter", com.htmedia.mint.utils.n.p0, null, this.c);
            return;
        }
        if (valueOf != null && valueOf.intValue() == 1) {
            x4.s1 s1Var2 = this.j;
            if (s1Var2 == null) {
                kotlin.jvm.internal.m.w("binding");
                s1Var2 = null;
            }
            s1Var2.b.smoothScrollToPosition(0);
            q7.o4 o4Var2 = this.f;
            if (o4Var2 != null) {
                if (o4Var2 == null) {
                    kotlin.jvm.internal.m.w("newsLetterAdapter");
                    o4Var2 = null;
                }
                ArrayList<NewsLetterItemNew> arrayList5 = this.h;
                if (arrayList5 == null) {
                    kotlin.jvm.internal.m.w("mSubscriberNewsLetter");
                } else {
                    arrayList = arrayList5;
                }
                o4Var2.i(arrayList);
            } else {
                ArrayList<NewsLetterItemNew> arrayList6 = this.g;
                if (arrayList6 == null) {
                    kotlin.jvm.internal.m.w("mFreesLetter");
                    arrayList6 = null;
                }
                ArrayList<NewsLetterItemNew> arrayList7 = this.h;
                if (arrayList7 == null) {
                    kotlin.jvm.internal.m.w("mSubscriberNewsLetter");
                } else {
                    arrayList = arrayList7;
                }
                U(arrayList6, arrayList);
            }
            R(tab);
            com.htmedia.mint.utils.n.A(this, com.htmedia.mint.utils.n.U0, "premium/newsletter", com.htmedia.mint.utils.n.p0, null, this.c);
        }
    }

    public void onTabUnselected(TabLayout.Tab tab) {
    }
}