正在查看: SpeedCash v6.5.1482 应用的 OtherHomeMenuActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: SpeedCash v6.5.1482 应用的 OtherHomeMenuActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.bm.sc.bebasbayar.ui.activity;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.SearchManager;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.res.ColorStateList;
import android.net.Uri;
import android.os.Bundle;
import android.view.Menu;
import android.view.MotionEvent;
import android.view.View;
import android.widget.HorizontalScrollView;
import android.widget.TextView;
import androidx.appcompat.widget.SearchView;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.bm.sc.auth.ui.BottomNavigationActivity;
import com.bm.sc.bebasbayar.R;
import com.bm.sc.bebasbayar.adapter.BaseAdapter;
import com.bm.sc.bebasbayar.adapter.entity.MenuListEntity;
import com.bm.sc.bebasbayar.adapter.entity.OtherMenuGroupEntity;
import com.bm.sc.bebasbayar.adapter.entity.SearchEntity;
import com.bm.sc.bebasbayar.adapter.grid.HomeGridAdapter;
import com.bm.sc.bebasbayar.adapter.list.OtherMenuGridAdapter;
import com.bm.sc.bebasbayar.adapter.list.SearchMenuAdapter;
import com.bm.sc.bebasbayar.handler.FirebaseProcessor;
import com.bm.sc.bebasbayar.handler.MessageComposer;
import com.bm.sc.bebasbayar.handler.MessageSender;
import com.bm.sc.bebasbayar.helper.Affinity;
import com.bm.sc.bebasbayar.helper.BelanjaSearchHelper;
import com.bm.sc.bebasbayar.iface.AdapterInvoker;
import com.bm.sc.bebasbayar.iface.MessageProcess;
import com.bm.sc.bebasbayar.message.BaseMessage;
import com.bm.sc.bebasbayar.message.MPMessage;
import com.bm.sc.bebasbayar.message.api.APIMessageWrapper;
import com.bm.sc.bebasbayar.message.mp.AsuransiMessage;
import com.bm.sc.bebasbayar.message.qr.DataMessage;
import com.bm.sc.bebasbayar.setting.MenuConfig;
import com.bm.sc.bebasbayar.setting.session.AppSession;
import com.bm.sc.bebasbayar.setting.session.ConfigSession;
import com.bm.sc.bebasbayar.ui.BaseActivity;
import com.bm.sc.bebasbayar.ui.activity.OtherHomeMenuActivity;
import com.bm.sc.bebasbayar.ui.activity.cash.TransferWithdrawActivity;
import com.bm.sc.bebasbayar.ui.activity.info.OpenWebViewActivity;
import com.bm.sc.bebasbayar.ui.activity.ubp.AsuransiActivity;
import com.bm.sc.bebasbayar.ui.activity.ubp.PajakNegaraActivity;
import com.bm.sc.util.android.Device;
import com.bm.sc.util.common.Var;
import com.google.android.material.chip.Chip;
import com.google.android.material.chip.ChipGroup;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import java.util.regex.Pattern;
public class OtherHomeMenuActivity extends BaseActivity implements AdapterInvoker<MenuListEntity>, View.OnTouchListener, SearchMenuAdapter.OnClickListener {
public static final Pattern x = Pattern.compile("(?i)((?:http|https|file):\\/\\/|(?:inline|data|about|chrome|javascript):)(.*)");
public final String TAG = OtherHomeMenuActivity.class.getSimpleName();
public final Comparator<MenuListEntity> c = new Comparator() {
@Override
public final int compare(Object obj, Object obj2) {
int M;
M = OtherHomeMenuActivity.M((MenuListEntity) obj, (MenuListEntity) obj2);
return M;
}
};
public RecyclerView d;
public OtherMenuGridAdapter e;
public ArrayList<MenuListEntity> f;
public ArrayList<String> g;
public RecyclerView.LayoutManager h;
public ArrayList<OtherMenuGroupEntity> i;
public ArrayList<OtherMenuGroupEntity> j;
public ChipGroup k;
public ConstraintLayout l;
public HomeGridAdapter m;
public RecyclerView n;
public RecyclerView o;
public Timer p;
public ArrayList<SearchEntity> q;
public SearchMenuAdapter r;
public HorizontalScrollView s;
public TextView t;
public TextView u;
public TextView v;
public TextView w;
public class a implements SearchView.OnQueryTextListener {
public class C0027a extends TimerTask {
public final String a;
public C0027a(String str) {
this.a = str;
}
public void b(String str) {
OtherHomeMenuActivity.this.t.setVisibility(0);
OtherHomeMenuActivity.this.u.setVisibility(0);
OtherHomeMenuActivity.this.q = new ArrayList();
OtherHomeMenuActivity.this.r.setBankAccountEntities(OtherHomeMenuActivity.this.q);
if (str.length() > 2) {
OtherHomeMenuActivity.this.l.setVisibility(8);
OtherHomeMenuActivity.this.J(str);
return;
}
if (str.length() == 1) {
OtherHomeMenuActivity.this.l.setVisibility(8);
return;
}
OtherHomeMenuActivity.this.l.setVisibility(0);
OtherHomeMenuActivity.this.o.setVisibility(8);
OtherHomeMenuActivity.this.s.setVisibility(8);
OtherHomeMenuActivity.this.t.setText("Hasil pencarian");
OtherHomeMenuActivity.this.u.setText("");
OtherHomeMenuActivity.this.v.setText("Ketik minimal 3 karakter");
OtherHomeMenuActivity.this.w.setText("Biar kamu bisa dapet hasil pencarian");
OtherHomeMenuActivity.this.r.notifyDataSetChanged();
}
@Override
public void run() {
SearchView.OnQueryTextListener onQueryTextListener = OtherHomeMenuActivity.this;
final String str = this.a;
onQueryTextListener.runOnUiThread(new Runnable() {
@Override
public final void run() {
OtherHomeMenuActivity.a.C0027a.this.b(str);
}
});
}
}
public a() {
}
public boolean onQueryTextChange(String str) {
if (str.equals("")) {
OtherHomeMenuActivity.this.n.setVisibility(8);
OtherHomeMenuActivity.this.d.setVisibility(0);
OtherHomeMenuActivity.this.l.setVisibility(8);
OtherHomeMenuActivity.this.o.setVisibility(8);
OtherHomeMenuActivity.this.s.setVisibility(0);
OtherHomeMenuActivity.this.t.setVisibility(8);
OtherHomeMenuActivity.this.u.setVisibility(8);
return true;
}
OtherHomeMenuActivity.this.d.setVisibility(8);
OtherHomeMenuActivity.this.o.setVisibility(0);
OtherHomeMenuActivity.this.s.setVisibility(8);
if (OtherHomeMenuActivity.this.p != null) {
OtherHomeMenuActivity.this.p.cancel();
}
OtherHomeMenuActivity.this.p = new Timer();
OtherHomeMenuActivity.this.p.schedule(new C0027a(str), 1500L);
return true;
}
public boolean onQueryTextSubmit(String str) {
return true;
}
}
public class b implements View.OnClickListener {
public b() {
}
@Override
public void onClick(View view) {
String charSequence = ((Chip) view).getText().toString();
for (int i = 0; i < OtherHomeMenuActivity.this.k.getChildCount(); i++) {
Chip childAt = OtherHomeMenuActivity.this.k.getChildAt(i);
if (charSequence.contentEquals(childAt.getText())) {
childAt.setChipBackgroundColor(ColorStateList.valueOf(ContextCompat.getColor(OtherHomeMenuActivity.this.getApplicationContext(), R.color.colorPrimaryAlt)));
childAt.setTextColor(ColorStateList.valueOf(ContextCompat.getColor(OtherHomeMenuActivity.this.getApplicationContext(), 2131100792)));
} else {
childAt.setChipBackgroundColor(ColorStateList.valueOf(ContextCompat.getColor(OtherHomeMenuActivity.this.getApplicationContext(), R.color.WhiteSmoke)));
childAt.setTextColor(ColorStateList.valueOf(ContextCompat.getColor(OtherHomeMenuActivity.this.getApplicationContext(), R.color.colorPrimaryAlt)));
}
}
OtherHomeMenuActivity otherHomeMenuActivity = OtherHomeMenuActivity.this;
?? r2 = OtherHomeMenuActivity.this;
otherHomeMenuActivity.e = new OtherMenuGridAdapter(r2.j, r2);
OtherHomeMenuActivity otherHomeMenuActivity2 = OtherHomeMenuActivity.this;
otherHomeMenuActivity2.d.setAdapter(otherHomeMenuActivity2.e);
OtherHomeMenuActivity.this.d.setVisibility(0);
OtherHomeMenuActivity.this.n.setVisibility(8);
OtherHomeMenuActivity.this.d.setVisibility(0);
OtherHomeMenuActivity.this.l.setVisibility(8);
}
}
public class c implements View.OnClickListener {
public c() {
}
@Override
public void onClick(View view) {
String charSequence = ((Chip) view).getText().toString();
for (int i = 0; i < OtherHomeMenuActivity.this.k.getChildCount(); i++) {
Chip childAt = OtherHomeMenuActivity.this.k.getChildAt(i);
if (charSequence.contentEquals(childAt.getText())) {
childAt.setChipBackgroundColor(ColorStateList.valueOf(ContextCompat.getColor(OtherHomeMenuActivity.this.getApplicationContext(), R.color.colorPrimaryAlt)));
childAt.setTextColor(ColorStateList.valueOf(ContextCompat.getColor(OtherHomeMenuActivity.this.getApplicationContext(), 2131100792)));
} else {
childAt.setChipBackgroundColor(ColorStateList.valueOf(ContextCompat.getColor(OtherHomeMenuActivity.this.getApplicationContext(), R.color.WhiteSmoke)));
childAt.setTextColor(ColorStateList.valueOf(ContextCompat.getColor(OtherHomeMenuActivity.this.getApplicationContext(), R.color.colorPrimaryAlt)));
}
}
ArrayList arrayList = new ArrayList();
if (OtherHomeMenuActivity.this.j != null) {
for (int i2 = 0; i2 < OtherHomeMenuActivity.this.j.size(); i2++) {
if (Var.toString(OtherHomeMenuActivity.this.j.get(i2).getTitle(), "").equals(charSequence)) {
arrayList.add(OtherHomeMenuActivity.this.j.get(i2));
}
}
}
OtherHomeMenuActivity.this.e = new OtherMenuGridAdapter(arrayList, OtherHomeMenuActivity.this);
OtherHomeMenuActivity otherHomeMenuActivity = OtherHomeMenuActivity.this;
otherHomeMenuActivity.d.setAdapter(otherHomeMenuActivity.e);
OtherHomeMenuActivity.this.d.setVisibility(0);
OtherHomeMenuActivity.this.n.setVisibility(8);
OtherHomeMenuActivity.this.d.setVisibility(0);
OtherHomeMenuActivity.this.l.setVisibility(8);
}
}
public class d implements MessageProcess {
public class a implements Runnable {
public final MenuListEntity a;
public final String b;
public class ViewOnClickListenerC0028a implements View.OnClickListener {
public ViewOnClickListenerC0028a() {
}
@Override
public void onClick(View view) {
String charSequence = ((Chip) view).getText().toString();
for (int i = 0; i < OtherHomeMenuActivity.this.k.getChildCount(); i++) {
Chip childAt = OtherHomeMenuActivity.this.k.getChildAt(i);
if (charSequence.contentEquals(childAt.getText())) {
childAt.setChipBackgroundColor(ColorStateList.valueOf(ContextCompat.getColor(OtherHomeMenuActivity.this.getApplicationContext(), R.color.colorPrimaryAlt)));
childAt.setTextColor(ColorStateList.valueOf(ContextCompat.getColor(OtherHomeMenuActivity.this.getApplicationContext(), 2131100792)));
} else {
childAt.setChipBackgroundColor(ColorStateList.valueOf(ContextCompat.getColor(OtherHomeMenuActivity.this.getApplicationContext(), R.color.WhiteSmoke)));
childAt.setTextColor(ColorStateList.valueOf(ContextCompat.getColor(OtherHomeMenuActivity.this.getApplicationContext(), R.color.colorPrimaryAlt)));
}
}
ArrayList arrayList = new ArrayList();
for (int i2 = 0; i2 < OtherHomeMenuActivity.this.j.size(); i2++) {
if (Var.toString(OtherHomeMenuActivity.this.j.get(i2).getTitle(), "").equals(charSequence)) {
arrayList.add(OtherHomeMenuActivity.this.j.get(i2));
}
}
OtherHomeMenuActivity.this.e = new OtherMenuGridAdapter(arrayList, OtherHomeMenuActivity.this);
OtherHomeMenuActivity otherHomeMenuActivity = OtherHomeMenuActivity.this;
otherHomeMenuActivity.d.setAdapter(otherHomeMenuActivity.e);
OtherHomeMenuActivity.this.d.setVisibility(0);
OtherHomeMenuActivity.this.n.setVisibility(8);
OtherHomeMenuActivity.this.d.setVisibility(0);
OtherHomeMenuActivity.this.l.setVisibility(8);
}
}
public a(MenuListEntity menuListEntity, String str) {
this.a = menuListEntity;
this.b = str;
}
@Override
public void run() {
boolean z = false;
for (int i = 0; i < OtherHomeMenuActivity.this.f.size(); i++) {
if (OtherHomeMenuActivity.this.f.get(i).getTitle().equals(this.a.getTitle())) {
z = true;
}
}
if (!z) {
OtherHomeMenuActivity.this.f.add(this.a);
}
OtherHomeMenuActivity otherHomeMenuActivity = OtherHomeMenuActivity.this;
Collections.sort(otherHomeMenuActivity.f, otherHomeMenuActivity.c);
OtherHomeMenuActivity.this.m.updateList(OtherHomeMenuActivity.this.f);
if (OtherHomeMenuActivity.this.g.contains(this.b)) {
return;
}
OtherHomeMenuActivity.this.g.add(this.b);
Chip chip = new Chip(OtherHomeMenuActivity.this);
chip.setChipBackgroundColor(ColorStateList.valueOf(ContextCompat.getColor(OtherHomeMenuActivity.this.getApplicationContext(), R.color.WhiteSmoke)));
chip.setTextColor(ColorStateList.valueOf(ContextCompat.getColor(OtherHomeMenuActivity.this.getApplicationContext(), R.color.colorPrimaryAlt)));
OtherHomeMenuActivity.this.k.addView(chip);
chip.setText(this.b);
chip.setOnClickListener(new ViewOnClickListenerC0028a());
}
}
public d() {
}
@Override
@SuppressLint({"NotifyDataSetChanged"})
public void afterProcess(BaseMessage baseMessage) {
APIMessageWrapper aPIMessageWrapper = new APIMessageWrapper(baseMessage);
ArrayList arrayList = new ArrayList();
if (aPIMessageWrapper.isOK()) {
Iterator<HashMap<String, Object>> it = aPIMessageWrapper.getData().iterator();
while (it.hasNext()) {
HashMap<String, Object> next = it.next();
String var = Var.toString(next.get(FirebaseProcessor.KEY_TITLE), "");
String var2 = Var.toString(next.get("icon"), "");
String var3 = Var.toString(next.get("url"), "");
String var4 = Var.toString(next.get("package"), "");
String var5 = Var.toString(next.get("kategori"), "Lainnya");
MenuListEntity menuListEntity = new MenuListEntity(var, var2, var3, Var.toString(next.get("interface"), ""));
menuListEntity.setEnabled(true);
menuListEntity.setAppPackage(var4);
menuListEntity.setKategori(var5);
menuListEntity.setUrutan(OtherHomeMenuActivity.this.f.size() + 1);
OtherHomeMenuActivity.this.runOnUiThread(new a(menuListEntity, var5));
boolean z = false;
for (int i = 0; i < OtherHomeMenuActivity.this.i.size(); i++) {
if (Var.toString(OtherHomeMenuActivity.this.i.get(i).getTitle(), "").equalsIgnoreCase(Var.toString(menuListEntity.getKategori(), ""))) {
ArrayList<MenuListEntity> data = OtherHomeMenuActivity.this.i.get(i).getData();
data.add(menuListEntity);
OtherHomeMenuActivity.this.i.get(i).setData(data);
z = true;
}
}
if (!z) {
arrayList.add(menuListEntity);
}
}
}
if (arrayList.size() > 0) {
OtherHomeMenuActivity.this.i.add(new OtherMenuGroupEntity(((MenuListEntity) arrayList.get(0)).getKategori(), arrayList));
OtherHomeMenuActivity otherHomeMenuActivity = OtherHomeMenuActivity.this;
?? r1 = OtherHomeMenuActivity.this;
otherHomeMenuActivity.e = new OtherMenuGridAdapter(r1.i, r1);
OtherHomeMenuActivity.this.e.notifyDataSetChanged();
}
if (OtherHomeMenuActivity.this.i.size() > 0) {
OtherHomeMenuActivity otherHomeMenuActivity2 = OtherHomeMenuActivity.this;
?? r12 = OtherHomeMenuActivity.this;
otherHomeMenuActivity2.e = new OtherMenuGridAdapter(r12.i, r12);
OtherHomeMenuActivity.this.e.notifyDataSetChanged();
}
OtherHomeMenuActivity otherHomeMenuActivity3 = OtherHomeMenuActivity.this;
otherHomeMenuActivity3.j = otherHomeMenuActivity3.i;
}
@Override
public void backgroundProcess(long j, long j2, boolean z) {
}
@Override
public void preProcess() {
}
}
public class e implements MessageProcess {
public e() {
}
@Override
public void afterProcess(BaseMessage baseMessage) {
APIMessageWrapper aPIMessageWrapper = new APIMessageWrapper(baseMessage);
OtherHomeMenuActivity.this.t.setVisibility(0);
OtherHomeMenuActivity.this.u.setVisibility(0);
if (!aPIMessageWrapper.isOK()) {
OtherHomeMenuActivity.this.l.setVisibility(0);
OtherHomeMenuActivity.this.o.setVisibility(8);
OtherHomeMenuActivity.this.d.setVisibility(8);
OtherHomeMenuActivity.this.s.setVisibility(8);
OtherHomeMenuActivity.this.t.setText("Hasil pencarian");
OtherHomeMenuActivity.this.u.setText("");
OtherHomeMenuActivity.this.v.setText("Tidak ditemukan hasil untuk pencarian");
OtherHomeMenuActivity.this.w.setText("Coba lagi dengan kata kunci berbeda");
return;
}
ArrayList<HashMap<String, Object>> data = aPIMessageWrapper.getData();
if (data != null) {
for (int i = 0; i < data.size(); i++) {
SearchEntity searchEntity = new SearchEntity();
searchEntity.setId_search(Var.toInt(data.get(i).get("id_search"), 0));
searchEntity.setLabel_menu(Var.toString(data.get(i).get("label_menu"), ""));
searchEntity.setId_group_produk(Var.toInt(data.get(i).get("id_group_produk"), 0));
searchEntity.setGroup_produk(Var.toString(data.get(i).get("group_produk"), ""));
searchEntity.setId_produk(Var.toString(data.get(i).get("id_produk"), ""));
searchEntity.setActivity(Var.toString(data.get(i).get("activity"), ""));
searchEntity.setSearch_image(Var.toString(data.get(i).get("search_image"), ""));
searchEntity.setGroup_produk_image(Var.toString(data.get(i).get("group_produk_image"), ""));
if (!Var.toString(data.get(i).get("activity"), "").equals("pages/vouchergame")) {
OtherHomeMenuActivity.this.q.add(searchEntity);
} else if (((BaseActivity) OtherHomeMenuActivity.this).appSession.isTesterUser()) {
return;
} else {
OtherHomeMenuActivity.this.q.add(searchEntity);
}
}
OtherHomeMenuActivity.this.r.notifyDataSetChanged();
}
if (OtherHomeMenuActivity.this.q != null && OtherHomeMenuActivity.this.q.size() == 0) {
OtherHomeMenuActivity.this.l.setVisibility(0);
OtherHomeMenuActivity.this.o.setVisibility(8);
OtherHomeMenuActivity.this.d.setVisibility(8);
OtherHomeMenuActivity.this.s.setVisibility(8);
OtherHomeMenuActivity.this.t.setText("Hasil pencarian");
OtherHomeMenuActivity.this.u.setText("");
OtherHomeMenuActivity.this.v.setText("Tidak ditemukan hasil untuk pencarian");
OtherHomeMenuActivity.this.w.setText("Coba lagi dengan kata kunci berbeda");
return;
}
OtherHomeMenuActivity.this.l.setVisibility(8);
OtherHomeMenuActivity.this.o.setVisibility(0);
OtherHomeMenuActivity.this.d.setVisibility(8);
OtherHomeMenuActivity.this.s.setVisibility(8);
OtherHomeMenuActivity.this.t.setText("Hasil pencarian ");
OtherHomeMenuActivity.this.u.setText(String.valueOf(OtherHomeMenuActivity.this.q.size()) + " layanan");
}
@Override
public void backgroundProcess(long j, long j2, boolean z) {
}
@Override
public void preProcess() {
}
}
public static boolean K(IntentFilter intentFilter) {
return intentFilter == null || (intentFilter.countDataAuthorities() == 0 && intentFilter.countDataPaths() == 0);
}
public static boolean L(Context context, Intent intent) {
List<ResolveInfo> queryIntentActivities = context.getPackageManager().queryIntentActivities(intent, 64);
if (queryIntentActivities != null && queryIntentActivities.size() != 0) {
Iterator<ResolveInfo> it = queryIntentActivities.iterator();
while (it.hasNext()) {
if (!K(it.next().filter)) {
return true;
}
}
}
return false;
}
public static int M(MenuListEntity menuListEntity, MenuListEntity menuListEntity2) {
return menuListEntity.getUrutan() - menuListEntity2.getUrutan();
}
public void N(View view) {
if (isTaskRoot()) {
Affinity.purge(this, BottomNavigationActivity.class);
} else {
finish();
}
}
public final void H() {
MessageComposer messageComposer = new MessageComposer(7, "addon/list");
messageComposer.setRequest_method(MessageComposer.POST);
messageComposer.setData_type(1);
messageComposer.setIs_credential(false);
messageComposer.setIs_encrypted(false);
messageComposer.setShowProgressRegular(false);
messageComposer.addMessage(DataMessage.PIN, this.appSession.retrieve(AppSession.PROPERTY_MERCHANT_PIN));
messageComposer.addMessage(MPMessage.IncludeMessage.TOKEN, this.appSession.retrieve(AppSession.PROPERTY_AUTH_TOKEN));
messageComposer.addMessage("outlet_id", this.appSession.retrieve(AppSession.PROPERTY_MERCHANT_ID));
messageComposer.addMessage(BaseMessage.INDEX_VIA, "BB ANDROID");
messageComposer.setMessageProcess(new d());
new MessageSender(getApplicationContext(), messageComposer).execute();
}
public final boolean I(String str, Context context) {
try {
context.getPackageManager().getPackageInfo(str, 1);
return true;
} catch (PackageManager.NameNotFoundException unused) {
return false;
}
}
public final void J(String str) {
APIMessageWrapper aPIMessageWrapper = new APIMessageWrapper();
aPIMessageWrapper.setItem(DataMessage.ID_OUTLET, this.appSession.retrieve(AppSession.PROPERTY_MERCHANT_ID));
aPIMessageWrapper.setItem("user_id", this.appSession.retrieve(AppSession.PROPERTY_MERCHANT_ID));
aPIMessageWrapper.setItem("user_uuid", Device.getDeviceUUID(this));
aPIMessageWrapper.setItem(BelanjaSearchHelper.POPULAR_SEARCH_NAME, Var.toString(str, ""));
MessageComposer messageComposer = new MessageComposer(7, "ro/menu/search");
messageComposer.setShowProgressRegular(false);
messageComposer.setIs_encrypted(false);
messageComposer.setMessageProcess(new e());
MessageSender messageSender = new MessageSender(this, messageComposer);
messageSender.setRequestMessage(aPIMessageWrapper);
messageSender.execute();
}
public final void O() {
this.s = (HorizontalScrollView) findViewById(R.id.horizontal_scroll);
this.f = new ArrayList<>();
this.f = MenuConfig.getListHomeGridMain(this.configSession, this.appSession.isTesterUser());
this.h = new LinearLayoutManager(getApplicationContext());
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.rv_parent_menu);
this.d = recyclerView;
recyclerView.setVisibility(0);
this.l.setVisibility(8);
this.d.setNestedScrollingEnabled(false);
this.d.setLayoutManager(this.h);
this.d.setNestedScrollingEnabled(false);
this.g = new ArrayList<>();
for (int i = 0; i < this.f.size(); i++) {
if (!this.g.contains(this.f.get(i).getKategori())) {
this.g.add(this.f.get(i).getKategori());
}
}
this.k = findViewById(R.id.chip_group_filter);
Chip chip = new Chip(this);
chip.setChipBackgroundColor(ColorStateList.valueOf(ContextCompat.getColor(getApplicationContext(), R.color.WhiteSmoke)));
chip.setTextColor(ColorStateList.valueOf(ContextCompat.getColor(getApplicationContext(), R.color.colorPrimaryAlt)));
chip.setText("Semua");
this.k.addView(chip);
chip.setOnClickListener(new b());
for (int i2 = 0; i2 < this.g.size(); i2++) {
Chip chip2 = new Chip(this);
chip2.setText(this.g.get(i2));
chip2.setChipBackgroundColor(ColorStateList.valueOf(ContextCompat.getColor(getApplicationContext(), R.color.WhiteSmoke)));
chip2.setTextColor(ColorStateList.valueOf(ContextCompat.getColor(getApplicationContext(), R.color.colorPrimaryAlt)));
this.k.addView(chip2);
chip2.setOnClickListener(new c());
}
this.i = new ArrayList<>();
if (this.g.size() > 0) {
for (int i3 = 0; i3 < this.g.size(); i3++) {
ArrayList arrayList = new ArrayList();
for (int i4 = 0; i4 < this.f.size(); i4++) {
if (this.g.get(i3) != null && this.f.get(i4).getKategori().equals(this.g.get(i3))) {
arrayList.add(this.f.get(i4));
}
}
Collections.sort(arrayList, this.c);
this.i.add(new OtherMenuGroupEntity(this.g.get(i3), arrayList));
}
}
OtherMenuGridAdapter otherMenuGridAdapter = new OtherMenuGridAdapter(this.i, this);
this.e = otherMenuGridAdapter;
this.d.setAdapter(otherMenuGridAdapter);
P();
}
public final void P() {
GridLayoutManager gridLayoutManager = new GridLayoutManager(this, getResources().getInteger(R.integer.home_grid_column));
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.rv_detail_menu);
this.n = recyclerView;
recyclerView.setVisibility(8);
this.n.setNestedScrollingEnabled(false);
this.n.setLayoutManager(gridLayoutManager);
this.n.setFocusable(false);
this.m = new HomeGridAdapter(this);
ArrayList<MenuListEntity> listHomeGridMain = MenuConfig.getListHomeGridMain(this.configSession, this.appSession.isTesterUser());
this.f = listHomeGridMain;
Collections.sort(listHomeGridMain, this.c);
this.m.updateList(this.f);
this.n.setAdapter(this.m);
H();
SearchMenuAdapter searchMenuAdapter = new SearchMenuAdapter(this);
this.r = searchMenuAdapter;
searchMenuAdapter.setOnCashOutListener(this);
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this, 1, false);
RecyclerView recyclerView2 = (RecyclerView) findViewById(R.id.rv_search_menu);
this.o = recyclerView2;
recyclerView2.setVisibility(8);
this.o.setNestedScrollingEnabled(true);
this.o.setLayoutManager(linearLayoutManager);
this.o.setAdapter(this.r);
}
public final boolean Q(Context context, MenuListEntity menuListEntity) {
try {
Intent parseUri = Intent.parseUri(menuListEntity.getUrl(), 1);
if (x.matcher(menuListEntity.getUrl()).matches() && !L(context, parseUri)) {
return false;
}
parseUri.addCategory("android.intent.category.BROWSABLE");
parseUri.setComponent(null);
Intent selector = parseUri.getSelector();
if (selector != null) {
selector.addCategory("android.intent.category.BROWSABLE");
selector.setComponent(null);
}
parseUri.putExtra("com.android.browser.application_id", context.getPackageName());
try {
context.startActivity(parseUri);
return true;
} catch (ActivityNotFoundException unused) {
StringBuilder sb = new StringBuilder();
sb.append("No application can handle %s");
sb.append(menuListEntity.getUrl());
return false;
} catch (SecurityException unused2) {
StringBuilder sb2 = new StringBuilder();
sb2.append("SecurityException when starting intent for %s");
sb2.append(menuListEntity.getUrl());
return false;
}
} catch (Exception e2) {
StringBuilder sb3 = new StringBuilder();
sb3.append("Bad URI %s");
sb3.append(menuListEntity.getUrl());
sb3.append(e2);
return false;
}
}
@Override
public Activity getInvokerActivity() {
return this;
}
@Override
public int getLayoutResource() {
return R.layout.activity_other_home_menu;
}
@Override
public String getWikiNameSpace() {
return null;
}
@Override
public boolean isEligibleForFavorit() {
return false;
}
@Override
public void onChoose(SearchEntity searchEntity) {
String[] split = Var.toString(searchEntity.getActivity(), "").split("/");
Class<? extends Activity> sessionSelector = Affinity.sessionSelector(this, MenuConfig.pathSelector(Var.getIgnoreBound(split, 0, ""), Var.getIgnoreBound(split, 1, ""), Var.getIgnoreBound(split, 2, "")));
Bundle bundle = new Bundle();
if (split[1].equals("bpjsks")) {
bundle.putString(AsuransiActivity.SELECTED_PRODUCT_TAG, AsuransiMessage.ASRBPJSKS);
}
if (split[1].equals("kua")) {
bundle.putString(PajakNegaraActivity.TIPE_MPN, PajakNegaraActivity.KUA);
bundle.putString(PajakNegaraActivity.LABEL, "Kode Billing/Kode Bayar");
bundle.putString(PajakNegaraActivity.HINT, "Masukkan Kode Billing/Kode Bayar");
bundle.putString(PajakNegaraActivity.TITTLE, "Bayar KUA");
bundle.putString(PajakNegaraActivity.STRUK_LABEL, "PEMBAYARAN KUA");
}
if (split[1].equals("etilang")) {
bundle.putString(PajakNegaraActivity.TIPE_MPN, PajakNegaraActivity.E_TILANG);
bundle.putString(PajakNegaraActivity.LABEL, "Kode Billing/Kode Bayar");
bundle.putString(PajakNegaraActivity.HINT, "Masukkan Kode Billing/Kode Bayar");
bundle.putString(PajakNegaraActivity.TITTLE, "E-Tilang");
bundle.putString(PajakNegaraActivity.STRUK_LABEL, "PEMBAYARAN E-TILANG");
}
if (split[1].equals("spt")) {
bundle.putString(PajakNegaraActivity.TIPE_MPN, PajakNegaraActivity.SPT);
bundle.putString(PajakNegaraActivity.LABEL, "Kode Billing/Kode Bayar");
bundle.putString(PajakNegaraActivity.HINT, "Masukkan Kode Billing/Kode Bayar");
bundle.putString(PajakNegaraActivity.TITTLE, "Pajak SPT");
bundle.putString(PajakNegaraActivity.STRUK_LABEL, "PEMBAYARAN PAJAK SPT");
}
if (split[1].equals("paspor")) {
bundle.putString(PajakNegaraActivity.TIPE_MPN, PajakNegaraActivity.PASPOR);
bundle.putString(PajakNegaraActivity.LABEL, "Kode Billing/Kode Bayar");
bundle.putString(PajakNegaraActivity.HINT, "Masukkan Kode Billing/Kode Bayar");
bundle.putString(PajakNegaraActivity.TITTLE, "Bayar Paspor");
bundle.putString(PajakNegaraActivity.STRUK_LABEL, "PEMBAYARAN PASPOR");
}
bundle.putBoolean(AppSession.IS_FROM_NEW_HOME, true);
bundle.putString("group_produk", searchEntity.getGroup_produk());
if (searchEntity.getId_group_produk() > 0) {
bundle.putInt("id_group_produk", searchEntity.getId_group_produk());
}
bundle.putString("id_produk", searchEntity.getId_produk());
bundle.putString(TransferWithdrawActivity.KEY_ALL, TransferWithdrawActivity.RESULT_WITHDRAW);
bundle.putString(TransferWithdrawActivity.KEY_TYPE, TransferWithdrawActivity.FROM_MENU);
Intent intent = new Intent((Context) this, (Class<?>) sessionSelector);
intent.putExtras(bundle);
intent.setData(Uri.parse("custom://" + System.currentTimeMillis()));
intent.setFlags(268468224);
startActivity(intent);
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
this.configSession = new ConfigSession(this);
getToolbar().setNavigationOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
OtherHomeMenuActivity.this.N(view);
}
});
ConstraintLayout findViewById = findViewById(R.id.constraintLayoutEmptyFilter);
this.l = findViewById;
findViewById.setVisibility(8);
this.t = (TextView) findViewById(R.id.textViewResult);
this.u = (TextView) findViewById(R.id.textViewResult2);
this.t.setVisibility(8);
this.u.setVisibility(8);
this.v = (TextView) findViewById(R.id.textViewTittle);
this.w = (TextView) findViewById(R.id.textViewTittle2);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main, menu);
menu.findItem(R.id.menu_item_search).setVisible(true);
menu.findItem(R.id.menu_item_set_favorit).setVisible(false);
SearchManager searchManager = (SearchManager) getSystemService(BelanjaSearchHelper.POPULAR_SEARCH_NAME);
SearchView actionView = menu.findItem(R.id.menu_item_search).getActionView();
searchManager.getSearchableInfo(getComponentName());
actionView.setOnQueryTextListener(new a());
return true;
}
@Override
public void onResume() {
super.onResume();
ConstraintLayout findViewById = findViewById(R.id.constraintLayoutEmptyFilter);
this.l = findViewById;
findViewById.setVisibility(8);
O();
}
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
return false;
}
@Override
public void adapterResult(BaseAdapter baseAdapter, MenuListEntity menuListEntity, int i) {
this.appSession.store(AppSession.IS_FROM_NEW_HOME, "true");
this.appSession.store(AppSession.IS_FROM_ONE_CLICK, "false");
if (getClass().equals(menuListEntity.getActivity())) {
return;
}
if (menuListEntity.getTitle().equalsIgnoreCase("transfer 147 bank") && i == 1) {
Bundle bundle = new Bundle();
bundle.putString("tittle", menuListEntity.getTitle());
bundle.putBoolean(AppSession.IS_FROM_NEW_HOME, true);
bundle.putBoolean(AppSession.IS_FROM_ONE_CLICK, false);
bundle.putString(TransferWithdrawActivity.KEY_ALL, TransferWithdrawActivity.RESULT_WITHDRAW);
bundle.putString(TransferWithdrawActivity.KEY_TYPE, TransferWithdrawActivity.FROM_MENU);
Affinity.launch(getInvokerActivity(), TransferWithdrawActivity.class, bundle);
return;
}
if (menuListEntity.getLaunch_mode() == 3) {
String url = menuListEntity.getUrl();
try {
getInvokerActivity().startActivity(new Intent("android.intent.action.VIEW", Uri.parse("market://details?id=" + url)));
return;
} catch (ActivityNotFoundException unused) {
getInvokerActivity().startActivity(new Intent("android.intent.action.VIEW", Uri.parse("https://play.google.com/store/apps/details?id=" + url)));
return;
}
}
if (menuListEntity.getUrl() == null) {
if (menuListEntity.getBundle() == null) {
Bundle bundle2 = new Bundle();
bundle2.putBoolean(AppSession.IS_FROM_NEW_HOME, true);
bundle2.putBoolean(AppSession.IS_FROM_ONE_CLICK, false);
bundle2.putString("tittle", menuListEntity.getTitle());
menuListEntity.setBundle(bundle2);
} else {
menuListEntity.getBundle().putString("tittle", menuListEntity.getTitle());
}
menuListEntity.getBundle().putBoolean(AppSession.IS_FROM_NEW_HOME, true);
menuListEntity.getBundle().putBoolean(AppSession.IS_FROM_ONE_CLICK, false);
Affinity.purge(getInvokerActivity(), menuListEntity.getActivity(), menuListEntity.getBundle(), 100);
return;
}
if (getInvokerActivity() != null) {
if (I(menuListEntity.getAppPackage(), getInvokerActivity())) {
getInvokerActivity().startActivity(getInvokerActivity().getPackageManager().getLaunchIntentForPackage(menuListEntity.getAppPackage()));
return;
}
if (Q(getInvokerActivity(), menuListEntity)) {
return;
}
Bundle bundle3 = new Bundle();
bundle3.putString("url", menuListEntity.getUrl());
bundle3.putString(FirebaseProcessor.KEY_TITLE, menuListEntity.getTitle());
bundle3.putBoolean(AppSession.IS_FROM_NEW_HOME, true);
bundle3.putBoolean(AppSession.IS_FROM_ONE_CLICK, false);
bundle3.putString("interface:name", menuListEntity.getInterfaceName());
Intent intent = new Intent(getInvokerActivity(), (Class<?>) OpenWebViewActivity.class);
intent.putExtras(bundle3);
getInvokerActivity().startActivity(intent);
}
}
}