导航菜单

页面标题

页面副标题

Mint v5.7.3 - m.java 源代码

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

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


package e8;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import androidx.databinding.DataBindingUtil;
import com.github.mikephil.charting.components.Legend;
import com.github.mikephil.charting.components.XAxis;
import com.github.mikephil.charting.data.Entry;
import com.github.mikephil.charting.data.LineData;
import com.github.mikephil.charting.data.LineDataSet;
import com.github.mikephil.charting.formatter.IndexAxisValueFormatter;
import com.github.mikephil.charting.utils.ColorTemplate;
import com.google.gson.Gson;
import com.htmedia.mint.AppController;
import com.htmedia.mint.pojo.companydetailnew.AboutCompanyPojo;
import com.htmedia.mint.pojo.companydetailnew.ChartDataPojo;
import com.htmedia.mint.pojo.companydetailnew.PeerCompanyNew;
import com.htmedia.mint.pojo.companydetailnew.Value;
import com.htmedia.mint.utils.f0;
import com.htmedia.mint.utils.o1;
import com.thoughtbot.expandablerecyclerview.BuildConfig;
import java.util.ArrayList;
import java.util.HashMap;
import org.json.JSONArray;
import org.json.JSONObject;
import x4.ij0;
import x4.mj0;

public class m implements k6.q {
    private final LinearLayout b;
    private final AppCompatActivity c;
    private k6.p d;
    private final Context e;
    private String f;
    private String g;
    private mj0 h;
    AboutCompanyPojo i;
    String j;
    ArrayList<ChartDataPojo> o;
    HashMap<String, String> p;
    private final String a = "Peer";
    private int q = 4;
    private final int[] r = {ColorTemplate.rgb("#FF0000"), ColorTemplate.rgb("#FF8C19"), ColorTemplate.rgb("#55FF00"), ColorTemplate.rgb("#0055FF"), ColorTemplate.rgb("#FF00FF"), ColorTemplate.rgb("#FFFF33")};

    public m(LinearLayout linearLayout, AppCompatActivity appCompatActivity, Context context, String str, String str2) {
        this.f = BuildConfig.FLAVOR;
        this.g = BuildConfig.FLAVOR;
        this.b = linearLayout;
        this.c = appCompatActivity;
        this.e = context;
        this.f = str;
        this.g = str2;
    }

    public void e(View view) {
        this.h.e.setVisibility(8);
        this.h.c.setVisibility(0);
        j(this.h.g);
        n(this.h.h);
    }

    public void f(View view) {
        this.h.e.setVisibility(0);
        this.h.c.setVisibility(8);
        n(this.h.g);
        j(this.h.h);
    }

    private void g(ArrayList<ChartDataPojo> arrayList) {
        if (arrayList != null) {
            try {
                if (arrayList.size() != 0) {
                    if (arrayList.size() > 0) {
                        ArrayList arrayList2 = new ArrayList();
                        for (int i = 0; i < arrayList.size(); i++) {
                            ChartDataPojo chartDataPojo = arrayList.get(i);
                            ArrayList arrayList3 = new ArrayList();
                            ArrayList arrayList4 = new ArrayList();
                            ArrayList<Value> values = chartDataPojo.getResult().get(0).getValues();
                            int i2 = 0;
                            while (i2 < values.size()) {
                                Value value = values.get(i2);
                                int i3 = i2 + 1;
                                arrayList3.add(new Entry(i3, (float) value.getClose(), value));
                                try {
                                    if (value.getTimeStamp() == null || value.getTimeStamp().equalsIgnoreCase(BuildConfig.FLAVOR)) {
                                        arrayList4.add("\n");
                                    } else {
                                        arrayList4.add(BuildConfig.FLAVOR + f0.F0(value.getTimeStamp(), "yyyy-MM-dd HH:mm:ss", "yyyy") + "\n");
                                    }
                                } catch (Exception e) {
                                    e.printStackTrace();
                                    arrayList4.add(BuildConfig.FLAVOR);
                                }
                                i2 = i3;
                            }
                            o1.a("TAG value", arrayList4.size() + " ");
                            String str = this.p.get(chartDataPojo.getResult().get(0).getTickerId());
                            if (str != null) {
                                LineDataSet lineDataSet = new LineDataSet(arrayList3, str);
                                lineDataSet.setDrawIcons(false);
                                lineDataSet.setLineWidth(1.0f);
                                lineDataSet.disableDashedLine();
                                lineDataSet.setDrawCircles(false);
                                lineDataSet.setValueTextSize(0.0f);
                                lineDataSet.setDrawFilled(false);
                                lineDataSet.setFormLineWidth(1.0f);
                                lineDataSet.setDrawValues(true);
                                lineDataSet.setFormSize(15.0f);
                                lineDataSet.setDrawVerticalHighlightIndicator(false);
                                lineDataSet.setDrawHorizontalHighlightIndicator(false);
                                lineDataSet.setDrawCircleHole(false);
                                int[] iArr = this.r;
                                int i4 = iArr[i % iArr.length];
                                lineDataSet.setColor(i4);
                                lineDataSet.setCircleColor(i4);
                                arrayList2.add(lineDataSet);
                            }
                            this.h.a.getXAxis().setValueFormatter(new IndexAxisValueFormatter(arrayList4));
                        }
                        LineData lineData = new LineData(arrayList2);
                        this.h.a.getAxisRight().setEnabled(false);
                        float dimensionPixelSize = (int) (this.e.getResources().getDimensionPixelSize(2131166334) / this.e.getResources().getDisplayMetrics().scaledDensity);
                        this.h.a.getXAxis().setTextSize(dimensionPixelSize);
                        this.h.a.getAxisLeft().setTextSize(dimensionPixelSize);
                        this.h.a.getXAxis().setGranularityEnabled(true);
                        this.h.a.getLegend().setEnabled(true);
                        this.h.a.getXAxis().setGranularity(1.0f);
                        this.h.a.getXAxis().setLabelCount(5);
                        this.h.a.setExtraOffsets(0.0f, 0.0f, 0.0f, 30.0f);
                        this.h.a.getLegend().setForm(Legend.LegendForm.CIRCLE);
                        this.h.a.getLegend().setTextSize(11.0f);
                        this.h.a.getXAxis().setPosition(XAxis.XAxisPosition.BOTTOM);
                        this.h.a.getAxisLeft().setDrawAxisLine(false);
                        this.h.a.getAxisLeft().setDrawAxisLine(false);
                        this.h.a.setScaleEnabled(false);
                        this.h.a.getLegend().setWordWrapEnabled(true);
                        if (AppController.j().E()) {
                            this.h.a.getAxisLeft().setTextColor(ContextCompat.getColor(this.e, 2131100599));
                            this.h.a.getXAxis().setTextColor(ContextCompat.getColor(this.e, 2131100599));
                            this.h.a.getLegend().setTextColor(ContextCompat.getColor(this.e, 2131100599));
                        } else {
                            this.h.a.getAxisLeft().setTextColor(ContextCompat.getColor(this.e, 2131101012));
                            this.h.a.getXAxis().setTextColor(ContextCompat.getColor(this.e, 2131101012));
                            this.h.a.getLegend().setTextColor(ContextCompat.getColor(this.e, 2131100353));
                        }
                        this.h.a.setData(lineData);
                        this.h.a.invalidate();
                        return;
                    }
                    return;
                }
            } catch (Exception e2) {
                e2.printStackTrace();
                return;
            }
        }
        this.h.a.clear();
        this.h.a.setNoDataText("No data available");
        this.h.a.invalidate();
    }

    private void h() {
        if (this.i.getPeerCompanyList() == null || this.i.getPeerCompanyList().size() <= 0) {
            return;
        }
        this.h.d.removeAllViews();
        LayoutInflater from = LayoutInflater.from(this.e);
        ij0 inflate = DataBindingUtil.inflate(from, 2131625122, this.h.d, false);
        inflate.h.setText("Name");
        inflate.g.setText("Latest Price");
        inflate.d.setText("Change");
        inflate.e.setText("%Change");
        inflate.b.setText("52 week High");
        inflate.c.setText("52 week Low");
        inflate.f.setText("Mkt. Cap");
        this.h.d.addView(inflate.getRoot());
        inflate.c(AppController.j().E());
        if (AppController.j().E()) {
            inflate.getRoot().setBackgroundColor(ContextCompat.getColor(this.e, 2131100187));
            inflate.g.setTextColor(ContextCompat.getColor(this.e, 2131100599));
            inflate.d.setTextColor(ContextCompat.getColor(this.e, 2131100599));
            inflate.e.setTextColor(ContextCompat.getColor(this.e, 2131100599));
        } else {
            inflate.getRoot().setBackgroundColor(ContextCompat.getColor(this.e, 2131100951));
            inflate.g.setTextColor(ContextCompat.getColor(this.e, 2131099901));
            inflate.d.setTextColor(ContextCompat.getColor(this.e, 2131099901));
            inflate.e.setTextColor(ContextCompat.getColor(this.e, 2131099901));
        }
        this.q = this.i.getPeerCompanyList().size();
        int i = 1;
        for (PeerCompanyNew peerCompanyNew : this.i.getPeerCompanyList()) {
            if (peerCompanyNew != null) {
                c(peerCompanyNew.getTickerId(), peerCompanyNew.getCompanyName());
                ij0 inflate2 = DataBindingUtil.inflate(from, 2131625122, this.h.d, false);
                inflate2.h.setText(peerCompanyNew.getCompanyName());
                k(peerCompanyNew.getPrice() + BuildConfig.FLAVOR, inflate2.g);
                k(peerCompanyNew.getNetChange() + BuildConfig.FLAVOR, inflate2.d);
                l(peerCompanyNew.getPercentChange() + BuildConfig.FLAVOR, inflate2.e);
                inflate2.b.setText(peerCompanyNew.getYhigh() + BuildConfig.FLAVOR);
                inflate2.c.setText(peerCompanyNew.getYlow() + BuildConfig.FLAVOR);
                inflate2.f.setText(f0.H0(String.valueOf(peerCompanyNew.getMarketCap())));
                if (i % 2 == 0) {
                    if (AppController.j().E()) {
                        inflate2.getRoot().setBackgroundColor(ContextCompat.getColor(this.e, 2131100187));
                    } else {
                        inflate2.getRoot().setBackgroundColor(ContextCompat.getColor(this.e, 2131100951));
                    }
                } else if (AppController.j().E()) {
                    inflate2.getRoot().setBackgroundColor(ContextCompat.getColor(this.e, 2131101012));
                } else {
                    inflate2.getRoot().setBackgroundColor(ContextCompat.getColor(this.e, 2131101002));
                }
                i++;
                inflate2.c(AppController.j().E());
                this.h.d.addView(inflate2.getRoot());
            }
        }
    }

    private void i() {
        if (this.i.getPeerCompanyList() == null || this.i.getPeerCompanyList().size() <= 0) {
            return;
        }
        this.h.e.removeAllViews();
        LayoutInflater from = LayoutInflater.from(this.e);
        ij0 inflate = DataBindingUtil.inflate(from, 2131625122, this.h.e, false);
        inflate.h.setText("Name");
        inflate.g.setText("P/E(X)");
        inflate.d.setText("P/B(X)");
        inflate.e.setText("Dividend");
        inflate.b.setText("ROE%");
        inflate.c.setText("Margin%");
        inflate.f.setText("D/E");
        if (AppController.j().E()) {
            inflate.getRoot().setBackgroundColor(ContextCompat.getColor(this.e, 2131100187));
            inflate.g.setTextColor(ContextCompat.getColor(this.e, 2131100599));
            inflate.d.setTextColor(ContextCompat.getColor(this.e, 2131100599));
            inflate.e.setTextColor(ContextCompat.getColor(this.e, 2131100599));
        } else {
            inflate.getRoot().setBackgroundColor(ContextCompat.getColor(this.e, 2131100951));
            inflate.g.setTextColor(ContextCompat.getColor(this.e, 2131099901));
            inflate.d.setTextColor(ContextCompat.getColor(this.e, 2131099901));
            inflate.e.setTextColor(ContextCompat.getColor(this.e, 2131099901));
        }
        inflate.c(AppController.j().E());
        this.h.e.addView(inflate.getRoot());
        int i = 1;
        for (PeerCompanyNew peerCompanyNew : this.i.getPeerCompanyList()) {
            if (peerCompanyNew != null) {
                ij0 inflate2 = DataBindingUtil.inflate(from, 2131625122, this.h.e, false);
                inflate2.h.setText(peerCompanyNew.getCompanyName());
                m(peerCompanyNew.getPriceToEarningsValueRatio(), inflate2.g);
                m(peerCompanyNew.getPriceToBookValueRatio(), inflate2.d);
                m(peerCompanyNew.getDividendYieldIndicatedAnnualDividend(), inflate2.e);
                m(peerCompanyNew.getReturnOnAverageEquity5YearAverage(), inflate2.b);
                m(peerCompanyNew.getNetProfitMargin5YearAverage(), inflate2.c);
                m(peerCompanyNew.getLtDebtPerEquityMostRecentFiscalYear(), inflate2.f);
                if (i % 2 == 0) {
                    if (AppController.j().E()) {
                        inflate2.getRoot().setBackgroundColor(ContextCompat.getColor(this.e, 2131100187));
                    } else {
                        inflate2.getRoot().setBackgroundColor(ContextCompat.getColor(this.e, 2131100951));
                    }
                } else if (AppController.j().E()) {
                    inflate2.getRoot().setBackgroundColor(ContextCompat.getColor(this.e, 2131101012));
                } else {
                    inflate2.getRoot().setBackgroundColor(ContextCompat.getColor(this.e, 2131101002));
                }
                i++;
                inflate2.c(AppController.j().E());
                this.h.e.addView(inflate2.getRoot());
            }
        }
    }

    private void j(TextView textView) {
        textView.setBackground(ContextCompat.getDrawable(this.e, 2131231473));
        textView.setTextColor(ContextCompat.getColor(this.e, 2131100663));
    }

    private void k(String str, TextView textView) {
        if (str.contains("-")) {
            textView.setTextColor(this.e.getResources().getColor(2131100766));
        } else {
            textView.setTextColor(this.e.getResources().getColor(2131100223));
        }
        textView.setText(str);
    }

    private void l(String str, TextView textView) {
        if (str.contains("-")) {
            textView.setTextColor(this.e.getResources().getColor(2131100766));
        } else {
            textView.setTextColor(this.e.getResources().getColor(2131100223));
        }
        textView.setText(str + "%");
    }

    private void m(double d, TextView textView) {
        if (AppController.j().E()) {
            textView.setTextColor(this.e.getResources().getColor(2131100599));
        } else {
            textView.setTextColor(this.e.getResources().getColor(2131099901));
        }
        if (d == -99999.99d) {
            textView.setText("-");
        } else {
            textView.setText(f0.H0(String.valueOf(d)));
        }
    }

    private void n(TextView textView) {
        textView.setBackgroundColor(0);
        if (AppController.j().E()) {
            textView.setTextColor(ContextCompat.getColor(this.e, 2131100906));
        } else {
            textView.setTextColor(ContextCompat.getColor(this.e, 2131100218));
        }
    }

    void c(String str, String str2) {
        HashMap<String, String> hashMap = new HashMap<>();
        hashMap.put("mintgenie-client", "LM-MOBILE");
        hashMap.put("mContent-Type", "application/json");
        try {
            JSONObject jSONObject = new JSONObject();
            JSONArray jSONArray = new JSONArray();
            JSONObject jSONObject2 = new JSONObject();
            jSONObject2.put("days", "5Y");
            jSONObject2.put("tickerId", str);
            jSONObject2.put("tickerType", "BSE");
            jSONArray.put(jSONObject2);
            jSONObject.put("stockFilters", jSONArray);
            this.d.k(1, "Peer", "https://api-mintgenie.livemint.com/api-gateway/fundamental/api/v3/charts", jSONObject, hashMap, true, false);
            this.p.put(str, str2);
        } catch (Exception unused) {
        }
    }

    public void d() {
        this.b.removeAllViews();
        this.d = new k6.p(this.e, this, "Peer");
        this.h = DataBindingUtil.inflate(this.c.getLayoutInflater(), 2131625124, (ViewGroup) null, false);
        String str = "https://api-mintgenie.livemint.com/api-gateway/fundamental/api/v2/companyProfile/" + this.f;
        this.j = str;
        this.d.d(str);
        this.h.i.setText(String.format(this.e.getString(2131952382), this.g));
        this.h.g.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                m.this.e(view);
            }
        });
        this.h.h.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                m.this.f(view);
            }
        });
        this.p = new HashMap<>();
        this.o = new ArrayList<>();
        this.h.c(AppController.j().E());
        this.b.addView(this.h.getRoot());
    }

    @Override
    public void getAboutCompanyData(JSONObject jSONObject, String str) {
        if (!str.equalsIgnoreCase(this.j)) {
            this.o.add((ChartDataPojo) new Gson().fromJson(jSONObject.toString(), ChartDataPojo.class));
            if (this.o.size() == this.q) {
                g(this.o);
                return;
            }
            return;
        }
        AboutCompanyPojo aboutCompanyPojo = (AboutCompanyPojo) new Gson().fromJson(jSONObject.toString(), AboutCompanyPojo.class);
        this.i = aboutCompanyPojo;
        if (aboutCompanyPojo == null || aboutCompanyPojo.getPeerCompanyList() == null || this.i.getPeerCompanyList().size() <= 0) {
            return;
        }
        h();
        i();
    }

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