|
|
@@ -11,15 +11,18 @@ import com.sheep.gamegroup.absBase.BaseActivity;
|
|
|
import com.sheep.gamegroup.alipay.PayResult;
|
|
|
import com.sheep.gamegroup.model.entity.BaseMessage;
|
|
|
import com.sheep.gamegroup.model.entity.RechargeEntity;
|
|
|
+import com.sheep.gamegroup.model.entity.RechargePriceEntity;
|
|
|
import com.sheep.gamegroup.model.util.SheepSubscriber;
|
|
|
import com.sheep.gamegroup.util.Jump2View;
|
|
|
import com.sheep.gamegroup.util.MyGridview;
|
|
|
import com.sheep.gamegroup.view.adapter.RechargeAdapter;
|
|
|
+import com.sheep.gamegroup.view.adapter.RechargePriceAdapter;
|
|
|
import com.sheep.jiuyan.samllsheep.R;
|
|
|
import com.sheep.jiuyan.samllsheep.SheepApp;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.G;
|
|
|
import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
import butterknife.BindView;
|
|
|
@@ -37,6 +40,8 @@ public class SignRechargeAct extends BaseActivity {
|
|
|
int mPayType = -1;//选择支付方式的id
|
|
|
String mAmount = null;//支付的金额
|
|
|
|
|
|
+ @BindView(R.id.rechargeprice_greidview)
|
|
|
+ MyGridview rechargeprice_greidview;
|
|
|
@BindView(R.id.recharge_greidview)
|
|
|
MyGridview rechargeGreidview;
|
|
|
|
|
|
@@ -44,10 +49,13 @@ public class SignRechargeAct extends BaseActivity {
|
|
|
@BindView(R.id.et_recharge_price)
|
|
|
EditText etRechargePrice;
|
|
|
|
|
|
+ RechargePriceAdapter rechargePriceAdapter;
|
|
|
+ List<RechargePriceEntity> mPriceEntityList = new ArrayList<>();
|
|
|
+ int select = -1;
|
|
|
|
|
|
@Override
|
|
|
protected int getLayoutId() {
|
|
|
- return R.layout.signrecharge_act_layout;
|
|
|
+ return R.layout.recharge_act_layout;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -64,6 +72,31 @@ public class SignRechargeAct extends BaseActivity {
|
|
|
@Override
|
|
|
public void initData() {
|
|
|
|
|
|
+ addDatas();
|
|
|
+ /**
|
|
|
+ * 支付金额选择
|
|
|
+ */
|
|
|
+ rechargePriceAdapter = new RechargePriceAdapter(SignRechargeAct.this, mPriceEntityList);
|
|
|
+ rechargeprice_greidview.setVerticalSpacing(20);
|
|
|
+ rechargeprice_greidview.setAdapter(rechargePriceAdapter);
|
|
|
+ rechargeprice_greidview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
|
|
+ select = position;
|
|
|
+ rechargePriceAdapter.setInPut(false);
|
|
|
+ RechargePriceEntity rechargePriceEntity = (RechargePriceEntity) parent.getItemAtPosition(position);
|
|
|
+ etRechargePrice.setText("" + rechargePriceEntity.getPrice());
|
|
|
+ for (int i = 0; i < mPriceEntityList.size(); i++) {
|
|
|
+ if (position == i) {
|
|
|
+ mPriceEntityList.get(i).setSelectState(true);
|
|
|
+ } else {
|
|
|
+ mPriceEntityList.get(i).setSelectState(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ rechargePriceAdapter.notifyDataSetChanged();
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
/**
|
|
|
* 支付方式选择
|
|
|
@@ -197,4 +230,13 @@ public class SignRechargeAct extends BaseActivity {
|
|
|
payThread.start();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ private void addDatas() {
|
|
|
+ mPriceEntityList.add(new RechargePriceEntity(false,"10元", 10));
|
|
|
+ mPriceEntityList.add(new RechargePriceEntity(false,"20元", 20));
|
|
|
+ mPriceEntityList.add(new RechargePriceEntity(false,"50元", 50));
|
|
|
+ mPriceEntityList.add(new RechargePriceEntity(false,"100元", 100));
|
|
|
+ mPriceEntityList.add(new RechargePriceEntity(false,"200元", 200));
|
|
|
+ mPriceEntityList.add(new RechargePriceEntity(false,"500元", 500));
|
|
|
+ }
|
|
|
}
|