导航菜单

页面标题

页面副标题

Mint v5.7.3 - c.java 源代码

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

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


package s4;

import android.os.Bundle;
import android.text.TextPaint;
import android.text.TextUtils;
import android.text.style.ClickableSpan;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.google.gson.Gson;
import com.htmedia.mint.AppController;
import com.htmedia.mint.R;
import com.htmedia.mint.author.pojo.Author;
import com.htmedia.mint.author.pojo.AuthorDetailPojo;
import com.htmedia.mint.author.pojo.Items;
import com.htmedia.mint.author.pojo.Trending_story;
import com.htmedia.mint.marketRevamp.analytics.StockDetailsTrackingHelper;
import com.htmedia.mint.pojo.Content;
import com.htmedia.mint.pojo.ForyouPojo;
import com.htmedia.mint.pojo.Image;
import com.htmedia.mint.pojo.Images;
import com.htmedia.mint.pojo.LeadMedia;
import com.htmedia.mint.pojo.Metadata;
import com.htmedia.mint.pojo.config.Section;
import com.htmedia.mint.ui.activity.HomeActivity;
import com.htmedia.mint.ui.fragments.HomeFragment;
import com.htmedia.mint.utils.f0;
import com.htmedia.mint.utils.o1;
import com.htmedia.mint.utils.t0;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import k6.g0;
import k6.h0;
import k6.u0;
import k6.x0;
import org.json.JSONObject;
import p4.a;
import q7.k7;
import q7.q4;
import x4.ee;

public class c extends Fragment implements u0, h0, v4.d, u4.c {
    public static boolean q;
    private ee a;
    private long c;
    private v4.b d;
    private long g;
    private AuthorDetailPojo h;
    private final String e = "";
    private final boolean f = true;
    private ArrayList<Content> i = new ArrayList<>();
    private ArrayList<Content> j = new ArrayList<>();
    private boolean o = false;
    private boolean p = false;

    class a implements a.b {
        final AuthorDetailPojo a;

        class C0079a extends ClickableSpan {
            C0079a() {
            }

            @Override
            public void onClick(View view) {
                t0.a(c.this.getActivity(), "https://www.livemint.com/mymint");
            }

            @Override
            public void updateDrawState(TextPaint textPaint) {
                super.updateDrawState(textPaint);
                textPaint.setColor(textPaint.linkColor);
                textPaint.setUnderlineText(true);
            }
        }

        a(AuthorDetailPojo authorDetailPojo) {
            this.a = authorDetailPojo;
        }

        @Override
        public void n(int i, @Nullable Boolean bool) {
            if (bool != null && bool.booleanValue()) {
                this.a.getItems().setFollowed(!this.a.getItems().isFollowed());
                if (this.a.getItems().isFollowed()) {
                    c.this.C("author_detail_page", "author_detail_page", "", "following", "author_detail_page", "");
                    new C0079a();
                    String str = "You've just started following " + this.a.getName() + ". Check out their articles in <u>My mint</u> now!";
                    if (c.this.getActivity() != null && (c.this.getActivity() instanceof HomeActivity)) {
                        c.this.getActivity().n4(str);
                    }
                } else {
                    c.this.C("author_detail_page", "author_detail_page", "", "follow", "author_detail_page", "");
                }
                if (c.this.a.c.getAdapter() != null) {
                    c.this.a.c.getAdapter().notifyItemChanged(0);
                }
            }
            u4.j.a.a();
        }
    }

    private Content A() {
        Content content = new Content();
        content.setType(j5.b.NO_DATA_AUTHOR_STORY.a());
        return content;
    }

    public void B(int i, Content content, RecyclerView.Adapter adapter, Section section, ArrayList<Content> arrayList) {
        setOnNewsItemClick(i, content, adapter, section, arrayList, "trending");
    }

    public void C(String str, String str2, String str3, String str4, String str5, String str6) {
        u4.b.a.f(getActivity(), com.htmedia.mint.utils.n.Z1, str, str2, null, str3, str4, str5, str6);
    }

    private void D(String str, String str2, Content content, String str3, String str4, String str5, String str6) {
        u4.b.a.f(getActivity(), com.htmedia.mint.utils.n.c2, str, str2, content, str3, str4, str5, str6);
    }

    private void E(String str, String str2) {
        u4.b.a.h(getActivity(), com.htmedia.mint.utils.n.U0, str2, str, AppController.L, new String[0]);
    }

    private void F() {
        ee eeVar = this.a;
        if (eeVar != null) {
            eeVar.a.a.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    c.this.z(view);
                }
            });
        }
    }

    private void G(AuthorDetailPojo authorDetailPojo) {
        Content content = new Content();
        content.setAuthorDetailPojo(authorDetailPojo);
        content.setType(j5.b.AUTHOR_TOP_HEADER.a());
        if (authorDetailPojo != null && authorDetailPojo.getItems() != null && authorDetailPojo.getItems().getTrending_stories() != null) {
            this.i = u(authorDetailPojo.getItems().getTrending_stories());
        }
        if (this.i == null) {
            this.i = new ArrayList<>();
        }
        ArrayList<Content> arrayList = this.i;
        if (arrayList != null && arrayList.isEmpty()) {
            this.i.add(A());
        }
        this.i.add(0, content);
        I(this.i);
    }

    private void H(ArrayList<Content> arrayList) {
        Content content = new Content();
        content.setAuthorDetailPojo(this.h);
        content.setType(j5.b.AUTHOR_TOP_HEADER.a());
        if (arrayList == null) {
            arrayList = new ArrayList<>();
            arrayList.add(A());
        }
        arrayList.add(0, content);
        I(arrayList);
    }

    private void I(ArrayList<Content> arrayList) {
        if (this.a.c.getAdapter() != null) {
            q4 adapter = this.a.c.getAdapter();
            adapter.x(arrayList);
            adapter.notifyDataSetChanged();
        } else {
            q4 q4Var = new q4(getActivity(), getActivity(), arrayList, new q4.i() {
                public final void onListItemClick(int i, Content content, RecyclerView.Adapter adapter2, Section section, ArrayList arrayList2) {
                    c.this.B(i, content, adapter2, section, arrayList2);
                }
            }, (Section) null, (List) null, (k7.b) null, false, this.o);
            q4Var.v(this);
            this.a.c.setLayoutManager(new LinearLayoutManager(getActivity()));
            this.a.c.setAdapter(q4Var);
        }
    }

    private void J() {
        ee eeVar = this.a;
        if (eeVar != null) {
            eeVar.c.setVisibility(8);
            this.a.a.c.setVisibility(0);
        }
    }

    private void setIsRemoveTimestamp(ForyouPojo foryouPojo) {
        if (this.p || foryouPojo == null || foryouPojo.getMetadata() == null) {
            return;
        }
        this.o = foryouPojo.getMetadata().isRemoveTimestamp();
        this.p = true;
    }

    private void setOnNewsItemClick(int i, Content content, RecyclerView.Adapter<?> adapter, Section section, ArrayList<Content> arrayList, String str) {
        String headline;
        if (content != null) {
            try {
                if (!TextUtils.isEmpty(content.getHeadline())) {
                    headline = content.getHeadline();
                    D("author_detail_page", "author_detail_page", content, str, com.htmedia.mint.utils.n.s0(headline, 100), "author_detail_page", "");
                    if (getActivity() == null && (getActivity() instanceof AppCompatActivity)) {
                        g7.a.u(getActivity(), (Bundle) null, content, arrayList);
                        return;
                    }
                }
            } catch (Exception e) {
                e.printStackTrace();
                return;
            }
        }
        headline = !TextUtils.isEmpty(content.getMobileHeadline()) ? content.getMobileHeadline() : "";
        D("author_detail_page", "author_detail_page", content, str, com.htmedia.mint.utils.n.s0(headline, 100), "author_detail_page", "");
        if (getActivity() == null) {
        }
    }

    private ArrayList<Content> u(List<Trending_story> list) {
        ArrayList<Content> arrayList = new ArrayList<>();
        int authorDetailTrendingSize = f0.r0().getAuthor().getAuthorDetailTrendingSize();
        if (authorDetailTrendingSize <= 0 || authorDetailTrendingSize >= list.size()) {
            authorDetailTrendingSize = list.size();
        }
        for (int i = 0; i < authorDetailTrendingSize; i++) {
            Trending_story trending_story = list.get(i);
            Content content = new Content();
            LeadMedia leadMedia = new LeadMedia();
            if (trending_story.getImageObject() != null) {
                Image image = new Image();
                Images images = new Images();
                images.setBigImage(trending_story.getImageObject().getBigImage());
                images.setMediumImage(trending_story.getImageObject().getMediumImage());
                images.setFullImage(trending_story.getImageObject().getFullImage());
                images.setThumbnailImage(trending_story.getImageObject().getThumbnailImage());
                image.setImages(images);
                leadMedia.setImage(image);
                content.setLeadMedia(leadMedia);
            }
            content.setId(trending_story.getStoryId());
            content.setMobileHeadline(trending_story.getHeadline());
            content.setHeadline(trending_story.getHeadline());
            content.setTimeToRead(trending_story.getTimeToRead());
            content.setLastPublishedDate(trending_story.getPublishDate().replace(" ", "T"));
            content.setType(j5.b.STORY.a());
            Metadata metadata = new Metadata();
            metadata.setSection(trending_story.getSectionName());
            metadata.setSubSection("");
            metadata.setUrl(trending_story.getStoryURL());
            metadata.setPremiumStory(trending_story.isPremiumStory());
            metadata.setAgency("");
            Boolean bool = Boolean.FALSE;
            metadata.setSponsored(bool);
            metadata.setBreakingNews(bool);
            metadata.setBigStory(bool);
            metadata.setColumn("");
            metadata.setGenericOpenStory(Boolean.parseBoolean(trending_story.getGenericOpenStory()));
            content.setMetadata(metadata);
            arrayList.add(content);
        }
        return arrayList;
    }

    private void w(Section section, String str) {
        if (y()) {
            I(this.j);
            return;
        }
        if (TextUtils.isEmpty(str)) {
            H(this.j);
            return;
        }
        String str2 = f0.r0().getServerUrl() + section.getUrl();
        String replaceAll = str.trim().replaceAll(" ", "%20");
        o1.a("Tag URL", String.format(str2, replaceAll));
        new g0(getActivity(), this).f(0, "LATEST", String.format(str2, replaceAll), (JSONObject) null, (HashMap) null, false, true);
    }

    private void x() {
        ee eeVar = this.a;
        if (eeVar != null) {
            eeVar.c.setVisibility(0);
            this.a.a.c.setVisibility(8);
        }
    }

    private boolean y() {
        ArrayList<Content> arrayList = this.j;
        if (arrayList == null || arrayList.isEmpty()) {
            return false;
        }
        Iterator<Content> it = this.j.iterator();
        while (it.hasNext()) {
            Content next = it.next();
            if (next != null && j5.b.STORY.a().equalsIgnoreCase(next.getType())) {
                return true;
            }
        }
        return false;
    }

    public void z(View view) {
        v();
    }

    @Override
    public void e(AuthorDetailPojo authorDetailPojo) {
        if (TextUtils.isEmpty(authorDetailPojo.getItems().getName())) {
            return;
        }
        C("author_detail_page", "author_detail_page", "", StockDetailsTrackingHelper.STOCK_DETAIL_VIEW_ALL, "author_detail_page", "");
        getActivity().i0.a.x.setVisibility(8);
        FragmentManager supportFragmentManager = getActivity().getSupportFragmentManager();
        HomeFragment homeFragment = new HomeFragment();
        Bundle bundle = new Bundle();
        bundle.putString("author_name", authorDetailPojo.getItems().getName());
        bundle.putBoolean("remove_bottom_ad_spot", true);
        bundle.putParcelable("top_section_section", f0.l0(AppController.j().g(), authorDetailPojo.getItems().getName()));
        homeFragment.setArguments(bundle);
        supportFragmentManager.beginTransaction().add(R.id.layoutFragmentContainer, homeFragment, "Tag_Section").addToBackStack("Tag_Section").commit();
    }

    @Override
    public void f(AuthorDetailPojo authorDetailPojo) {
        if (TextUtils.isEmpty(authorDetailPojo.getItems().getName()) || TextUtils.isEmpty(authorDetailPojo.getItems().getAuthor_id())) {
            return;
        }
        boolean isFollowed = authorDetailPojo.getItems().isFollowed();
        ArrayList<Author> arrayList = new ArrayList<>();
        arrayList.add(new Author(Long.valueOf(Long.parseLong(authorDetailPojo.getItems().getAuthor_id())), authorDetailPojo.getItems().getName(), "", Boolean.valueOf(authorDetailPojo.getItems().isFollowed()), new ArrayList(), "", authorDetailPojo.getItems().getPictureUrl(), Integer.valueOf(authorDetailPojo.getItems().getStoryCount()), authorDetailPojo.getItems().getEmailId(), authorDetailPojo.getItems().getBio(), authorDetailPojo.getItems().getSpecialization_sections(), Boolean.valueOf(!isFollowed)));
        if (getActivity() != null) {
            u4.j.a.b(getActivity());
        }
        if (this.d != null) {
            this.d.O(u4.h.j(getActivity()), arrayList, new a(authorDetailPojo), 0, "", false);
        }
    }

    public void getResponse(JSONObject jSONObject, String str) {
        AuthorDetailPojo authorDetailPojo = (AuthorDetailPojo) new Gson().fromJson(jSONObject.toString(), AuthorDetailPojo.class);
        this.h = authorDetailPojo;
        if (authorDetailPojo == null || authorDetailPojo.getItems() == null) {
            J();
        } else {
            x();
            G(this.h);
        }
    }

    public void getStoryData(ForyouPojo foryouPojo, String str) {
        if (foryouPojo != null) {
            setIsRemoveTimestamp(foryouPojo);
            List contentList = foryouPojo.getContentList();
            if (contentList == null || contentList.size() <= 0) {
                H(this.j);
                return;
            }
            ArrayList<Content> arrayList = (ArrayList) contentList;
            this.j = arrayList;
            H(arrayList);
        }
    }

    @Override
    public void i(AuthorDetailPojo authorDetailPojo) {
        I(this.i);
    }

    @Nullable
    public View onCreateView(@NonNull LayoutInflater layoutInflater, @Nullable ViewGroup viewGroup, @Nullable Bundle bundle) {
        ee eeVar = (ee) DataBindingUtil.inflate(layoutInflater, R.layout.fragment_author_detail, viewGroup, false);
        this.a = eeVar;
        q = false;
        return eeVar.getRoot();
    }

    public void onError(String str) {
        J();
    }

    public void onError(String str, String str2) {
    }

    public void onResume() {
        super.onResume();
        if (getActivity().i0.a.q != null) {
            getActivity().i0.a.q.setExpanded(true, true);
        }
        if (getTag() == null || !getTag().equalsIgnoreCase("AUTHOR_DEATIL_FRAGMENT_TAG")) {
            return;
        }
        getActivity().f4(false, "");
    }

    public void onViewCreated(@NonNull View view, @Nullable Bundle bundle) {
        super.onViewCreated(view, bundle);
        if (getArguments() != null) {
            Bundle arguments = getArguments();
            this.c = arguments.getLong(u4.a.a.c());
            q = arguments.getBoolean("is_bio_expanded", false);
        }
        this.d = v4.c.a.b();
        this.a.c(Boolean.valueOf(f0.Z1()));
        setHasOptionsMenu(true);
        E("author_detail_page", "author_detail_page");
        v();
        F();
    }

    @Override
    public void p(Section section, AuthorDetailPojo authorDetailPojo) {
        if (TextUtils.isEmpty(authorDetailPojo.getItems().getName())) {
            return;
        }
        w(section, authorDetailPojo.getItems().getName());
    }

    @Override
    public void updateYourData() {
        ArrayList o;
        Content content;
        Map map = (Map) this.d.t().getValue();
        ee eeVar = this.a;
        if (eeVar != null) {
            q4 q4Var = eeVar.c.getAdapter() != null ? (q4) this.a.c.getAdapter() : null;
            if (q4Var == null || (o = q4Var.o()) == null || o.isEmpty() || (content = (Content) q4Var.o().get(0)) == null || content.getAuthorDetailPojo() == null || content.getAuthorDetailPojo().getItems() == null) {
                return;
            }
            Items items = content.getAuthorDetailPojo().getItems();
            String author_id = items.getAuthor_id();
            if (!TextUtils.isEmpty(author_id) && f0.X1(author_id.trim())) {
                try {
                    this.g = Long.parseLong(author_id);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            if (map == null || !map.containsKey(Long.valueOf(this.g))) {
                return;
            }
            items.setFollowed(((Boolean) map.get(Long.valueOf(this.g))).booleanValue());
            q4Var.notifyItemChanged(0);
        }
    }

    public void v() {
        String str = f0.r0().getAuthor().getProfile() + "?authorId=" + this.c + "&trendingStoriesRequested=true";
        new x0(getActivity(), this).a(0, str, str, (JSONObject) null, u4.h.j(getActivity()), false, true);
    }
}