导航菜单

页面标题

页面副标题

Mint v5.7.3 - m.java 源代码

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

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


package v5;

import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.ObservableBoolean;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import androidx.viewpager2.widget.ViewPager2;
import com.google.gson.GsonBuilder;
import com.htmedia.mint.R;
import com.htmedia.mint.author.pojo.Author;
import com.htmedia.mint.author.pojo.MyAuthorListResponse;
import com.htmedia.mint.htsubscription.planpagerewamp.ui.customviews.CustomPagerIndicator;
import com.htmedia.mint.mymint.pojo.MintDataItem;
import com.htmedia.mint.pojo.Content;
import com.htmedia.mint.utils.f0;
import com.htmedia.mint.utils.h0;
import java.util.ArrayList;
import java.util.HashMap;
import org.json.JSONObject;
import p4.a;
import r4.a;
import s5.b;
import v5.l;
import x4.qq0;

public class m extends Fragment implements a.b, a.b, b.InterfaceC0081b {
    public static boolean v;
    private qq0 a;
    private HashMap<String, ArrayList<Author>> d;
    private AppCompatActivity f;
    private MintDataItem g;
    private ArrayList<Author> j;
    private s5.b o;
    private k6.p p;
    private v4.b q;
    private ArrayList<Author> r;
    private String c = "";
    private ArrayList<View> e = new ArrayList<>();
    private boolean h = false;
    private ArrayList<Author> i = new ArrayList<>();
    private int s = 0;
    private int t = 40;
    private String u = "";

    class a implements SwipeRefreshLayout.OnRefreshListener {
        a() {
        }

        public void onRefresh() {
            m.v = true;
            m mVar = m.this;
            mVar.O(mVar.f, m.this.g);
        }
    }

    class b implements View.OnClickListener {
        final AppCompatActivity a;

        b(AppCompatActivity appCompatActivity) {
            this.a = appCompatActivity;
        }

        @Override
        public void onClick(View view) {
            m mVar = m.this;
            mVar.V(this.a, mVar.u, "explore authors");
            m.this.R(this.a);
        }
    }

    class c implements k6.q {
        final MintDataItem a;
        final AppCompatActivity b;

        class a implements Runnable {
            a() {
            }

            @Override
            public void run() {
                c cVar = c.this;
                m.this.a0(cVar.b, cVar.a, "My Authors");
            }
        }

        c(MintDataItem mintDataItem, AppCompatActivity appCompatActivity) {
            this.a = mintDataItem;
            this.b = appCompatActivity;
        }

        public void getAboutCompanyData(JSONObject jSONObject, String str) {
            MyAuthorListResponse myAuthorListResponse = (MyAuthorListResponse) new GsonBuilder().create().fromJson(jSONObject.toString(), MyAuthorListResponse.class);
            if (myAuthorListResponse.getItems() == null || myAuthorListResponse.getItems().size() <= 0) {
                this.a.setCollection(false);
                m.this.W(this.a, this.b);
                return;
            }
            m.this.i = myAuthorListResponse.getItems();
            if (m.this.i == null || m.this.i.size() <= 0) {
                this.a.setCollection(false);
                m.this.W(this.a, this.b);
            } else {
                this.a.setCollection(true);
                new Handler().postDelayed(new a(), 200L);
            }
        }

        public void onError(String str, String str2) {
            m.this.h = false;
        }
    }

    class d implements View.OnClickListener {
        final AppCompatActivity a;

        d(AppCompatActivity appCompatActivity) {
            this.a = appCompatActivity;
        }

        @Override
        public void onClick(View view) {
            Log.e("My Author", "onClick: " + m.this.r.size());
            if (m.this.r == null || m.this.r.size() <= 0) {
                return;
            }
            m mVar = m.this;
            mVar.U(this.a, mVar.u);
            m.this.Z();
            m.this.q.O(u4.h.j(this.a), u4.h.g(m.this.r), m.this, 0, "", false);
        }
    }

    class e implements k6.q {
        final AppCompatActivity a;

        e(AppCompatActivity appCompatActivity) {
            this.a = appCompatActivity;
        }

        public void getAboutCompanyData(JSONObject jSONObject, String str) {
            m.this.Y();
            m.this.S();
            if (jSONObject == null) {
                m.this.a.a.setVisibility(8);
                Toast.makeText((Context) this.a, (CharSequence) "There is some issue fetching data, Please try again", 0).show();
                return;
            }
            MyAuthorListResponse myAuthorListResponse = (MyAuthorListResponse) new GsonBuilder().create().fromJson(jSONObject.toString(), MyAuthorListResponse.class);
            if (myAuthorListResponse == null || myAuthorListResponse.getItems() == null || myAuthorListResponse.getItems().size() <= 0) {
                m.this.a.a.setVisibility(8);
                Toast.makeText((Context) this.a, (CharSequence) "There is some issue fetching data, Please try again", 0).show();
            } else {
                m.this.d = u4.h.i(myAuthorListResponse.getItems());
                m.this.a.b.a.setAdapter(new r4.a(this.a, m.this.d, m.this));
                m.this.P();
            }
        }

        public void onError(String str, String str2) {
            m.this.S();
            m.this.a.a.setVisibility(8);
            Toast.makeText((Context) this.a, (CharSequence) "There is some issue fetching data, Please try again", 0).show();
        }
    }

    class f extends ViewPager2.OnPageChangeCallback {
        final ArrayList a;

        f(ArrayList arrayList) {
            this.a = arrayList;
        }

        public void onPageScrollStateChanged(int i) {
            super.onPageScrollStateChanged(i);
        }

        public void onPageScrolled(int i, float f, int i2) {
            super.onPageScrolled(i, f, i2);
        }

        public void onPageSelected(int i) {
            super.onPageSelected(i);
            CustomPagerIndicator.setCustomIndicatorOrange(m.this.f, m.this.d.size(), i, this.a, m.this.a.b.b);
        }
    }

    class g implements k6.q {
        final AppCompatActivity a;
        final MintDataItem b;
        final String c;

        class a implements k6.i {
            a() {
            }

            public void getStoryData(JSONObject jSONObject) {
                if (jSONObject == null) {
                    m.this.S();
                    Toast.makeText((Context) g.this.a, (CharSequence) "There is some issue fetching data, Please try again", 0).show();
                    return;
                }
                m.this.b0();
                m.this.S();
                ArrayList<Content> t = u4.h.t(jSONObject);
                Log.e("onScrolled", "onScrolled: size" + t.size());
                if (t.size() > 0) {
                    m.this.q.L(t);
                    RecyclerView recyclerView = m.this.a.c.c;
                    AppCompatActivity appCompatActivity = g.this.a;
                    ObservableBoolean a = l.x.a();
                    g gVar = g.this;
                    recyclerView.setAdapter(new r5.l(appCompatActivity, t, a, "adapter_tab_my_Author", gVar.c, gVar.b));
                    return;
                }
                m.this.q.L(new ArrayList<>());
                RecyclerView recyclerView2 = m.this.a.c.c;
                AppCompatActivity appCompatActivity2 = g.this.a;
                ObservableBoolean a2 = l.x.a();
                g gVar2 = g.this;
                recyclerView2.setAdapter(new r5.l(appCompatActivity2, t, a2, "adapter_tab_my_Author", gVar2.c, gVar2.b));
            }

            public void onError(String str) {
                m.this.S();
                Toast.makeText((Context) g.this.a, (CharSequence) "There is some issue fetching data, Please try again", 0).show();
            }
        }

        g(AppCompatActivity appCompatActivity, MintDataItem mintDataItem, String str) {
            this.a = appCompatActivity;
            this.b = mintDataItem;
            this.c = str;
        }

        public void getAboutCompanyData(JSONObject jSONObject, String str) {
            m.this.h = false;
            if (jSONObject == null) {
                m.this.S();
                m.this.a.a.setVisibility(8);
                Toast.makeText((Context) this.a, (CharSequence) "There is some issue fetching data, Please try again", 0).show();
                return;
            }
            MyAuthorListResponse myAuthorListResponse = (MyAuthorListResponse) new GsonBuilder().create().fromJson(jSONObject.toString(), MyAuthorListResponse.class);
            if (myAuthorListResponse == null || myAuthorListResponse.getFollowCount().intValue() <= 0) {
                m.this.S();
                m.this.a.a.setVisibility(8);
                Toast.makeText((Context) this.a, (CharSequence) "There is some issue fetching data, Please try again", 0).show();
                return;
            }
            m.this.s = (int) Math.ceil((myAuthorListResponse.getFollowCount().intValue() * 1.0f) / 10.0f);
            m.this.j = myAuthorListResponse.getItems();
            m.this.q.M(m.this.j);
            m mVar = m.this;
            mVar.o = new s5.b(this.a, mVar.j, this.b, "My Authors", m.this);
            m.this.a.c.e.setAdapter(m.this.o);
            String str2 = ((f0.r0().getAuthor() == null || TextUtils.isEmpty(f0.r0().getAuthor().getMyAuthor())) ? "https://personalize.livemint.com/myauthor-lm" : f0.r0().getAuthor().getMyAuthor()) + "?htfpId=" + f0.I0(this.a) + "&propertyId=lm&section=all&numStories=" + m.this.t;
            Log.e("TAG", "getAboutCompanyData:::::: " + str2);
            k6.j jVar = new k6.j(this.a, new a());
            HashMap hashMap = new HashMap();
            if (f0.G1(this.a, "userName") != null) {
                hashMap.put("Authorization", com.htmedia.mint.utils.q.a);
            }
            jVar.a(0, "rfu_url", str2, (JSONObject) null, u4.h.j(this.a), false, false);
        }

        public void onError(String str, String str2) {
            m.this.S();
            m.this.a.a.setVisibility(8);
            Toast.makeText((Context) this.a, (CharSequence) "There is some issue fetching data, Please try again", 0).show();
            m.this.h = false;
        }
    }

    class h implements Runnable {
        h() {
        }

        @Override
        public void run() {
            m mVar = m.this;
            mVar.a0(mVar.f, m.this.g, "My Authors");
        }
    }

    public void O(AppCompatActivity appCompatActivity, MintDataItem mintDataItem) {
        qq0 qq0Var = this.a;
        if (qq0Var != null) {
            qq0Var.e(l.x.a());
            this.a.c.a.setOnClickListener(new b(appCompatActivity));
            this.q = v4.c.a.b();
            if (mintDataItem != null && mintDataItem.getTabMaxLimit() != null && mintDataItem.getTabMaxLimit().intValue() > 0) {
                this.t = mintDataItem.getTabMaxLimit().intValue();
            }
            Z();
            if (!v && this.q.H() != null && this.q.H().size() > 0 && this.q.w() != null && this.q.w().size() > 0) {
                X();
                return;
            }
            new k6.p(appCompatActivity, new c(mintDataItem, appCompatActivity), "").f(((f0.r0().getAuthor() == null || TextUtils.isEmpty(f0.r0().getAuthor().getList())) ? "https://personalize.livemint.com/author-list" : f0.r0().getAuthor().getList()) + "?followedRequested=1", appCompatActivity);
        }
    }

    public void P() {
        Log.e("test00", "onPageSelectedArraysize:11111 " + this.e.size());
        HashMap<String, ArrayList<Author>> hashMap = this.d;
        if (hashMap == null || hashMap.size() <= 0) {
            return;
        }
        this.a.b.b.removeAllViews();
        int size = this.d.size();
        ArrayList<View> arrayList = new ArrayList<>();
        this.e = arrayList;
        if (arrayList.size() <= 0) {
            for (int i = 0; i < size; i++) {
                View inflate = ((LayoutInflater) this.f.getSystemService("layout_inflater")).inflate(R.layout.item_custom_indicator, (ViewGroup) null);
                this.e.add(inflate.findViewById(R.id.indicatorView));
                this.a.b.b.addView(inflate);
            }
        }
        CustomPagerIndicator.setCustomIndicatorOrange(this.f, this.d.size(), 0, this.e, this.a.b.b);
        Log.e("test00", "onPageSelectedArraysize:11111 " + this.e.size());
        this.a.b.a.registerOnPageChangeCallback(new f(this.e));
    }

    private String Q() {
        ArrayList<Author> arrayList = this.r;
        String str = "";
        if (arrayList != null && !arrayList.isEmpty()) {
            for (int i = 0; i < this.r.size(); i++) {
                str = i == 0 ? this.r.get(i).getName() : str + "," + this.r.get(i).getName();
            }
        }
        return str;
    }

    public void R(AppCompatActivity appCompatActivity) {
        u4.i.a.a(appCompatActivity.getSupportFragmentManager(), appCompatActivity);
    }

    public static m T(String str, String str2, MintDataItem mintDataItem) {
        Bundle bundle = new Bundle();
        bundle.putString("tab_name", str);
        bundle.putString("tab_url", str2);
        m mVar = new m();
        mVar.g = mintDataItem;
        mVar.setArguments(bundle);
        return mVar;
    }

    public void U(Context context, String str) {
        String s0 = com.htmedia.mint.utils.n.s0(Q(), 100);
        String str2 = "/mymint/" + h0.f(str) + "/my_author";
        t5.a.a.i(context, com.htmedia.mint.utils.n.Z1, str2, str2, "my author", "done", "my mint", s0);
    }

    public void V(AppCompatActivity appCompatActivity, String str, String str2) {
        String str3 = "/mymint/" + h0.f(str) + "/my_author";
        t5.a.a.h(appCompatActivity, com.htmedia.mint.utils.n.c2, str3, str3, null, "my author", str2, "my mint");
    }

    public void W(MintDataItem mintDataItem, AppCompatActivity appCompatActivity) {
        if (this.r == null) {
            this.r = new ArrayList<>();
        }
        this.a.b.e.setOnClickListener(new d(appCompatActivity));
        qq0 qq0Var = this.a;
        l.a aVar = l.x;
        qq0Var.e(aVar.a());
        this.a.b.c(Boolean.valueOf(aVar.a().get()));
        new k6.p(appCompatActivity, new e(appCompatActivity), "").f((f0.r0().getAuthor() == null || TextUtils.isEmpty(f0.r0().getAuthor().getAuthorRecommendation())) ? "https://personalize.livemint.com/author-recommendation" : f0.r0().getAuthor().getAuthorRecommendation(), appCompatActivity);
        Log.e("test00", "onPageSelectedArraysize:a444444" + this.e.size());
    }

    private void X() {
        S();
        b0();
        ArrayList<Author> H = this.q.H();
        this.j = H;
        this.a.c.e.setAdapter(new s5.b(this.f, H, this.g, "My Authors", this));
        this.a.c.c.setAdapter(new r5.l(this.f, this.q.w(), l.x.a(), "adapter_tab_my_Author", "My Authors", this.g));
        this.g.setCollection(true);
    }

    public void a0(AppCompatActivity appCompatActivity, MintDataItem mintDataItem, String str) {
        v = false;
        this.a.c.c(l.x.a());
        this.p = new k6.p(appCompatActivity, new g(appCompatActivity, mintDataItem, str), "");
        String list = (f0.r0().getAuthor() == null || TextUtils.isEmpty(f0.r0().getAuthor().getList())) ? "https://personalize.livemint.com/author-list" : f0.r0().getAuthor().getList();
        this.p.f(list + "?followedRequested=1", appCompatActivity);
    }

    void S() {
        if (this.a.g.isRefreshing()) {
            this.a.g.setRefreshing(false);
        }
        this.a.e.setVisibility(8);
    }

    void Y() {
        this.a.b.c.setVisibility(0);
        this.a.f.setVisibility(0);
        this.a.f.setText("Follow Mint's top authors this week for \n sharp insights! ");
        this.a.c.d.setVisibility(8);
    }

    void Z() {
        this.a.e.setVisibility(0);
        this.a.b.c.setVisibility(8);
        this.a.f.setVisibility(8);
        this.a.c.d.setVisibility(8);
    }

    void b0() {
        this.a.b.c.setVisibility(8);
        this.a.f.setVisibility(0);
        this.a.f.setText("News tailored to your preferred authors");
        this.a.c.d.setVisibility(0);
        this.a.c.g.setVisibility(8);
    }

    @Override
    public void g(Author author) {
        if (author != null) {
            u4.i.a.b(this.f.getSupportFragmentManager(), author, false);
            V(this.f, this.u, author.getName());
        }
    }

    @Override
    public void l(Author author, boolean z) {
        if (author != null) {
            if (z) {
                this.r.add(author);
            } else {
                this.r.remove(author);
            }
        }
        ArrayList<Author> arrayList = this.r;
        if (arrayList == null || arrayList.size() <= 0) {
            this.a.b.e.setBackground(this.f.getResources().getDrawable(R.drawable.bg_rounded_rect_grey_all_radius));
        } else {
            this.a.b.e.setBackground(this.f.getResources().getDrawable(R.drawable.bg_rounded_rect_orange_all_radius));
        }
    }

    @Override
    public void n(int i, @Nullable Boolean bool) {
        if (bool == null || !bool.booleanValue()) {
            return;
        }
        new Handler().postDelayed(new h(), 1000L);
    }

    public void onActivityCreated(@Nullable Bundle bundle) {
        super.onActivityCreated(bundle);
        this.f = getActivity();
        this.a.g.setOnRefreshListener(new a());
    }

    public void onCreate(@Nullable Bundle bundle) {
        super.onCreate(bundle);
    }

    @Nullable
    public View onCreateView(@NonNull LayoutInflater layoutInflater, @Nullable ViewGroup viewGroup, @Nullable Bundle bundle) {
        qq0 c2 = qq0.c(layoutInflater, viewGroup, false);
        this.a = c2;
        c2.e(l.x.a());
        this.c = getArguments().getString("tab_url", "");
        this.u = getArguments().getString("tab_name", "");
        return this.a.getRoot();
    }

    public void onResume() {
        super.onResume();
        O(this.f, this.g);
    }
}