导航菜单

页面标题

页面副标题

Mint v5.7.3 - k.java 源代码

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

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


package f8;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.text.SpannableString;
import android.text.TextUtils;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.AppCompatTextView;
import androidx.core.content.ContextCompat;
import androidx.core.content.res.ResourcesCompat;
import androidx.databinding.DataBindingUtil;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
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.highlight.Highlight;
import com.github.mikephil.charting.listener.OnChartValueSelectedListener;
import com.github.mikephil.charting.utils.Utils;
import com.google.android.material.tabs.TabLayout;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.htmedia.mint.AppController;
import com.htmedia.mint.marketRevamp.marketUtils.MarketUtils;
import com.htmedia.mint.marketRevamp.ui.LandscapeWebViewActivity;
import com.htmedia.mint.pojo.ShareHoldingTrendData;
import com.htmedia.mint.pojo.companies.financials.mintgeine.INC;
import com.htmedia.mint.pojo.companydetailnew.ChartDataPojo;
import com.htmedia.mint.pojo.companydetailnew.KeyMetricsPojo;
import com.htmedia.mint.pojo.companydetailnew.MarketVolumePojo;
import com.htmedia.mint.pojo.companydetailnew.PeerCompanyNew;
import com.htmedia.mint.pojo.companydetailnew.PriceRangePojo;
import com.htmedia.mint.pojo.companydetailnew.PriceandVolume;
import com.htmedia.mint.pojo.companydetailnew.Value;
import com.htmedia.mint.pojo.config.Config;
import com.htmedia.mint.pojo.mywatchlist.MintGenieResponse;
import com.htmedia.mint.ui.activity.HomeActivity;
import com.htmedia.mint.ui.activity.LoginFlowActivity;
import com.htmedia.mint.ui.fragments.CompaniesDetails;
import com.htmedia.mint.ui.fragments.companydetailfragments.OverViewFragment;
import com.htmedia.mint.utils.ReadMoreOption;
import com.htmedia.mint.utils.f0;
import com.htmedia.mint.utils.o1;
import com.htmedia.mint.utils.q0;
import com.htmedia.mint.utils.v2;
import com.htmedia.sso.network.ApiClient;
import com.htmedia.sso.network.ApiServices;
import com.taboola.android.global_components.eventsmanager.TBLEventType;
import com.thoughtbot.expandablerecyclerview.BuildConfig;
import in.juspay.hypersdk.core.PaymentConstants;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONObject;
import x4.q8;
import y7.w0;

public class k implements k6.q, o {
    public MarketVolumePojo A;
    private w0 B;
    Runnable E;
    Activity a;
    Context b;
    q8 h;
    LayoutInflater i;
    k6.p j;
    ViewGroup p;
    String q;
    String r;
    PriceRangePojo u;
    String v;
    String w;
    Config y;
    String z;
    int c = 0;
    int d = 0;
    float e = 0.0f;
    float f = 0.0f;
    ArrayList<Value> g = new ArrayList<>();
    String o = "ChartWidgetNew";
    String[] s = {"1D", "5D", "1M", "6M", "1Y", "5Y"};
    int t = 0;
    String x = BuildConfig.FLAVOR;
    boolean C = false;
    Handler D = new Handler();
    int F = 15000;

    class a implements TabLayout.OnTabSelectedListener {
        a() {
        }

        public void onTabReselected(TabLayout.Tab tab) {
        }

        public void onTabSelected(TabLayout.Tab tab) {
            k.this.o(tab, true);
            try {
                k.this.t = tab.getPosition();
                k.this.w();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        public void onTabUnselected(TabLayout.Tab tab) {
            k.this.o(tab, false);
        }
    }

    class b implements Runnable {
        final float a;
        final ImageView b;

        b(float f, ImageView imageView) {
            this.a = f;
            this.b = imageView;
        }

        @Override
        public void run() {
            int width = k.this.h.g.getWidth();
            int i = (int) (width * this.a);
            o1.a("PriceRanhe", "--------->>>>>>>p" + this.a);
            o1.a("PriceRanhe", "--------->>>>>>>w " + width);
            o1.a("PriceRanhe", "--------->>>>>>>M " + i);
            k.this.O(this.b, i, 0, 0, 0);
        }
    }

    class c extends ClickableSpan {
        final ArrayList a;

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

        @Override
        public void onClick(View view) {
            k.this.L(((PeerCompanyNew) this.a.get(0)).getTickerId(), ((PeerCompanyNew) this.a.get(0)).getCompanyName());
        }
    }

    class d extends ClickableSpan {
        final ArrayList a;

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

        @Override
        public void onClick(View view) {
            k.this.L(((PeerCompanyNew) this.a.get(1)).getTickerId(), ((PeerCompanyNew) this.a.get(1)).getCompanyName());
        }
    }

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

        @Override
        public void onClick(View view) {
        }
    }

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

        @Override
        public void onClick(View view) {
            f0.E2(k.this.b);
        }
    }

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

        @Override
        public void onClick(View view) {
            k kVar = k.this;
            kVar.r = "BSE";
            kVar.w();
            k.this.z();
            k.this.p(true);
        }
    }

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

        @Override
        public void onClick(View view) {
            k kVar = k.this;
            kVar.r = "NSI";
            kVar.w();
            k.this.z();
            k.this.p(false);
        }
    }

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

        @Override
        public void onClick(View view) {
            Intent intent = new Intent(k.this.a, (Class<?>) LandscapeWebViewActivity.class);
            intent.putExtra("STOCKS", k.this.q);
            k.this.a.startActivity(intent);
        }
    }

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

        @Override
        public void onClick(View view) {
            TextView textView = (TextView) view;
            SpannableString spannableString = new SpannableString(textView.getText());
            for (ClickableSpan clickableSpan : (ClickableSpan[]) spannableString.getSpans(0, spannableString.length(), ClickableSpan.class)) {
                if (textView.getText().toString().substring(spannableString.getSpanStart(clickableSpan), spannableString.getSpanEnd(clickableSpan)).contains("http://www.example.com")) {
                    return;
                }
            }
        }
    }

    class RunnableC0081k implements Runnable {
        RunnableC0081k() {
        }

        @Override
        public void run() {
            k.this.z();
            k kVar = k.this;
            kVar.D.postDelayed(kVar.E, kVar.F);
        }
    }

    class l extends IndexAxisValueFormatter {
        final ArrayList a;

        l(Collection collection, ArrayList arrayList) {
            super(collection);
            this.a = arrayList;
        }

        public String getFormattedValue(float f) {
            int i = ((int) f) - 1;
            if (this.a.size() > i) {
                try {
                    return k.this.g.get(i).getFormattedDate();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
            return BuildConfig.FLAVOR;
        }
    }

    class m implements OnChartValueSelectedListener {
        m() {
        }

        public void onNothingSelected() {
        }

        public void onValueSelected(Entry entry, Highlight highlight) {
            try {
                k kVar = k.this;
                k.this.h.d.setMarker(new v7.d(kVar.b, 2131625275, BuildConfig.FLAVOR, kVar.h.v.getSelectedTabPosition(), k.this.h.d, null));
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

    class n implements View.OnTouchListener {
        n() {
        }

        @Override
        public boolean onTouch(View view, MotionEvent motionEvent) {
            if (k.this.h.d.isFullyZoomedOut()) {
                return false;
            }
            int action = motionEvent.getAction();
            if (action != 0) {
                if (action != 1) {
                    if (action != 2) {
                        if (action != 3) {
                            return false;
                        }
                    }
                }
                CompaniesDetails.companiesRecyclerView.requestDisallowInterceptTouchEvent(true);
                return false;
            }
            CompaniesDetails.companiesRecyclerView.requestDisallowInterceptTouchEvent(true);
            return false;
        }
    }

    public k(Activity activity, ViewGroup viewGroup, Context context, String str, String str2, String str3, String str4) {
        this.r = BuildConfig.FLAVOR;
        this.a = activity;
        this.b = context;
        this.p = viewGroup;
        this.q = str;
        this.r = str2;
        this.v = str3;
        this.w = str4;
    }

    private ShareHoldingTrendData A(String str, List<ShareHoldingTrendData> list) {
        for (ShareHoldingTrendData shareHoldingTrendData : list) {
            if (shareHoldingTrendData != null && shareHoldingTrendData.getCategoryName() != null && shareHoldingTrendData.getCategoryName().equals(str)) {
                return shareHoldingTrendData;
            }
        }
        return null;
    }

    private String C(TabLayout.Tab tab) {
        Integer valueOf;
        View customView = (tab == null || (valueOf = Integer.valueOf(tab.getPosition())) == null) ? null : this.h.v.getTabAt(valueOf.intValue()).getCustomView();
        TextView textView = customView != null ? (TextView) customView.findViewById(2131430754) : null;
        if (textView != null) {
            return textView.getText().toString();
        }
        return null;
    }

    private void E() {
        try {
            Handler handler = this.D;
            RunnableC0081k runnableC0081k = new RunnableC0081k();
            this.E = runnableC0081k;
            handler.postDelayed(runnableC0081k, this.F);
        } catch (Exception e2) {
            e2.printStackTrace();
        }
    }

    public void F(List list) {
        if (list == null || list.size() <= 0) {
            return;
        }
        r();
    }

    public void G(View view) {
        String replace = this.v.replace(" ", "-");
        String str = "https://www.livemint.com/market/market-stats/stocks-" + replace + "-share-price-nse-bse-" + this.q;
        v2.k((Activity) this.b, this.v + ":" + this.u.getPrice() + ", " + this.h.j.getText().toString() + ", Check out live market updates on " + replace, str);
        com.htmedia.mint.utils.n.R(this.a, com.htmedia.mint.utils.n.T1, "market_stocks_detail_page", this.v, null, str, "Share", BuildConfig.FLAVOR, this.r.equalsIgnoreCase("BSE") ? "BSE" : "NSI");
    }

    public void H(View view) {
        String G1 = f0.G1(this.a, "userToken");
        this.z = G1;
        if (TextUtils.isEmpty(G1)) {
            Intent intent = new Intent(this.a, (Class<?>) LoginFlowActivity.class);
            intent.setFlags(603979776);
            this.a.startActivityForResult(intent, 102);
        } else {
            com.htmedia.mint.utils.n.N(this.a, com.htmedia.mint.utils.n.b1, "market_dashboard_page", com.htmedia.mint.utils.n.A0, null, this.x, this.C ? "added" : "removed", this.h.e.getText().toString(), this.r.equalsIgnoreCase("BSE") ? "BSE" : "NSI");
            Activity activity = this.a;
            com.htmedia.mint.utils.n.N(activity, com.htmedia.mint.utils.n.F0, com.htmedia.mint.utils.n.p(activity), com.htmedia.mint.utils.n.k(this.a), null, BuildConfig.FLAVOR, "add_to_watch_list", this.h.e.getText().toString());
            l(this.z);
        }
    }

    public void I(Boolean bool) {
        if (bool.booleanValue()) {
            this.D.removeCallbacks(this.E);
            OverViewFragment.onPauseFragment.setValue(Boolean.FALSE);
        }
    }

    public void J(MintGenieResponse mintGenieResponse) throws Exception {
        f0.W3(this.a, "mintgenieUserID", mintGenieResponse.getUserId());
        l(this.z);
    }

    public void L(String str, String str2) {
        try {
            if (TextUtils.isEmpty(str) || TextUtils.isEmpty(str2)) {
                return;
            }
            MarketUtils.INSTANCE.openStockDetails(this.b, BuildConfig.FLAVOR + str, str2, true, false, BuildConfig.FLAVOR, Boolean.FALSE);
        } catch (Exception e2) {
            e2.printStackTrace();
        }
    }

    private void M(ChartDataPojo chartDataPojo) {
        String str;
        h(chartDataPojo);
        if (chartDataPojo != null) {
            try {
            } catch (Exception e2) {
                e2.printStackTrace();
                return;
            }
            if ((chartDataPojo.getResult() == null || chartDataPojo.getResult().get(0) != null || chartDataPojo.getResult().get(0).getValues() != null) && chartDataPojo.getResult().get(0).getValues().size() > 0) {
                ArrayList arrayList = new ArrayList();
                ArrayList arrayList2 = new ArrayList();
                this.h.d.clear();
                this.g = chartDataPojo.getResult().get(0).getValues();
                int i2 = 0;
                while (true) {
                    str = "hh:mm";
                    if (i2 >= chartDataPojo.getResult().get(0).getValues().size()) {
                        break;
                    }
                    Value value = chartDataPojo.getResult().get(0).getValues().get(i2);
                    arrayList.add(new Entry(i2 + 1.0f, (float) value.getClose(), value));
                    try {
                        if (value.getTimeStamp() == null || value.getTimeStamp().equalsIgnoreCase(BuildConfig.FLAVOR)) {
                            arrayList2.add("\n");
                        } else {
                            arrayList2.add(BuildConfig.FLAVOR + f0.F0(value.getTimeStamp(), "yyyy-MM-dd HH:mm:ss", "hh:mm") + "\n");
                        }
                    } catch (Exception e3) {
                        e3.printStackTrace();
                        arrayList2.add(BuildConfig.FLAVOR);
                    }
                    i2++;
                    e2.printStackTrace();
                    return;
                }
                TabLayout tabLayout = this.h.v;
                String C = C(tabLayout.getTabAt(tabLayout.getSelectedTabPosition()));
                if (!C.equals("1D")) {
                    if (!C.equals("5D") && !C.equals("1M")) {
                        if (!C.equals("6M") && !C.equals("1Y")) {
                            str = "yyyy";
                        }
                        str = "MMM yy";
                    }
                    str = "dd MMM";
                }
                for (int i3 = 0; i3 < this.g.size(); i3++) {
                    Value value2 = this.g.get(i3);
                    try {
                        if (value2.getTimeStamp() == null || value2.getTimeStamp().equalsIgnoreCase(BuildConfig.FLAVOR)) {
                            this.g.get(i3).setFormattedDate(BuildConfig.FLAVOR);
                        } else {
                            this.g.get(i3).setFormattedDate(BuildConfig.FLAVOR + f0.F0(value2.getTimeStamp(), "yyyy-MM-dd HH:mm:ss", str));
                        }
                    } catch (Exception e4) {
                        e4.printStackTrace();
                        this.g.get(i3).setFormattedDate(BuildConfig.FLAVOR);
                    }
                }
                if (this.h.d.getData() != null && this.h.d.getData().getDataSetCount() > 0) {
                    this.h.d.getData().getDataSetByIndex(0).setEntries(arrayList);
                    this.h.d.getData().notifyDataChanged();
                    this.h.d.notifyDataSetChanged();
                    return;
                }
                LineDataSet lineDataSet = new LineDataSet(arrayList, "Sample Data");
                lineDataSet.setDrawIcons(false);
                lineDataSet.setColor(-12303292);
                lineDataSet.setLineWidth(1.0f);
                lineDataSet.setHighLightColor(2131099970);
                lineDataSet.disableDashedLine();
                lineDataSet.setDrawCircles(false);
                lineDataSet.setValueTextSize(0.0f);
                lineDataSet.setDrawFilled(true);
                lineDataSet.setFormLineWidth(1.0f);
                lineDataSet.setDrawValues(true);
                lineDataSet.setFormSize(15.0f);
                lineDataSet.setHighlightEnabled(true);
                lineDataSet.setColor(2131099970);
                if (Utils.getSDKInt() >= 18) {
                    lineDataSet.setFillDrawable(ContextCompat.getDrawable(this.b, 2131233447));
                } else {
                    lineDataSet.setFillColor(-12303292);
                }
                this.h.d.getXAxis().setAvoidFirstLastClipping(false);
                this.h.d.getXAxis().setDrawGridLines(false);
                this.h.d.getAxisRight().setEnabled(false);
                this.h.d.getXAxis().setPosition(XAxis.XAxisPosition.BOTTOM);
                this.h.d.getAxisLeft().setDrawAxisLine(false);
                this.h.d.getAxisLeft().setDrawAxisLine(false);
                if (AppController.j().E()) {
                    this.h.d.getAxisLeft().setTextColor(this.b.getResources().getColor(2131101002));
                    this.h.d.getXAxis().setTextColor(this.b.getResources().getColor(2131101002));
                } else {
                    this.h.d.getAxisLeft().setTextColor(this.b.getResources().getColor(2131101012));
                    this.h.d.getXAxis().setTextColor(this.b.getResources().getColor(2131101012));
                }
                this.h.d.getXAxis().setValueFormatter(new l(arrayList2, arrayList2));
                float dimensionPixelSize = (int) (this.b.getResources().getDimensionPixelSize(2131166313) / this.b.getResources().getDisplayMetrics().scaledDensity);
                this.h.d.getXAxis().setTextSize(dimensionPixelSize);
                this.h.d.getAxisLeft().setTextSize(dimensionPixelSize);
                this.h.d.getXAxis().setGranularityEnabled(true);
                this.h.d.getLegend().setEnabled(true);
                this.h.d.getXAxis().setGranularity(1.0f);
                this.h.d.getXAxis().setLabelCount(7);
                this.h.d.setExtraOffsets(0.0f, 0.0f, 0.0f, 30.0f);
                this.h.d.getLegend().setEnabled(false);
                this.h.d.setOnChartValueSelectedListener(new m());
                this.h.d.setHighlightPerTapEnabled(true);
                this.h.d.setScaleEnabled(false);
                this.h.d.getDescription().setEnabled(false);
                ArrayList arrayList3 = new ArrayList();
                arrayList3.add(lineDataSet);
                this.h.d.setData(new LineData(arrayList3));
                this.h.d.setOnTouchListener(new n());
                this.h.d.notifyDataSetChanged();
                return;
            }
        }
        this.h.d.clear();
        this.h.d.setNoDataText("No data available");
        this.h.d.invalidate();
    }

    public void O(View view, int i2, int i3, int i4, int i5) {
        try {
            ((ViewGroup.MarginLayoutParams) view.getLayoutParams()).setMargins(i2, i3, i4, i5);
            view.requestLayout();
        } catch (Exception unused) {
        }
    }

    private void Q() {
        String str;
        this.h.D.setText(this.u.getYhigh());
        this.h.E.setText(this.u.getYlow());
        this.h.x.setText(this.u.getLow());
        this.h.w.setText(this.u.getHigh());
        this.h.e.setText(this.u.getDisplayName());
        TextView textView = this.h.f;
        if (TextUtils.isEmpty(this.w)) {
            str = BuildConfig.FLAVOR;
        } else {
            str = "Sector: " + this.w;
        }
        textView.setText(str);
        PriceRangePojo priceRangePojo = this.u;
        if (priceRangePojo != null && priceRangePojo.getNetChange() != null) {
            if (this.u.getNetChange().contains("-")) {
                this.h.j.setTextColor(-65536);
                this.h.j.setText(" " + this.u.getNetChange() + " (" + this.u.getPercentChange() + "%)");
            } else {
                this.h.j.setTextColor(Color.parseColor("#26a69a"));
                this.h.j.setText(" +" + this.u.getNetChange() + " (+" + this.u.getPercentChange() + "%)");
            }
        }
        q0.M(this.h.o, this.u.getPrice());
        q0.X(this.h.B, this.u.getDate() + ", " + this.u.getTime());
        v(this.h.a, y(this.u.getHigh(), this.u.getLow(), this.u.getPrice()));
        v(this.h.b, y(this.u.getYhigh(), this.u.getYlow(), this.u.getPrice()));
    }

    private void R() {
        try {
            String[] strArr = this.s;
            int length = strArr.length;
            boolean z = true;
            int i2 = 0;
            while (i2 < length) {
                String str = strArr[i2];
                TabLayout tabLayout = this.h.v;
                tabLayout.addTab(tabLayout.newTab().setCustomView(B(z, str)));
                i2++;
                z = false;
            }
            this.h.v.addOnTabSelectedListener(new a());
        } catch (Exception e2) {
            e2.printStackTrace();
        }
    }

    private void h(ChartDataPojo chartDataPojo) {
    }

    private void m(Activity activity, AppCompatTextView appCompatTextView, CharSequence charSequence) {
        Typeface font = ResourcesCompat.getFont(activity, 2131296266);
        appCompatTextView.setVisibility(4);
        new ReadMoreOption.a(activity).s(3).t(1).q("<b>Read more</b>").o("<b>&nbsp;Read less</b>").r(ContextCompat.getColor(activity, f0.Z1() ? 2131101002 : 2131099901)).p(ContextCompat.getColor(activity, f0.Z1() ? 2131101002 : 2131099901)).m(true).b(false).n(font).a().d(appCompatTextView, charSequence);
        appCompatTextView.setOnClickListener(new e());
    }

    public void o(TabLayout.Tab tab, boolean z) {
        ((TextView) this.h.v.getTabAt(tab.getPosition()).getCustomView().findViewById(2131430754)).setTextColor(this.b.getResources().getColor(z ? 2131100872 : 2131100625));
    }

    private void q() {
        HomeActivity homeActivity = HomeActivity.G0;
        if (homeActivity != null) {
            if (this.B == null) {
                this.B = (w0) new ViewModelProvider(homeActivity).get(w0.class);
            }
            s(this.B);
        }
    }

    private void r() {
        this.C = this.B.R1(this.q);
        this.b.getDrawable(2131232771);
        Drawable drawable = f0.Z1() ? this.b.getDrawable(2131232772) : this.b.getDrawable(2131232771);
        if (this.C) {
            this.h.c.setCompoundDrawablesWithIntrinsicBounds((Drawable) null, (Drawable) null, (Drawable) null, (Drawable) null);
            this.h.c.setText(this.b.getString(2131951679));
        } else {
            this.h.c.setText(this.b.getString(2131951676));
            this.h.c.setCompoundDrawablesWithIntrinsicBounds(drawable, (Drawable) null, (Drawable) null, (Drawable) null);
        }
    }

    private void s(w0 w0Var) {
        Activity activity;
        if (w0Var == null || (activity = this.a) == null || !(activity instanceof AppCompatActivity)) {
            return;
        }
        String G1 = f0.G1(activity, "mintgenieUserID");
        if (TextUtils.isEmpty(G1)) {
            return;
        }
        w0Var.O1(f0.G1(this.a, "userToken"), f0.G1(this.a, "userClient"));
        w0Var.n2(AppController.j().g());
        w0Var.M0().set(G1);
        w0Var.Q0();
        w0Var.L0().observe(this.a, new Observer() {
            public final void onChanged(Object obj) {
                k.this.F((List) obj);
            }
        });
    }

    private String t(String str) {
        try {
            return new SimpleDateFormat("dd MMM yyyy").format(new SimpleDateFormat("yyyy-MM-dd").parse(str));
        } catch (Exception unused) {
            return str;
        }
    }

    private String u(String str) {
        try {
            return new DecimalFormat("##,##,##,##0.00").format(Float.parseFloat(str));
        } catch (NumberFormatException e2) {
            e2.printStackTrace();
            return str;
        }
    }

    private String x(ArrayList<INC> arrayList) {
        Iterator<INC> it = arrayList.iterator();
        while (it.hasNext()) {
            INC next = it.next();
            if (next.key.equals("NetIncome")) {
                return next.value;
            }
        }
        return BuildConfig.FLAVOR;
    }

    public View B(boolean z, String str) {
        View inflate = LayoutInflater.from(this.b).inflate(2131624205, (ViewGroup) null);
        TextView textView = (TextView) inflate.findViewById(2131430754);
        textView.setText(BuildConfig.FLAVOR + str);
        textView.setTextColor(this.b.getResources().getColor(z ? 2131100872 : 2131100625));
        return inflate;
    }

    public void D() {
        this.p.removeAllViews();
        this.y = f0.r0();
        this.i = LayoutInflater.from(this.b);
        this.A = null;
        E();
        this.h = DataBindingUtil.inflate(this.i, 2131624128, (ViewGroup) null, false);
        this.j = new k6.p(this.a, this, this.o);
        HashMap<String, String> hashMap = new HashMap<>();
        hashMap.put("mintgenie-client", TBLEventType.DEFAULT);
        this.j.p("https://api-mintgenie.livemint.com/api-gateway/fundamental/v2/getShareHoldingsDetailByTickerIdAndType?type=TrendDetails&tickerId=" + this.q, "https://api-mintgenie.livemint.com/api-gateway/core/api/v1/stock/stock-recommendation/" + this.q, "https://api-mintgenie.livemint.com/api-gateway/fundamental/api/v2/webKeyMetricsRatios/" + this.q, "https://api-mintgenie.livemint.com/api-gateway/fundamental/api/v2/companyProfile/" + this.q, this.y.getMarkets().getCompanies().getBaseMintGenieUrl() + "api/v2/stockFinancials/" + this.q, "https://api-mintgenie.livemint.com/api-gateway/fundamental/markets-data/live-price/v2?tickerId=" + this.q + "&exchangeCode=BSE", hashMap, this.q);
        this.h.c(AppController.j().E());
        R();
        p(this.r.equalsIgnoreCase("BSE"));
        w();
        this.h.i.getRoot().setOnClickListener(new f());
        this.p.addView(this.h.getRoot());
        this.h.r.setOnClickListener(new g());
        this.h.t.setOnClickListener(new h());
        this.h.q.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                k.this.G(view);
            }
        });
        Config config = this.y;
        if (config == null || config.getMywatchlist() == null || !this.y.getMywatchlist().isEnableWatchistAndroid()) {
            this.h.c.setVisibility(8);
        } else {
            this.h.c.setVisibility(0);
        }
        this.h.c.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                k.this.H(view);
            }
        });
        q();
        OverViewFragment.onPauseFragment.observe(this.a, new Observer() {
            public final void onChanged(Object obj) {
                k.this.I((Boolean) obj);
            }
        });
        this.h.p.setOnClickListener(new i());
        this.h.A.setMovementMethod(LinkMovementMethod.getInstance());
        this.h.A.setOnClickListener(new j());
    }

    public void N(String str, String str2, String str3, String str4) {
        String saveuser = this.y.getMywatchlist().getSaveuser();
        JsonObject jsonObject = new JsonObject();
        jsonObject.addProperty("email", str2);
        jsonObject.addProperty("mobileNo", str3);
        jsonObject.addProperty("cellNumber", BuildConfig.FLAVOR);
        jsonObject.addProperty("name", str);
        jsonObject.addProperty("token", this.z);
        jsonObject.addProperty(PaymentConstants.CLIENT_ID_CAMEL, str4);
        jsonObject.addProperty("registrationPlatform", TBLEventType.DEFAULT);
        HashMap hashMap = new HashMap();
        hashMap.put("Mintgenie-client", "LM-MOBILE");
        ((ApiServices) ApiClient.getClient().create(ApiServices.class)).saveUserOnMintGenie(saveuser, hashMap, jsonObject).g(sg.a.b()).d(ag.a.a()).e(new dg.e() {
            public final void accept(Object obj) {
                k.this.J((MintGenieResponse) obj);
            }
        }, new dg.e() {
            public final void accept(Object obj) {
                ((Throwable) obj).printStackTrace();
            }
        });
    }

    HashMap<String, String> P(KeyMetricsPojo keyMetricsPojo) {
        HashMap<String, String> hashMap = new HashMap<>();
        if (keyMetricsPojo != null && keyMetricsPojo.getRatiosWeb() != null && keyMetricsPojo.getRatiosWeb().getPriceandVolume() != null && keyMetricsPojo.getRatiosWeb().getPriceandVolume().size() > 0) {
            for (PriceandVolume priceandVolume : keyMetricsPojo.getRatiosWeb().getPriceandVolume()) {
                if (priceandVolume != null) {
                    String key = priceandVolume.getKey();
                    key.hashCode();
                    switch (key) {
                        case "price5DayPercentChange":
                            hashMap.put(com.htmedia.mint.utils.q.i[0], priceandVolume.getValue());
                            break;
                        case "price52WeekPricePercentChange":
                            hashMap.put(com.htmedia.mint.utils.q.i[4], priceandVolume.getValue());
                            break;
                        case "price26WeekPricePercentChange":
                            hashMap.put(com.htmedia.mint.utils.q.i[2], priceandVolume.getValue());
                            break;
                        case "price13WeekPricePercentChange":
                            hashMap.put(com.htmedia.mint.utils.q.i[1], priceandVolume.getValue());
                            break;
                        case "priceYTDPricePercentChange":
                            hashMap.put(com.htmedia.mint.utils.q.i[3], priceandVolume.getValue());
                            break;
                    }
                }
            }
        }
        return hashMap;
    }

    @Override
    public void a(MarketVolumePojo marketVolumePojo) {
        k6.p.q[0] = marketVolumePojo;
        this.j.b();
    }

    @Override
    public void getAboutCompanyData(JSONObject jSONObject, String str) {
        if (str.equals("https://api-mintgenie.livemint.com/api-gateway/fundamental/api/v3/charts")) {
            M((ChartDataPojo) new Gson().fromJson(jSONObject.toString(), ChartDataPojo.class));
            return;
        }
        if (str.equalsIgnoreCase(this.x)) {
            try {
                String obj = jSONObject.get("message").toString();
                Context context = this.b;
                if (obj == null) {
                    obj = BuildConfig.FLAVOR;
                }
                Toast.makeText(context, obj, 1).show();
            } catch (Exception e2) {
                e2.printStackTrace();
            }
        }
    }

    @Override
    public void getPriceRangeResponse(PriceRangePojo priceRangePojo) {
        super.getPriceRangeResponse(priceRangePojo);
        this.u = priceRangePojo;
        Q();
    }

    void l(String str) {
        String addstock;
        String G1 = f0.G1(this.a, "mintgenieUserID");
        this.b.getDrawable(2131232771);
        Drawable drawable = f0.Z1() ? this.b.getDrawable(2131232772) : this.b.getDrawable(2131232771);
        Config config = this.y;
        if (config == null || config.getMywatchlist() == null || TextUtils.isEmpty(this.y.getMywatchlist().getAddstock()) || TextUtils.isEmpty(G1)) {
            if (TextUtils.isEmpty(G1)) {
                n();
                return;
            }
            return;
        }
        if (this.C) {
            this.C = false;
            this.h.c.setText(this.b.getString(2131951676));
            this.h.c.setCompoundDrawablesWithIntrinsicBounds(drawable, (Drawable) null, (Drawable) null, (Drawable) null);
            addstock = this.y.getMywatchlist().getDeletestock();
        } else {
            this.C = true;
            this.h.c.setCompoundDrawablesWithIntrinsicBounds((Drawable) null, (Drawable) null, (Drawable) null, (Drawable) null);
            this.h.c.setText(this.b.getString(2131951679));
            addstock = this.y.getMywatchlist().getAddstock();
        }
        this.x = addstock + "?tickerId=" + this.q + "&userId=" + G1 + "&type=STOCK";
        HashMap<String, String> hashMap = new HashMap<>();
        hashMap.put("Authorization", str);
        hashMap.put("Content-Type", "application/json");
        k6.p pVar = this.j;
        String str2 = this.x;
        pVar.k(1, str2, str2, null, hashMap, false, false);
    }

    public void n() {
        String G1 = f0.G1(this.a, "userName");
        String G12 = f0.G1(this.a, "userClient");
        String F1 = f0.F1(this.a);
        String G13 = f0.G1(this.a, "userPhoneNumber");
        if (TextUtils.isEmpty(G12)) {
            return;
        }
        if (TextUtils.isEmpty(G1)) {
            G1 = BuildConfig.FLAVOR;
        }
        if (TextUtils.isEmpty(F1)) {
            F1 = BuildConfig.FLAVOR;
        }
        N(G1, F1, G13, G12);
    }

    @Override
    public void onError(String str, String str2) {
        if (str2 == null || !str2.equalsIgnoreCase(this.x)) {
            return;
        }
        Toast.makeText(this.b, "Stock is already added in Watchlist", 1).show();
    }

    void p(boolean z) {
        if (z) {
            if (AppController.j().E()) {
                this.h.s.setBackground(this.b.getResources().getDrawable(2131234086));
                this.h.r.setBackground(this.b.getResources().getDrawable(2131234085));
                this.h.t.setBackgroundColor(this.b.getResources().getColor(2131101012));
                this.h.y.setTextColor(this.b.getResources().getColor(2131101012));
                this.h.z.setTextColor(this.b.getResources().getColor(2131101002));
                return;
            }
            this.h.s.setBackground(this.b.getResources().getDrawable(2131234083));
            this.h.r.setBackground(this.b.getResources().getDrawable(2131234084));
            this.h.t.setBackgroundColor(this.b.getResources().getColor(2131101002));
            this.h.y.setTextColor(this.b.getResources().getColor(2131101002));
            this.h.z.setTextColor(this.b.getResources().getColor(2131099901));
            return;
        }
        if (AppController.j().E()) {
            this.h.s.setBackground(this.b.getResources().getDrawable(2131234086));
            this.h.t.setBackground(this.b.getResources().getDrawable(2131234085));
            this.h.r.setBackgroundColor(this.b.getResources().getColor(2131101012));
            this.h.z.setTextColor(this.b.getResources().getColor(2131101012));
            this.h.y.setTextColor(this.b.getResources().getColor(2131101002));
            return;
        }
        this.h.s.setBackground(this.b.getResources().getDrawable(2131234083));
        this.h.t.setBackground(this.b.getResources().getDrawable(2131234084));
        this.h.r.setBackgroundColor(this.b.getResources().getColor(2131101002));
        this.h.z.setTextColor(this.b.getResources().getColor(2131101002));
        this.h.y.setTextColor(this.b.getResources().getColor(2131099901));
    }

    @Override
    public void processMergedResponse(com.htmedia.mint.pojo.companydetailnew.KeyMetricsPojo r25, com.htmedia.mint.pojo.companydetailnew.RecosPojo r26, java.util.List<com.htmedia.mint.pojo.ShareHoldingTrendData> r27, com.htmedia.mint.pojo.companydetailnew.AboutCompanyPojo r28, com.htmedia.mint.pojo.companies.financials.mintgeine.FinancialsMintGeinePojo r29, com.htmedia.mint.pojo.companydetailnew.PriceRangePojo r30, com.htmedia.mint.pojo.companydetailnew.MarketVolumePojo r31) {
        throw new UnsupportedOperationException("Method not decompiled: f8.k.processMergedResponse(com.htmedia.mint.pojo.companydetailnew.KeyMetricsPojo, com.htmedia.mint.pojo.companydetailnew.RecosPojo, java.util.List, com.htmedia.mint.pojo.companydetailnew.AboutCompanyPojo, com.htmedia.mint.pojo.companies.financials.mintgeine.FinancialsMintGeinePojo, com.htmedia.mint.pojo.companydetailnew.PriceRangePojo, com.htmedia.mint.pojo.companydetailnew.MarketVolumePojo):void");
    }

    void v(ImageView imageView, float f2) {
        try {
            this.h.g.post(new b(f2, imageView));
        } catch (Exception unused) {
        }
    }

    void w() {
        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", this.s[this.t]);
            jSONObject2.put("tickerId", this.q);
            jSONObject2.put("tickerType", this.r);
            jSONArray.put(jSONObject2);
            jSONObject.put("stockFilters", jSONArray);
            this.j.k(1, "https://api-mintgenie.livemint.com/api-gateway/fundamental/api/v3/charts", "https://api-mintgenie.livemint.com/api-gateway/fundamental/api/v3/charts", jSONObject, hashMap, false, false);
        } catch (Exception unused) {
        }
    }

    float y(String str, String str2, String str3) {
        float f2;
        if (!TextUtils.isEmpty(str2) && !TextUtils.isEmpty(str) && !str2.equals(str) && !TextUtils.isEmpty(str3)) {
            try {
            } catch (Exception e2) {
                e2.printStackTrace();
            }
            if (f0.W1(str3) && f0.W1(str2) && f0.W1(str)) {
                f2 = ((Float.parseFloat(str3) - Float.parseFloat(str2)) * 100.0f) / (Float.parseFloat(str) - Float.parseFloat(str2));
                return f2 / 100.0f;
            }
        }
        f2 = 100.0f;
        return f2 / 100.0f;
    }

    void z() {
        String str = "https://api-mintgenie.livemint.com/api-gateway/fundamental/markets-data/live-price/v2?tickerId=" + this.q + "&exchangeCode=" + this.r + "&=";
        this.j.k(0, str, str, null, null, false, false);
    }
}