正在查看: Mint v5.7.3 应用的 c.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Mint v5.7.3 应用的 c.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package y6;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.res.ResourcesCompat;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.viewpager.widget.ViewPager;
import com.google.android.material.tabs.TabLayout;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.htmedia.mint.pojo.ForyouPojo;
import com.htmedia.mint.pojo.SearchResultsLocalPojoNew;
import com.htmedia.mint.pojo.config.Config;
import com.htmedia.mint.pojo.config.Section;
import com.htmedia.mint.pojo.mutualfund.SearchMFPojo;
import com.htmedia.mint.pojo.mywatchlist.SearchResultStockPojo;
import com.htmedia.mint.search.model.SearchConfigPojo;
import com.htmedia.mint.utils.f0;
import com.htmedia.mint.utils.n;
import com.htmedia.mint.utils.o1;
import com.htmedia.mint.utils.q;
import com.thoughtbot.expandablerecyclerview.BuildConfig;
import java.util.ArrayList;
import java.util.List;
import k6.g0;
import k6.h0;
import k6.p;
import k6.q;
import k6.u0;
import k6.x0;
import org.json.JSONObject;
import v5.l;
import x4.oj;
public class c extends Fragment implements TextWatcher, View.OnClickListener, TabLayout.OnTabSelectedListener, u0, TextView.OnEditorActionListener, ViewPager.OnPageChangeListener {
public static String t = "top_header";
private oj a;
private x6.d e;
private ArrayList<SearchResultsLocalPojoNew> f;
private String h;
private SearchConfigPojo j;
private boolean o;
private boolean p;
private x6.e r;
private int c = 0;
private final Handler d = new Handler();
private CountDownTimer g = null;
private int i = 0;
private final String[] q = {"Search \"Stocks\"", "Search \"Mutual Funds\"", "Search \"IPO\"", "Search \"Gold rate today\""};
private final Runnable s = new g();
class a implements View.OnClickListener {
a() {
}
@Override
public void onClick(View view) {
}
}
class b implements View.OnClickListener {
b() {
}
@Override
public void onClick(View view) {
c.this.displaySpeechRecognizer();
}
}
class C0236c implements q {
C0236c() {
}
@Override
public void getAboutCompanyData(JSONObject jSONObject, String str) {
if (jSONObject == null) {
SearchResultsLocalPojoNew searchResultsLocalPojoNew = new SearchResultsLocalPojoNew();
searchResultsLocalPojoNew.setType(q.y.NODATA.a());
searchResultsLocalPojoNew.setValue("Sorry, no stock found");
c cVar = c.this;
int B = cVar.B(q.y.STOCK, cVar.f);
if (B >= 0) {
c.this.f.set(B, searchResultsLocalPojoNew);
c.this.e.notifyItemChanged(B);
}
c.this.I();
return;
}
SearchResultStockPojo searchResultStockPojo = (SearchResultStockPojo) new GsonBuilder().create().fromJson(jSONObject.toString(), SearchResultStockPojo.class);
if (searchResultStockPojo != null && searchResultStockPojo.getResult() != null && searchResultStockPojo.getResult().size() > 0) {
c.this.e.h((ArrayList) searchResultStockPojo.getResult());
c cVar2 = c.this;
int B2 = cVar2.B(q.y.STOCK, cVar2.f);
if (B2 >= 0) {
c.this.e.notifyItemChanged(B2);
return;
}
return;
}
SearchResultsLocalPojoNew searchResultsLocalPojoNew2 = new SearchResultsLocalPojoNew();
searchResultsLocalPojoNew2.setType(q.y.NODATA.a());
searchResultsLocalPojoNew2.setValue("Sorry, no stock found");
c cVar3 = c.this;
int B3 = cVar3.B(q.y.STOCK, cVar3.f);
if (B3 >= 0) {
c.this.f.set(B3, searchResultsLocalPojoNew2);
c.this.e.notifyItemChanged(B3);
}
c.this.I();
}
@Override
public void onError(String str, String str2) {
SearchResultsLocalPojoNew searchResultsLocalPojoNew = new SearchResultsLocalPojoNew();
searchResultsLocalPojoNew.setType(q.y.NODATA.a());
searchResultsLocalPojoNew.setValue("Sorry, no stock found");
c cVar = c.this;
int B = cVar.B(q.y.STOCK, cVar.f);
if (B >= 0) {
c.this.f.set(B, searchResultsLocalPojoNew);
c.this.e.notifyItemChanged(B);
}
c.this.I();
}
}
class d implements h0 {
d() {
}
@Override
public void getStoryData(ForyouPojo foryouPojo, String str) {
if (foryouPojo != null && foryouPojo.getContentList() != null && foryouPojo.getContentList().size() > 0) {
c.this.e.g(foryouPojo.getContentList());
c cVar = c.this;
int B = cVar.B(q.y.NEWS, cVar.f);
if (B >= 0) {
c.this.e.notifyItemChanged(B);
return;
}
return;
}
SearchResultsLocalPojoNew searchResultsLocalPojoNew = new SearchResultsLocalPojoNew();
searchResultsLocalPojoNew.setType(q.y.NODATA.a());
searchResultsLocalPojoNew.setValue("Sorry, no news found");
c cVar2 = c.this;
int B2 = cVar2.B(q.y.NEWS, cVar2.f);
if (B2 >= 0) {
c.this.f.set(B2, searchResultsLocalPojoNew);
c.this.e.notifyItemChanged(B2);
}
c.this.I();
}
@Override
public void onError(String str, String str2) {
SearchResultsLocalPojoNew searchResultsLocalPojoNew = new SearchResultsLocalPojoNew();
searchResultsLocalPojoNew.setType(q.y.NODATA.a());
searchResultsLocalPojoNew.setValue("Sorry, no news found");
c cVar = c.this;
int B = cVar.B(q.y.NEWS, cVar.f);
if (B >= 0) {
c.this.f.set(B, searchResultsLocalPojoNew);
c.this.e.notifyItemChanged(B);
}
c.this.I();
}
}
class e implements k6.q {
e() {
}
@Override
public void getAboutCompanyData(JSONObject jSONObject, String str) {
if (jSONObject == null) {
SearchResultsLocalPojoNew searchResultsLocalPojoNew = new SearchResultsLocalPojoNew();
searchResultsLocalPojoNew.setType(q.y.NODATA.a());
searchResultsLocalPojoNew.setValue("Sorry, no mutual funds found");
c.this.f.set(5, searchResultsLocalPojoNew);
c.this.e.notifyItemChanged(5);
c.this.I();
return;
}
SearchMFPojo searchMFPojo = (SearchMFPojo) new GsonBuilder().create().fromJson(jSONObject.toString(), SearchMFPojo.class);
if (searchMFPojo != null && searchMFPojo.getMutualfunds() != null && searchMFPojo.getMutualfunds().size() != 0) {
c.this.e.i((ArrayList) searchMFPojo.getMutualfunds());
c cVar = c.this;
int B = cVar.B(q.y.MUTUAL_FUNDS, cVar.f);
if (B >= 0) {
c.this.e.notifyItemChanged(B);
return;
}
return;
}
SearchResultsLocalPojoNew searchResultsLocalPojoNew2 = new SearchResultsLocalPojoNew();
searchResultsLocalPojoNew2.setType(q.y.NODATA.a());
searchResultsLocalPojoNew2.setValue("Sorry, no mutual funds found");
c cVar2 = c.this;
int B2 = cVar2.B(q.y.MUTUAL_FUNDS, cVar2.f);
if (B2 >= 0) {
c.this.f.set(B2, searchResultsLocalPojoNew2);
c.this.e.notifyItemChanged(B2);
}
c.this.I();
}
@Override
public void onError(String str, String str2) {
SearchResultsLocalPojoNew searchResultsLocalPojoNew = new SearchResultsLocalPojoNew();
searchResultsLocalPojoNew.setType(q.y.NODATA.a());
searchResultsLocalPojoNew.setValue("Sorry, no mutual funds found");
c cVar = c.this;
int B = cVar.B(q.y.MUTUAL_FUNDS, cVar.f);
if (B >= 0) {
c.this.f.set(B, searchResultsLocalPojoNew);
c.this.e.notifyItemChanged(B);
}
c.this.I();
}
}
class f extends CountDownTimer {
final Editable a;
f(long j, long j2, Editable editable) {
super(j, j2);
this.a = editable;
}
@Override
public void onFinish() {
Editable editable = this.a;
if (editable == null) {
c.this.a.p.setVisibility(0);
c.this.a.i.setVisibility(0);
c.this.a.h.setVisibility(8);
return;
}
String obj = editable.toString();
if (TextUtils.isEmpty(obj) || obj.length() < 3) {
c.this.a.p.setVisibility(0);
c.this.a.i.setVisibility(0);
c.this.a.h.setVisibility(8);
} else if (c.this.a.g.getText().toString().trim().length() >= 3) {
c.this.K(obj);
}
}
@Override
public void onTick(long j) {
}
}
class g implements Runnable {
g() {
}
@Override
public void run() {
ArrayList<String> arrayList = f0.y;
if (arrayList == null || arrayList.size() <= 0 || c.this.c < 0 || c.this.c >= arrayList.size()) {
c.this.a.g.setHint((c.this.q.length <= c.this.c || c.this.c < 0) ? "Search \"Stocks\"" : c.this.q[c.this.c]);
c cVar = c.this;
cVar.c = (cVar.c + 1) % c.this.q.length;
} else {
c.this.a.g.setHint(arrayList.get(c.this.c));
c cVar2 = c.this;
cVar2.c = (cVar2.c + 1) % arrayList.size();
}
c.this.d.postDelayed(this, 3000L);
}
}
public int B(q.y yVar, ArrayList<SearchResultsLocalPojoNew> arrayList) {
if (arrayList != null && !arrayList.isEmpty()) {
int size = arrayList.size();
for (int i = 0; i < size; i++) {
if (arrayList.get(i).getType().equalsIgnoreCase(yVar.a())) {
return i;
}
}
}
return -1;
}
private void C(String str, String str2) {
new p(getActivity(), new e(), "MFunds").j(str);
}
private void E() {
Config r0 = f0.r0();
String androidUrl = (r0 == null || r0.getSearchV2() == null || TextUtils.isEmpty(r0.getSearchV2().getAndroidUrl())) ? BuildConfig.FLAVOR : r0.getSearchV2().getAndroidUrl();
new x0(getActivity(), this).a(0, androidUrl, androidUrl, null, null, false, true);
}
private String F(Config config, String str) {
for (Section section : config.getOthers()) {
if (section.getId().equalsIgnoreCase(com.htmedia.mint.utils.q.d[3])) {
String url = section.getUrl();
if (url.contains("http")) {
return url;
}
return str + url;
}
}
return BuildConfig.FLAVOR;
}
private void G(String str, String str2) {
new g0(getActivity(), new d()).f(0, str, str, null, null, false, false);
}
private boolean H(String str, List<String> list) {
if (TextUtils.isEmpty(str) || list == null || list.isEmpty()) {
return false;
}
for (String str2 : list) {
if (!TextUtils.isEmpty(str2) && str2.trim().toLowerCase().contains(str.trim().toLowerCase())) {
return true;
}
}
return false;
}
public void I() {
int i = this.i + 1;
this.i = i;
if (i >= 3) {
this.a.e.setVisibility(0);
this.a.f.setVisibility(8);
} else {
this.a.e.setVisibility(8);
this.a.f.setVisibility(0);
}
}
private void J(SearchConfigPojo searchConfigPojo, int i) {
String type = searchConfigPojo.getL1Menu().get(i).getType();
type.hashCode();
switch (type) {
case "stocks":
n.A(getActivity(), n.U0, "stocks", "search_page_stocks", null, t);
break;
case "mutual_funds":
n.A(getActivity(), n.U0, "mutual_funds", "search_page_mutual_funds", null, t);
break;
case "trending_news":
n.A(getActivity(), n.U0, "trending_news", "search_page_trending_news", null, t);
break;
case "commodities":
n.A(getActivity(), n.U0, "commodities", "search_page_commodities", null, t);
break;
}
}
public void K(String str) {
String str2;
List<String> keyWords;
this.i = 0;
this.a.p.setVisibility(8);
this.a.i.setVisibility(8);
this.a.h.setVisibility(0);
this.a.f.setVisibility(0);
this.a.e.setVisibility(8);
this.f = new ArrayList<>();
n.F(getActivity(), "search_page", "search_click", "search", str, "search_page");
SearchConfigPojo searchConfigPojo = this.j;
if (searchConfigPojo != null && searchConfigPojo.getPersonalLoan() != null && this.j.getPersonalLoan().isEnable() && (keyWords = this.j.getPersonalLoan().getKeyWords()) != null && !keyWords.isEmpty() && H(str, keyWords)) {
SearchResultsLocalPojoNew searchResultsLocalPojoNew = new SearchResultsLocalPojoNew();
searchResultsLocalPojoNew.setType(q.y.PERSONAL_LOAN_BANNER.a());
searchResultsLocalPojoNew.setValue(this.j.getPersonalLoan().getUrl());
this.f.add(searchResultsLocalPojoNew);
}
SearchResultsLocalPojoNew searchResultsLocalPojoNew2 = new SearchResultsLocalPojoNew();
q.y yVar = q.y.TITLE;
searchResultsLocalPojoNew2.setType(yVar.a());
searchResultsLocalPojoNew2.setValue("Stocks");
this.f.add(searchResultsLocalPojoNew2);
SearchResultsLocalPojoNew searchResultsLocalPojoNew3 = new SearchResultsLocalPojoNew();
searchResultsLocalPojoNew3.setType(q.y.STOCK.a());
searchResultsLocalPojoNew3.setValue(str);
this.f.add(searchResultsLocalPojoNew3);
SearchResultsLocalPojoNew searchResultsLocalPojoNew4 = new SearchResultsLocalPojoNew();
searchResultsLocalPojoNew4.setType(yVar.a());
searchResultsLocalPojoNew4.setValue("News");
this.f.add(searchResultsLocalPojoNew4);
SearchResultsLocalPojoNew searchResultsLocalPojoNew5 = new SearchResultsLocalPojoNew();
searchResultsLocalPojoNew5.setType(q.y.NEWS.a());
searchResultsLocalPojoNew5.setValue(str);
SearchConfigPojo searchConfigPojo2 = this.j;
if (searchConfigPojo2 == null || searchConfigPojo2.getSearch() == null) {
searchResultsLocalPojoNew5.setMaxLimit(5);
} else {
searchResultsLocalPojoNew5.setMaxLimit(this.j.getSearch().getMaxNews());
}
this.f.add(searchResultsLocalPojoNew5);
SearchResultsLocalPojoNew searchResultsLocalPojoNew6 = new SearchResultsLocalPojoNew();
searchResultsLocalPojoNew6.setType(yVar.a());
searchResultsLocalPojoNew6.setValue("Mutual Funds");
this.f.add(searchResultsLocalPojoNew6);
SearchResultsLocalPojoNew searchResultsLocalPojoNew7 = new SearchResultsLocalPojoNew();
searchResultsLocalPojoNew7.setType(q.y.MUTUAL_FUNDS.a());
searchResultsLocalPojoNew7.setValue(str);
SearchConfigPojo searchConfigPojo3 = this.j;
if (searchConfigPojo3 == null || searchConfigPojo3.getSearch() == null) {
searchResultsLocalPojoNew7.setMaxLimit(5);
} else {
searchResultsLocalPojoNew7.setMaxLimit(this.j.getSearch().getMaxMutualFunds());
}
this.f.add(searchResultsLocalPojoNew7);
if (getActivity() != null) {
this.a.f.setLayoutManager(new LinearLayoutManager(getActivity()));
x6.d dVar = new x6.d(getActivity(), this.f);
this.e = dVar;
this.a.f.setAdapter(dVar);
p pVar = new p(getActivity(), new C0236c(), "tag");
if (f0.r0() != null) {
str2 = f0.r0().getMywatchlist().getSearchAlphabaticallyStocks() + "query=";
} else {
str2 = "https://api-mintgenie.livemint.com/api-gateway/fundamental/v2/searchFromIndustryTickerMaster?query=";
}
pVar.j(str2 + str);
String F = F(f0.r0(), f0.r0().getServerUrl());
if (TextUtils.isEmpty(F)) {
F = "https://www.livemint.com/api/cms/search/story?search=metadata.markUnimportant:false,metadata.killed:false,text:";
}
G(F + str, str);
C((!TextUtils.isEmpty(f0.r0().getMutualFundSearchUrl()) ? f0.r0().getMutualFundSearchUrl() : "https://api-mintgenie.livemint.com/api-gateway/fundamental/v2/searchFromMFMaster?") + "query=" + str, str);
}
}
public void displaySpeechRecognizer() {
Intent intent = new Intent("android.speech.action.RECOGNIZE_SPEECH");
intent.putExtra("android.speech.extra.LANGUAGE_MODEL", "free_form");
startActivityForResult(intent, 103);
}
private void goBack() {
try {
getActivity().onBackPressed();
} catch (ClassCastException e2) {
e2.printStackTrace();
} catch (Exception e3) {
e3.printStackTrace();
}
}
public int D(String str, SearchConfigPojo searchConfigPojo) {
for (int i = 0; i < searchConfigPojo.getL1Menu().size(); i++) {
if (searchConfigPojo.getL1Menu().get(i).getType().equalsIgnoreCase(str)) {
return i;
}
}
return 0;
}
@Override
public void afterTextChanged(Editable editable) {
CountDownTimer countDownTimer = this.g;
if (countDownTimer != null) {
countDownTimer.cancel();
}
this.g = new f(500L, 700L, editable).start();
}
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
@Override
public void getResponse(JSONObject jSONObject, String str) {
if (jSONObject != null) {
SearchConfigPojo searchConfigPojo = (SearchConfigPojo) new Gson().fromJson(jSONObject.toString(), SearchConfigPojo.class);
this.j = searchConfigPojo;
if (searchConfigPojo == null) {
this.a.e.setVisibility(0);
this.a.f.setVisibility(8);
this.a.p.setVisibility(8);
this.a.h.setVisibility(0);
return;
}
this.a.e.setVisibility(8);
this.a.f.setVisibility(0);
this.a.p.setVisibility(0);
this.a.h.setVisibility(8);
x6.e eVar = new x6.e(getActivity().getSupportFragmentManager(), this.j);
this.r = eVar;
this.a.q.setAdapter(eVar);
oj ojVar = this.a;
ojVar.i.setupWithViewPager(ojVar.q);
for (int i = 0; i < this.a.i.getTabCount(); i++) {
TabLayout.Tab tabAt = this.a.i.getTabAt(i);
if (tabAt != null) {
tabAt.setCustomView(2131625198);
TextView textView = (TextView) tabAt.getCustomView().findViewById(2131430769);
textView.setText(this.j.getL1Menu().get(i).getTitle());
if (i == 0) {
textView.setTypeface(ResourcesCompat.getFont(getActivity(), 2131296265));
}
}
}
this.a.i.addOnTabSelectedListener(this);
this.a.i.setSelectedTabIndicatorColor(Color.parseColor("#202020"));
J(this.j, 0);
this.d.post(this.s);
if (this.o) {
this.a.q.setCurrentItem(D("stocks", this.j));
} else if (this.p) {
this.a.q.setCurrentItem(D("mutual_funds", this.j));
}
}
}
public void onActivityResult(int i, int i2, Intent intent) {
if (i == 103 && i2 == -1) {
this.a.g.setText(intent.getStringArrayListExtra("android.speech.extra.RESULTS").get(0));
}
super.onActivityResult(i, i2, intent);
}
@Override
public void onClick(View view) {
Fragment a2;
int id2 = view.getId();
if (id2 == 2131428784) {
if (this.a.b.getVisibility() == 0) {
this.a.g.setText(BuildConfig.FLAVOR);
return;
} else {
goBack();
return;
}
}
if (id2 != 2131428803) {
return;
}
this.a.g.setText(BuildConfig.FLAVOR);
x6.e eVar = this.r;
if (eVar == null || (a2 = eVar.a()) == null || !(a2 instanceof y6.d)) {
return;
}
((y6.d) a2).s();
}
@Nullable
public View onCreateView(@NonNull LayoutInflater layoutInflater, @Nullable ViewGroup viewGroup, @Nullable Bundle bundle) {
oj c = oj.c(layoutInflater, viewGroup, false);
this.a = c;
c.e(l.x.a());
return this.a.getRoot();
}
public void onDestroy() {
super.onDestroy();
this.d.removeCallbacks(this.s);
}
@Override
public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
if (i != 3) {
return false;
}
if (this.a.g.getText().toString().length() < 3) {
Toast.makeText((Context) getActivity(), (CharSequence) "Please enter atleast three characters.", 0).show();
} else {
this.a.p.setVisibility(0);
this.a.i.setVisibility(0);
this.a.h.setVisibility(8);
}
return true;
}
@Override
public void onError(String str) {
this.a.p.setVisibility(8);
this.a.e.setVisibility(0);
this.a.h.setVisibility(0);
this.a.f.setVisibility(8);
}
public void onPageScrollStateChanged(int i) {
}
public void onPageScrolled(int i, float f2, int i2) {
}
public void onPageSelected(int i) {
o1.a("searchPageselected", i + BuildConfig.FLAVOR);
SearchConfigPojo searchConfigPojo = this.j;
if (searchConfigPojo != null) {
J(searchConfigPojo, i);
}
}
public void onResume() {
super.onResume();
getActivity();
}
public void onTabReselected(TabLayout.Tab tab) {
}
public void onTabSelected(TabLayout.Tab tab) {
((TextView) tab.getCustomView().findViewById(2131430769)).setTypeface(ResourcesCompat.getFont(getActivity(), 2131296265));
}
public void onTabUnselected(TabLayout.Tab tab) {
((TextView) tab.getCustomView().findViewById(2131430769)).setTypeface(ResourcesCompat.getFont(getActivity(), 2131296270));
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
if (charSequence.toString().length() > 0) {
this.a.b.setVisibility(0);
} else {
this.a.b.setVisibility(8);
}
}
public void onViewCreated(@NonNull View view, @Nullable Bundle bundle) {
super.onViewCreated(view, bundle);
this.i = 0;
n.A(getActivity(), n.U0, "search_page", "search_page", null, t);
this.a.g.addTextChangedListener(this);
this.a.g.setOnEditorActionListener(this);
this.a.b.setOnClickListener(this);
this.a.a.setOnClickListener(this);
this.a.d.setOnClickListener(new a());
E();
this.a.p.setVisibility(0);
this.a.i.setVisibility(0);
this.a.h.setVisibility(8);
this.a.q.addOnPageChangeListener(this);
this.a.c.setOnClickListener(new b());
Bundle arguments = getArguments();
if (arguments != null) {
if (arguments.containsKey("searchKeyword")) {
String string = arguments.getString("searchKeyword");
this.h = string;
this.a.g.setText(string);
}
if (arguments.containsKey("isStockSelected")) {
this.o = arguments.getBoolean("isStockSelected");
} else if (arguments.containsKey("isMutualFundSelected")) {
this.p = arguments.getBoolean("isMutualFundSelected");
}
}
}
}