1.3.6 默认支付方式优化
This commit is contained in:
@@ -106,9 +106,7 @@ public class ChargeActivity extends BaseActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setListener() {
|
private void setListener() {
|
||||||
|
ll_more.setOnClickListener(v -> hideMoreButton());
|
||||||
ll_more.setOnClickListener(v -> showMorePayType());
|
|
||||||
|
|
||||||
tvCharge.setOnClickListener(v -> {
|
tvCharge.setOnClickListener(v -> {
|
||||||
if (mSelectChargeBean == null) return;
|
if (mSelectChargeBean == null) return;
|
||||||
getDialogManager().showProgressDialog(this, false);
|
getDialogManager().showProgressDialog(this, false);
|
||||||
@@ -117,14 +115,18 @@ public class ChargeActivity extends BaseActivity {
|
|||||||
tvAgreement.setOnClickListener(v -> {
|
tvAgreement.setOnClickListener(v -> {
|
||||||
CommonWebViewActivity.start(this,UriProvider.getRechargeAgreementUrl());
|
CommonWebViewActivity.start(this,UriProvider.getRechargeAgreementUrl());
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showMorePayType() {
|
private void hideMoreButton() {
|
||||||
ll_more.setVisibility(View.GONE);
|
ll_more.setVisibility(View.GONE);
|
||||||
ll_type_second.setVisibility(View.VISIBLE);
|
ll_type_second.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void showMoreButton() {
|
||||||
|
ll_more.setVisibility(View.VISIBLE);
|
||||||
|
ll_type_second.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
private void bindViews() {
|
private void bindViews() {
|
||||||
mTv_gold = findViewById(R.id.tv_gold);
|
mTv_gold = findViewById(R.id.tv_gold);
|
||||||
ll_type_first = findViewById(R.id.ll_type_first);
|
ll_type_first = findViewById(R.id.ll_type_first);
|
||||||
@@ -144,10 +146,10 @@ public class ChargeActivity extends BaseActivity {
|
|||||||
this.payChannel = payChannel;
|
this.payChannel = payChannel;
|
||||||
boolean selectWeChatPay = (Objects.equals(this.payChannel, Constants.CHARGE_WX));
|
boolean selectWeChatPay = (Objects.equals(this.payChannel, Constants.CHARGE_WX));
|
||||||
boolean selectAliPay = (Objects.equals(this.payChannel, Constants.CHARGE_ALIPAY));
|
boolean selectAliPay = (Objects.equals(this.payChannel, Constants.CHARGE_ALIPAY));
|
||||||
if (defaultPay == 1) {
|
if (defaultPay == 1 || defaultPay == 3) {
|
||||||
iv_sel_first.setSelected(selectAliPay);
|
iv_sel_first.setSelected(selectAliPay);
|
||||||
iv_sel_second.setSelected(selectWeChatPay);
|
iv_sel_second.setSelected(selectWeChatPay);
|
||||||
}else {
|
}else if (defaultPay == 2 || defaultPay == 4){
|
||||||
iv_sel_first.setSelected(selectWeChatPay);
|
iv_sel_first.setSelected(selectWeChatPay);
|
||||||
iv_sel_second.setSelected(selectAliPay);
|
iv_sel_second.setSelected(selectAliPay);
|
||||||
}
|
}
|
||||||
@@ -454,18 +456,43 @@ public class ChargeActivity extends BaseActivity {
|
|||||||
/**defaultPay 1:默认支付宝,2:默认微信 */
|
/**defaultPay 1:默认支付宝,2:默认微信 */
|
||||||
private void setWalletData(WalletInfo walletInfo) {
|
private void setWalletData(WalletInfo walletInfo) {
|
||||||
if (walletInfo == null)return;
|
if (walletInfo == null)return;
|
||||||
|
if (walletInfo.getDefaultPay() == 1 || walletInfo.getDefaultPay() == 2){
|
||||||
|
showMoreButton();
|
||||||
|
} else if (walletInfo.getDefaultPay() == 3 || walletInfo.getDefaultPay() == 4){
|
||||||
|
hideMoreButton();
|
||||||
|
}
|
||||||
mTv_gold.setText(getString(R.string.charge_gold, walletInfo.getDiamondNum()));
|
mTv_gold.setText(getString(R.string.charge_gold, walletInfo.getDiamondNum()));
|
||||||
iv_type_first.setImageDrawable(walletInfo.getDefaultPay() == 1?getResources().getDrawable(R.drawable.ic_ali_charge):getResources().getDrawable(R.drawable.ic_wechat_charge));
|
if (walletInfo.getDefaultPay() == 1 || walletInfo.getDefaultPay() == 3){
|
||||||
iv_type_second.setImageDrawable(walletInfo.getDefaultPay() == 1?getResources().getDrawable(R.drawable.ic_wechat_charge):getResources().getDrawable(R.drawable.ic_ali_charge));
|
iv_type_first.setImageDrawable(getResources().getDrawable(R.drawable.ic_ali_charge));
|
||||||
tv_type_first.setText(walletInfo.getDefaultPay() == 1?"支付宝":"微信");
|
}else if (walletInfo.getDefaultPay() == 2 || walletInfo.getDefaultPay() == 4){
|
||||||
tv_type_second.setText(walletInfo.getDefaultPay() == 1?"微信":"支付宝");
|
iv_type_first.setImageDrawable(getResources().getDrawable(R.drawable.ic_wechat_charge));
|
||||||
payChannel = walletInfo.getDefaultPay() == 1?Constants.CHARGE_ALIPAY:Constants.CHARGE_WX;
|
}
|
||||||
|
|
||||||
|
if (walletInfo.getDefaultPay() == 1 || walletInfo.getDefaultPay() == 3){
|
||||||
|
iv_type_second.setImageDrawable(getResources().getDrawable(R.drawable.ic_wechat_charge));
|
||||||
|
}else if (walletInfo.getDefaultPay() == 2 || walletInfo.getDefaultPay() == 4){
|
||||||
|
iv_type_second.setImageDrawable(getResources().getDrawable(R.drawable.ic_ali_charge));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (walletInfo.getDefaultPay() == 1 || walletInfo.getDefaultPay() == 3){
|
||||||
|
tv_type_first.setText("支付宝");
|
||||||
|
}else if (walletInfo.getDefaultPay() == 2 || walletInfo.getDefaultPay() == 4){
|
||||||
|
tv_type_first.setText("微信");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (walletInfo.getDefaultPay() == 1 || walletInfo.getDefaultPay() == 3){
|
||||||
|
tv_type_second.setText("微信");
|
||||||
|
}else if (walletInfo.getDefaultPay() == 2 || walletInfo.getDefaultPay() == 4){
|
||||||
|
tv_type_second.setText("支付宝");
|
||||||
|
}
|
||||||
|
payChannel = walletInfo.getDefaultPay() == 1 || walletInfo.getDefaultPay() == 3?Constants.CHARGE_ALIPAY:Constants.CHARGE_WX;
|
||||||
int defaultPay = walletInfo.getDefaultPay();
|
int defaultPay = walletInfo.getDefaultPay();
|
||||||
selectPayChannelDisplay(payChannel,defaultPay);
|
selectPayChannelDisplay(payChannel,defaultPay);
|
||||||
if (walletInfo.getDefaultPay() == 1){
|
|
||||||
|
if (walletInfo.getDefaultPay() == 1 || walletInfo.getDefaultPay() == 3){
|
||||||
ll_type_first.setOnClickListener(v -> selectPayChannelDisplay(Constants.CHARGE_ALIPAY,defaultPay));
|
ll_type_first.setOnClickListener(v -> selectPayChannelDisplay(Constants.CHARGE_ALIPAY,defaultPay));
|
||||||
ll_type_second.setOnClickListener(v -> selectPayChannelDisplay(Constants.CHARGE_WX,defaultPay));
|
ll_type_second.setOnClickListener(v -> selectPayChannelDisplay(Constants.CHARGE_WX,defaultPay));
|
||||||
}else {
|
}else if (walletInfo.getDefaultPay() == 2 || walletInfo.getDefaultPay() == 4){
|
||||||
ll_type_first.setOnClickListener(v -> selectPayChannelDisplay(Constants.CHARGE_WX,defaultPay));
|
ll_type_first.setOnClickListener(v -> selectPayChannelDisplay(Constants.CHARGE_WX,defaultPay));
|
||||||
ll_type_second.setOnClickListener(v -> selectPayChannelDisplay(Constants.CHARGE_ALIPAY,defaultPay));
|
ll_type_second.setOnClickListener(v -> selectPayChannelDisplay(Constants.CHARGE_ALIPAY,defaultPay));
|
||||||
}
|
}
|
||||||
|
@@ -160,7 +160,6 @@
|
|||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:visibility="gone"
|
|
||||||
android:clickable="true">
|
android:clickable="true">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -196,7 +195,7 @@
|
|||||||
android:layout_marginTop="15dp"
|
android:layout_marginTop="15dp"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
|
android:visibility="gone"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:clickable="true">
|
android:clickable="true">
|
||||||
|
|
||||||
|
@@ -21,5 +21,5 @@ with_jenkins=false
|
|||||||
#\u6253\u652F\u6301x86\u7684\u6A21\u62DF\u5668\u5305\u4F7F\u7528
|
#\u6253\u652F\u6301x86\u7684\u6A21\u62DF\u5668\u5305\u4F7F\u7528
|
||||||
ndk_abi_filters=arm
|
ndk_abi_filters=arm
|
||||||
|
|
||||||
version_name=1.3.0
|
version_name=1.3.6
|
||||||
version_code=130
|
version_code=136
|
Reference in New Issue
Block a user