正在查看: SpeedCash v6.5.1482 应用的 NewInvoiceActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: SpeedCash v6.5.1482 应用的 NewInvoiceActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.bm.sc.bebasbayar.ui.activity;
import android.os.Bundle;
import android.view.View;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.TextView;
import com.bm.sc.auth.ui.BottomNavigationActivity;
import com.bm.sc.bebasbayar.BuildConfig;
import com.bm.sc.bebasbayar.R;
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.iface.BBCallback;
import com.bm.sc.bebasbayar.iface.MessageProcess;
import com.bm.sc.bebasbayar.message.BaseMessage;
import com.bm.sc.bebasbayar.message.BusMessage;
import com.bm.sc.bebasbayar.message.api.APIMessageWrapper;
import com.bm.sc.bebasbayar.setting.session.AppSession;
import com.bm.sc.bebasbayar.ui.BaseActivity;
import com.bm.sc.bebasbayar.ui.activity.NewInvoiceActivity;
import com.bm.sc.bebasbayar.ui.activity.cash.AutoDebitActivity;
import com.bm.sc.bebasbayar.ui.activity.info.TransactionReportNewActivity;
import com.bm.sc.util.android.Compat;
import com.bm.sc.util.android.Device;
import com.bm.sc.util.common.Var;
import com.bm.sc.util.format.Locales;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
public class NewInvoiceActivity extends BaseActivity {
public ArrayList A = null;
public String c;
public String d;
public String e;
public String f;
public String g;
public String h;
public String i;
public String j;
public String k;
public String l;
public double m;
public double n;
public double o;
public double p;
public double q;
public double r;
public double s;
public TextView t;
public TextView u;
public TextView v;
public TextView w;
public TextView x;
public View y;
public ImageView z;
public class a implements MessageProcess {
public a() {
}
@Override
public void afterProcess(BaseMessage baseMessage) {
APIMessageWrapper aPIMessageWrapper = new APIMessageWrapper(baseMessage);
if (aPIMessageWrapper.isOK()) {
Iterator<HashMap<String, Object>> it = aPIMessageWrapper.getData().iterator();
while (it.hasNext()) {
NewInvoiceActivity.this.t.setText(Locales.moneyNoFraction(Var.toString(Double.valueOf(Var.toDouble(it.next().get("total_cashback"), 0.0d)), "")));
}
}
}
@Override
public void backgroundProcess(long j, long j2, boolean z) {
}
@Override
public void preProcess() {
}
}
public static Bundle getPaymentBundle(String str, String str2, String str3, double d, double d2, double d3) {
Bundle bundle = new Bundle();
bundle.putString(PaymentActivity.KEY_TITLE, str);
bundle.putString(PaymentActivity.KEY_STRUK, str2);
bundle.putString(PaymentActivity.KEY_REFF_ID, str3);
bundle.putDouble("key:nominal", d);
bundle.putDouble("key:discount", d2);
bundle.putDouble(PaymentActivity.KEY_NOMINAL_VOUCHER, d3);
return bundle;
}
public void l(View view) {
finish();
Affinity.launch(this, TransactionReportNewActivity.class);
}
public void w(CheckBox checkBox, int i, Boolean bool) {
if (bool.booleanValue()) {
Affinity.purge(this, AutoDebitActivity.class);
} else {
checkBox.setChecked(false);
}
}
public void x(final CheckBox checkBox, CompoundButton compoundButton, boolean z) {
if (z) {
Affinity.confirm(this, "", getString(R.string.info_label_move_auto_debet), new BBCallback() {
@Override
public final void do_callback(int i, Object obj) {
NewInvoiceActivity.this.w(checkBox, i, (Boolean) obj);
}
});
}
}
public void y(View view) {
Bundle bundle = new Bundle();
bundle.putString("FromReservation", "0");
Affinity.purge(this, BottomNavigationActivity.class, bundle);
}
public void z(View view) {
Affinity.copy1(this, this.l, "Serial Number berhasil disalin.");
}
@Override
public int getLayoutResource() {
return R.layout.activity_invoice;
}
public void getTotalCashback() {
MessageComposer messageComposer = new MessageComposer(7, "ro/activity/total_cashback");
messageComposer.setRequest_method(MessageComposer.GET);
messageComposer.setData_type(2);
messageComposer.addMessage("user_id", this.appSession.retrieve(AppSession.PROPERTY_MERCHANT_ID));
messageComposer.addMessage("user_uuid", Device.getDeviceUUID(this).toString());
messageComposer.addMessage(BaseMessage.INDEX_VIA, "BB ANDROID");
messageComposer.addMessage(BaseMessage.INDEX_APP_ID, "SPEEDCASH");
messageComposer.addMessage(BaseMessage.INDEX_UUID, Device.getDeviceUUID(this));
messageComposer.addMessage(BaseMessage.INDEX_VERSION_CODE, 482);
messageComposer.addMessage(BaseMessage.INDEX_VERSION_NAME, BuildConfig.VERSION_NAME);
messageComposer.setShowProgressRegular(true);
messageComposer.setMessageProcess(new a());
new MessageSender(this, messageComposer).execute();
}
@Override
public String getWikiNameSpace() {
return null;
}
@Override
public boolean isEligibleForFavorit() {
return false;
}
@Override
public void onBackPressed() {
Bundle bundle = new Bundle();
bundle.putString("FromReservation", "0");
Affinity.purge(this, BottomNavigationActivity.class, bundle);
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
if (!EventBus.getDefault().isRegistered(this)) {
EventBus.getDefault().register(this);
}
if (getToolbar() != null) {
getToolbar().setVisibility(8);
}
if (bundle != null) {
v(bundle);
} else {
Bundle extras = getIntent().getExtras();
if (extras != null) {
v(extras);
}
}
this.w = (TextView) findViewById(R.id.invoice_reff_id);
TextView textView = (TextView) findViewById(R.id.invoice_bonus_info_label);
TextView textView2 = (TextView) findViewById(R.id.invoice_bonus_transaction);
this.t = (TextView) findViewById(R.id.invoice_bonus_total);
TextView textView3 = (TextView) findViewById(R.id.invoice_check_resume);
TextView textView4 = (TextView) findViewById(R.id.invoice_back_home);
this.x = (TextView) findViewById(R.id.tv_serial_number);
ImageView imageView = (ImageView) findViewById(R.id.invoice_copy_btn);
View findViewById = findViewById(R.id.invoice_cashback_transaksi);
this.y = findViewById(R.id.invoice_serial_number_container);
this.v = (TextView) findViewById(R.id.label_invoice_status_subheading);
this.u = (TextView) findViewById(R.id.label_invoice_status);
this.z = (ImageView) findViewById(R.id.logo_invoice_status);
final CheckBox checkBox = (CheckBox) findViewById(R.id.cb_insert_auto_debet);
textView.setText(Compat.Html_fromHtml(getString(R.string.invoice_success_transaction_subheading3)));
if (!this.k.isEmpty() || !this.k.equals("")) {
if (this.k.contains(",")) {
this.k = this.k.trim().replace(",", "<br>");
}
this.y.setVisibility(0);
this.x.setText("Token : ");
this.w.setText(Compat.Html_fromHtml(this.k));
} else if (this.l.isEmpty() && this.l.equals("")) {
this.y.setVisibility(8);
} else {
this.y.setVisibility(0);
this.x.setText("Serial Number :");
this.w.setText(this.l);
}
if (this.h.isEmpty() || !this.h.equals("SUKSES")) {
this.u.setText("TRANSAKSI SEDANG DIPROSES");
this.z.setImageResource(R.drawable.ic_trx_pending);
this.u.setTextColor(getResources().getColor(R.color.colorSecondaryLight));
this.v.setText(getString(R.string.invoice_pending_transaction_subheading1));
} else {
this.u.setText("TRANSAKSI SUKSES");
this.z.setImageResource(R.drawable.ic_success_logo);
this.u.setTextColor(getResources().getColor(R.color.copy_toast_color));
this.v.setText(getString(R.string.invoice_success_transaction_subheading1));
}
double d = this.p;
if (d <= 0.0d || Var.toString(Double.valueOf(d), "").isEmpty() || Var.toString(Double.valueOf(this.p), "").equals("null")) {
findViewById.setVisibility(8);
} else {
findViewById.setVisibility(0);
textView2.setText(Locales.moneyNoFraction(Var.toString(Double.valueOf(this.p), "")));
}
textView3.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
NewInvoiceActivity.this.l(view);
}
});
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public final void onCheckedChanged(CompoundButton compoundButton, boolean z) {
NewInvoiceActivity.this.x(checkBox, compoundButton, z);
}
});
textView4.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
NewInvoiceActivity.this.y(view);
}
});
imageView.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
NewInvoiceActivity.this.z(view);
}
});
getTotalCashback();
}
public void onDestroy() {
EventBus.getDefault().unregister(this);
super.onDestroy();
}
@Subscribe(threadMode = ThreadMode.MAIN)
public void onMessageEvent(BusMessage busMessage) {
if (busMessage.getEventType() == 2) {
this.j = busMessage.getProductName();
this.l = busMessage.getSerialNumber();
this.d = busMessage.getStruk();
this.A = busMessage.getStrukmap();
this.h = "SUKSES";
if (busMessage.getReffId().equals(this.e)) {
this.u.setText("TRANSAKSI SUKSES");
this.z.setImageResource(R.drawable.ic_success_logo);
this.u.setTextColor(getResources().getColor(R.color.copy_toast_color));
this.v.setText(getString(R.string.invoice_success_transaction_subheading1));
if (this.l.equals("")) {
return;
}
this.y.setVisibility(0);
this.x.setText("Serial Number :");
this.w.setText(this.l);
}
}
}
public void onSaveInstanceState(Bundle bundle) {
bundle.putString(PaymentActivity.KEY_TITLE, this.c);
bundle.putString(PaymentActivity.KEY_STRUK, this.d);
bundle.putString(PaymentActivity.KEY_REFF_ID, this.e);
bundle.putDouble("key:nominal", this.m);
bundle.putSerializable(PaymentActivity.KEY_STRUK_MAP, this.A);
bundle.putDouble("key:discount", this.o);
bundle.putDouble(PaymentActivity.KEY_NOMINAL_VOUCHER, this.n);
bundle.putDouble(PaymentActivity.KEY_CASHBACK, this.p);
bundle.putString(PaymentActivity.KEY_DATE, this.f);
bundle.putString(PaymentActivity.KEY_CUSTOMER_ID, this.g);
bundle.putString(PaymentActivity.KEY_STATUS, this.h);
bundle.putString(PaymentActivity.KEY_IS_PULSA, this.i);
bundle.putDouble(PaymentActivity.KEY_ADMIN, this.q);
bundle.putDouble(PaymentActivity.KEY_SUBTOTAL, this.r);
bundle.putDouble("key:balance", this.s);
bundle.putString("key:product:name", this.j);
bundle.putString(PaymentActivity.KEY_TOKEN, this.k);
bundle.putString(PaymentActivity.KEY_SERIAL_NUMBER, this.l);
super/*androidx.activity.ComponentActivity*/.onSaveInstanceState(bundle);
}
public final void v(Bundle bundle) {
this.c = bundle.getString(PaymentActivity.KEY_TITLE, this.c);
this.d = bundle.getString(PaymentActivity.KEY_STRUK, this.d);
this.e = bundle.getString(PaymentActivity.KEY_REFF_ID, this.e);
this.m = bundle.getDouble("key:nominal", this.m);
this.n = bundle.getDouble(PaymentActivity.KEY_NOMINAL_VOUCHER, 0.0d);
this.o = bundle.getDouble("key:discount", 0.0d);
this.p = bundle.getDouble(PaymentActivity.KEY_CASHBACK, this.p);
this.f = bundle.getString(PaymentActivity.KEY_DATE, "");
this.g = bundle.getString(PaymentActivity.KEY_CUSTOMER_ID, "");
this.h = bundle.getString(PaymentActivity.KEY_STATUS, "");
this.i = bundle.getString(PaymentActivity.KEY_IS_PULSA, "0");
this.A = (ArrayList) bundle.getSerializable(PaymentActivity.KEY_STRUK_MAP);
this.q = bundle.getDouble(PaymentActivity.KEY_ADMIN, 0.0d);
this.r = bundle.getDouble(PaymentActivity.KEY_SUBTOTAL, 0.0d);
this.s = bundle.getDouble("key:balance", 0.0d);
this.j = bundle.getString("key:product:name", "");
this.k = bundle.getString(PaymentActivity.KEY_TOKEN, "");
this.l = bundle.getString(PaymentActivity.KEY_SERIAL_NUMBER, "");
}
public static Bundle getPaymentBundle(String str, String str2, String str3, double d, double d2, double d3, double d4) {
Bundle bundle = new Bundle();
bundle.putString(PaymentActivity.KEY_TITLE, str);
bundle.putString(PaymentActivity.KEY_STRUK, str2);
bundle.putString(PaymentActivity.KEY_REFF_ID, str3);
bundle.putDouble("key:nominal", d);
bundle.putDouble("key:discount", d2);
bundle.putDouble(PaymentActivity.KEY_NOMINAL_VOUCHER, d3);
bundle.putDouble(PaymentActivity.KEY_CASHBACK, d4);
return bundle;
}
}