|
@@ -2,6 +2,7 @@ package com.jixin.im.ui.me.redpacket;
|
|
|
|
|
|
import android.annotation.SuppressLint;
|
|
|
import android.content.Intent;
|
|
|
+import android.content.res.AssetManager;
|
|
|
import android.content.res.ColorStateList;
|
|
|
import android.os.Bundle;
|
|
|
import android.text.Editable;
|
|
@@ -18,10 +19,13 @@ import android.widget.Toast;
|
|
|
|
|
|
import androidx.core.view.ViewCompat;
|
|
|
|
|
|
+import com.google.gson.Gson;
|
|
|
+import com.google.gson.reflect.TypeToken;
|
|
|
import com.jixin.im.R;
|
|
|
import com.jixin.im.bean.PayQrCodeBean;
|
|
|
import com.jixin.im.bean.event.EventPaySuccess;
|
|
|
import com.jixin.im.bean.redpacket.Balance;
|
|
|
+import com.jixin.im.bean.wallet.RechargeBean;
|
|
|
import com.jixin.im.helper.DialogHelper;
|
|
|
import com.jixin.im.ui.base.BaseActivity;
|
|
|
import com.jixin.im.ui.other.PayQRcodeActivity;
|
|
@@ -38,6 +42,9 @@ import com.xuan.xuanhttplibrary.okhttp.callback.BaseCallback;
|
|
|
import com.xuan.xuanhttplibrary.okhttp.result.ObjectResult;
|
|
|
import com.xuan.xuanhttplibrary.okhttp.result.Result;
|
|
|
|
|
|
+import java.io.BufferedReader;
|
|
|
+import java.io.IOException;
|
|
|
+import java.io.InputStreamReader;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
@@ -75,6 +82,26 @@ public class WxPayAdd extends BaseActivity {
|
|
|
EventBusHelper.register(this);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ private List<RechargeBean> getRechargeList(String assetsFileName) {
|
|
|
+ StringBuilder stringBuilder = new StringBuilder();
|
|
|
+ try {
|
|
|
+ AssetManager assetManager = getApplication().getAssets();
|
|
|
+ BufferedReader bf = new BufferedReader(new InputStreamReader(assetManager.open(assetsFileName)));
|
|
|
+ String line;
|
|
|
+ while ((line = bf.readLine()) != null) {
|
|
|
+ stringBuilder.append(line);
|
|
|
+ }
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ Gson gson = new Gson();
|
|
|
+ List<RechargeBean> items = gson.fromJson(stringBuilder.toString(), new TypeToken<List<RechargeBean>>() {
|
|
|
+ }.getType());
|
|
|
+ return items;
|
|
|
+ }
|
|
|
+
|
|
|
@SuppressWarnings("unused")
|
|
|
@Subscribe(threadMode = ThreadMode.MainThread)
|
|
|
public void helloEventBus(EventPaySuccess message) {
|