导航菜单

页面标题

页面副标题

Mint v5.7.3 - n.java 源代码

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

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


package f8;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.databinding.DataBindingUtil;
import com.google.gson.Gson;
import com.htmedia.mint.AppController;
import com.htmedia.mint.pojo.companydetailnew.KeyMetricsPojo;
import com.htmedia.mint.pojo.companydetailnew.MarketCapResponse;
import com.htmedia.mint.pojo.companydetailnew.MarketVolumePojo;
import com.htmedia.mint.pojo.companydetailnew.PriceRangePojo;
import com.htmedia.mint.ui.activity.WebViewActivityWithHeader;
import com.htmedia.mint.utils.f0;
import com.htmedia.mint.utils.o1;
import com.taboola.android.global_components.eventsmanager.TBLEventType;
import com.thoughtbot.expandablerecyclerview.BuildConfig;
import java.util.HashMap;
import org.json.JSONObject;
import x4.cu0;

public class n implements k6.q {
    private final String a;
    Activity b;
    Context c;
    LayoutInflater d;
    k6.p e;
    String f = "KeyMetricsWidget";
    String g = "MarketVolumeData";
    String h = "MARKET_CAP_API";
    String i = "PriceRangeWidget";
    ViewGroup j;
    cu0 o;
    KeyMetricsPojo p;
    String q;
    String r;
    private final o s;

    class a implements View.OnClickListener {
        a() {
        }

        @Override
        public void onClick(View view) {
            Intent intent = new Intent(n.this.c, (Class<?>) WebViewActivityWithHeader.class);
            intent.putExtra("url", "https://mintgenie.livemint.com/stocks/ratios/" + n.this.q + "-" + n.this.a + "?utm_source=lm_stock_ratios&utm_medium=livemint&utm_campaign=livemint");
            intent.putExtra("Title", BuildConfig.FLAVOR);
            intent.putExtra("IS_SHOW_HEADER", true);
            n.this.c.startActivity(intent);
        }
    }

    public n(Activity activity, ViewGroup viewGroup, Context context, String str, KeyMetricsPojo keyMetricsPojo, String str2, String str3, o oVar) {
        this.b = activity;
        this.c = context;
        this.j = viewGroup;
        this.a = str;
        this.q = str2;
        this.p = keyMetricsPojo;
        this.s = oVar;
        this.r = str3;
    }

    private void h(MarketVolumePojo marketVolumePojo) {
        if (Double.parseDouble(String.valueOf(marketVolumePojo.getSectorPriceToEarningsValueRatio())) == -99999.99d) {
            this.o.j.setText("-");
        } else {
            this.o.j.setText(marketVolumePojo.getSectorPriceToEarningsValueRatio() + BuildConfig.FLAVOR);
        }
        if (Double.parseDouble(String.valueOf(marketVolumePojo.getVolumeTwentyDaysAvg())) == -99999.99d) {
            this.o.e.setText("-");
            return;
        }
        this.o.e.setText(marketVolumePojo.getVolumeTwentyDaysAvg() + BuildConfig.FLAVOR);
    }

    private void i(PriceRangePojo priceRangePojo) {
        if (Double.parseDouble(String.valueOf(priceRangePojo.getOpen())) == -99999.99d) {
            this.o.h.setText("-");
        } else {
            this.o.h.setText(priceRangePojo.getOpen() + BuildConfig.FLAVOR);
        }
        if (Double.parseDouble(String.valueOf(priceRangePojo.getClose())) == -99999.99d) {
            this.o.i.setText("-");
            return;
        }
        this.o.i.setText(priceRangePojo.getClose() + BuildConfig.FLAVOR);
    }

    void b() {
        String str = this.r;
        if (str != null) {
            this.e.i(str, this.a, this.h);
        }
    }

    void c() {
        HashMap<String, String> hashMap = new HashMap<>();
        hashMap.put("mintgenie-client", TBLEventType.DEFAULT);
        String str = "https://api-mintgenie.livemint.com/api-gateway/fundamental/api/v2/webKeyMetricsRatios/" + this.a;
        this.f = str;
        this.e.k(0, str, str, null, hashMap, true, false);
    }

    void d() {
        HashMap<String, String> hashMap = new HashMap<>();
        hashMap.put("mintgenie-client", TBLEventType.DEFAULT);
        String str = "https://api-mintgenie.livemint.com/api-gateway/fundamental/api/v2/summaryMarketVolume/" + this.a + "/BSE";
        this.g = str;
        this.e.k(0, str, str, null, hashMap, true, false);
    }

    void e() {
        new HashMap();
        String str = "https://api-mintgenie.livemint.com/api-gateway/fundamental/markets-data/live-price/v2?tickerId=" + this.a + "&exchangeCode=BSE";
        this.i = str;
        this.e.k(0, str, str, null, null, true, false);
    }

    public void f() {
        this.j.removeAllViews();
        LayoutInflater from = LayoutInflater.from(this.c);
        this.d = from;
        this.o = DataBindingUtil.inflate(from, 2131625329, (ViewGroup) null, false);
        this.e = new k6.p(this.b, this, this.f);
        this.o.c(f0.Z1());
        KeyMetricsPojo keyMetricsPojo = this.p;
        if (keyMetricsPojo == null) {
            c();
        } else {
            g(keyMetricsPojo);
        }
        e();
        d();
        this.o.c(AppController.j().E());
        b();
        this.j.addView(this.o.getRoot());
        this.o.b.setOnClickListener(new a());
    }

    void g(KeyMetricsPojo keyMetricsPojo) {
        if (keyMetricsPojo != null && keyMetricsPojo.getRatiosWeb() != null && keyMetricsPojo.getRatiosWeb().getValuation() != null && keyMetricsPojo.getRatiosWeb().getValuation().size() > 0) {
            int i = 0;
            while (true) {
                if (i >= keyMetricsPojo.getRatiosWeb().getValuation().size()) {
                    break;
                }
                if (keyMetricsPojo.getRatiosWeb().getValuation().get(i).getKey().equals("pPerEBasicExcludingExtraordinaryItemsTTM")) {
                    String H0 = f0.H0(keyMetricsPojo.getRatiosWeb().getValuation().get(i).getValue());
                    if (Double.parseDouble(keyMetricsPojo.getRatiosWeb().getValuation().get(i).getValue()) == -99999.99d) {
                        this.o.p.setText("-");
                    } else {
                        this.o.p.setText(H0);
                    }
                } else {
                    i++;
                }
            }
        }
        if (keyMetricsPojo != null && keyMetricsPojo.getRatiosWeb() != null && keyMetricsPojo.getRatiosWeb().getFinancialstrength() != null && keyMetricsPojo.getRatiosWeb().getFinancialstrength().size() > 0) {
            int i2 = 0;
            while (true) {
                if (i2 >= keyMetricsPojo.getRatiosWeb().getFinancialstrength().size()) {
                    break;
                }
                if (keyMetricsPojo.getRatiosWeb().getFinancialstrength().get(i2).getKey().equals("totalDebtPerTotalEquityMostRecentQuarter")) {
                    try {
                        double parseDouble = Double.parseDouble(keyMetricsPojo.getRatiosWeb().getFinancialstrength().get(i2).getValue());
                        o1.a("value", parseDouble + " ");
                        if (parseDouble == -99999.99d) {
                            this.o.c.setText("-");
                        } else {
                            this.o.c.setText(f0.H0((parseDouble / 100.0d) + BuildConfig.FLAVOR));
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                } else {
                    i2++;
                }
            }
        }
        if (keyMetricsPojo != null && keyMetricsPojo.getRatiosWeb() != null && keyMetricsPojo.getRatiosWeb().getPersharedata() != null && keyMetricsPojo.getRatiosWeb().getPersharedata().size() > 0) {
            int i3 = 0;
            while (true) {
                if (i3 >= keyMetricsPojo.getRatiosWeb().getPersharedata().size()) {
                    break;
                }
                if (keyMetricsPojo.getRatiosWeb().getPersharedata().get(i3).getKey().equals("ePSBasicExcludingExtraordinaryItemsItrailing12Month")) {
                    String H02 = f0.H0(keyMetricsPojo.getRatiosWeb().getPersharedata().get(i3).getValue());
                    if (Double.parseDouble(keyMetricsPojo.getRatiosWeb().getPersharedata().get(i3).getValue()) == -99999.99d) {
                        this.o.o.setText("-");
                    } else {
                        this.o.o.setText(H02);
                    }
                } else {
                    i3++;
                }
            }
        }
        if (keyMetricsPojo != null && keyMetricsPojo.getRatiosWeb() != null && keyMetricsPojo.getRatiosWeb().getPriceandVolume() != null && keyMetricsPojo.getRatiosWeb().getPriceandVolume().size() > 0) {
            int i4 = 0;
            while (true) {
                if (i4 >= keyMetricsPojo.getRatiosWeb().getPriceandVolume().size()) {
                    break;
                }
                if (keyMetricsPojo.getRatiosWeb().getPriceandVolume().get(i4).getKey().equals("beta")) {
                    String H03 = f0.H0(keyMetricsPojo.getRatiosWeb().getPriceandVolume().get(i4).getValue());
                    if (Double.parseDouble(keyMetricsPojo.getRatiosWeb().getPriceandVolume().get(i4).getValue()) == -99999.99d) {
                        this.o.a.setText("-");
                    } else {
                        this.o.a.setText(H03);
                    }
                } else {
                    i4++;
                }
            }
        }
        if (keyMetricsPojo == null || keyMetricsPojo.getRatiosWeb() == null || keyMetricsPojo.getRatiosWeb().getValuation() == null || keyMetricsPojo.getRatiosWeb().getValuation().size() <= 0) {
            return;
        }
        for (int i5 = 0; i5 < keyMetricsPojo.getRatiosWeb().getValuation().size(); i5++) {
            if (keyMetricsPojo.getRatiosWeb().getValuation().get(i5).getKey().equals("currentDividendYieldCommonStockPrimaryIssueLTM")) {
                String H04 = f0.H0(keyMetricsPojo.getRatiosWeb().getValuation().get(i5).getValue());
                if (Double.parseDouble(keyMetricsPojo.getRatiosWeb().getValuation().get(i5).getValue()) == -99999.99d) {
                    this.o.d.setText("-");
                    return;
                } else {
                    this.o.d.setText(H04);
                    return;
                }
            }
        }
    }

    @Override
    public void getAboutCompanyData(JSONObject jSONObject, String str) {
        System.out.println("------------>>>>>>" + str);
        if (str.equals(this.f)) {
            g((KeyMetricsPojo) new Gson().fromJson(jSONObject.toString(), KeyMetricsPojo.class));
            return;
        }
        if (str.equals(this.g)) {
            MarketVolumePojo marketVolumePojo = (MarketVolumePojo) new Gson().fromJson(jSONObject.toString(), MarketVolumePojo.class);
            this.s.a(marketVolumePojo);
            h(marketVolumePojo);
        } else {
            if (!str.contains("https://api-mintgenie.livemint.com/api-gateway/fundamental/markets-data/live-price/v2")) {
                i((PriceRangePojo) new Gson().fromJson(jSONObject.toString(), PriceRangePojo.class));
                return;
            }
            MarketCapResponse marketCapResponse = (MarketCapResponse) new Gson().fromJson(jSONObject.toString(), MarketCapResponse.class);
            String H0 = f0.H0(marketCapResponse.getMarketCap());
            if (Double.parseDouble(marketCapResponse.getMarketCap()) == -99999.99d) {
                this.o.f.setText("-");
            } else {
                this.o.f.setText(H0);
            }
        }
    }

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