feat:完成充值页UI改版
@@ -26,16 +26,16 @@ public class ChargePresenter extends PayPresenter<IChargeView> {
|
||||
refreshWalletInfo(false);
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
public void loadBanner() {
|
||||
payModel.loadChargeBanner()
|
||||
.compose(bindUntilEvent(PresenterEvent.DESTROY))
|
||||
.subscribe(list -> {
|
||||
if (ListUtils.isListEmpty(list)) {
|
||||
return;
|
||||
}
|
||||
getMvpView().onLoadedBanners(list);
|
||||
},
|
||||
error -> ToastUtils.show(error.getMessage()));
|
||||
}
|
||||
// @SuppressLint("CheckResult")
|
||||
// public void loadBanner() {
|
||||
// payModel.loadChargeBanner()
|
||||
// .compose(bindUntilEvent(PresenterEvent.DESTROY))
|
||||
// .subscribe(list -> {
|
||||
// if (ListUtils.isListEmpty(list)) {
|
||||
// return;
|
||||
// }
|
||||
// getMvpView().onLoadedBanners(list);
|
||||
// },
|
||||
// error -> ToastUtils.show(error.getMessage()));
|
||||
// }
|
||||
}
|
||||
|
@@ -11,6 +11,6 @@ import java.util.List;
|
||||
|
||||
public interface IChargeView extends IPayView {
|
||||
|
||||
void onLoadedBanners(List<Banner> banners);
|
||||
// void onLoadedBanners(List<Banner> banners);
|
||||
|
||||
}
|
||||
|
@@ -15,13 +15,11 @@ import android.text.style.ForegroundColorSpan;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.appsflyer.AFInAppEventParameterName;
|
||||
@@ -41,23 +39,18 @@ import com.chwl.app.pay.presenter.ChargePresenter;
|
||||
import com.chwl.app.pay.view.IChargeView;
|
||||
import com.chwl.app.ui.im.avtivity.NimP2PMessageActivity;
|
||||
import com.chwl.app.ui.setting.ModifyPwdActivity;
|
||||
import com.chwl.app.ui.utils.ImageLoadUtilsV2;
|
||||
import com.chwl.app.ui.webview.CommonWebViewActivity;
|
||||
import com.chwl.core.DemoCache;
|
||||
import com.chwl.core.UriProvider;
|
||||
import com.chwl.core.auth.AuthModel;
|
||||
import com.chwl.core.exception.FailReasonException;
|
||||
import com.chwl.core.pay.PayModel;
|
||||
import com.chwl.core.pay.bean.Banner;
|
||||
import com.chwl.core.pay.bean.ChargeBean;
|
||||
import com.chwl.core.pay.bean.WalletInfo;
|
||||
import com.chwl.core.utils.net.IgnoreException;
|
||||
import com.chwl.library.base.factory.CreatePresenter;
|
||||
import com.chwl.library.utils.FormatUtils;
|
||||
import com.chwl.library.utils.SingleToastUtil;
|
||||
import com.zhpan.bannerview.BannerViewPager;
|
||||
import com.zhpan.bannerview.BaseBannerAdapter;
|
||||
import com.zhpan.bannerview.BaseViewHolder;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
@@ -76,7 +69,7 @@ public class ChargeActivity extends BaseMvpActivity<IChargeView, ChargePresenter
|
||||
private static final String TAG = "ChargeActivity";
|
||||
|
||||
private TextView mTv_gold;
|
||||
private BannerViewPager<Banner> mVpBanner;
|
||||
// private BannerViewPager<Banner> mVpBanner;
|
||||
private RecyclerView mRecyclerView;
|
||||
private TextView mIvCharge;
|
||||
private CheckBox mTvProtocol;
|
||||
@@ -108,12 +101,12 @@ public class ChargeActivity extends BaseMvpActivity<IChargeView, ChargePresenter
|
||||
initBilling();
|
||||
setProtocol();
|
||||
getMvpPresenter().loadUserInfo();
|
||||
getMvpPresenter().loadBanner();
|
||||
// getMvpPresenter().loadBanner();
|
||||
}
|
||||
|
||||
private void findView() {
|
||||
mTv_gold = findViewById(R.id.tv_gold);
|
||||
mVpBanner = findViewById(R.id.vp_banner);
|
||||
// mVpBanner = findViewById(R.id.vp_banner);
|
||||
mRecyclerView = findViewById(R.id.recyclerView);
|
||||
mIvCharge = findViewById(R.id.tv_charge);
|
||||
mTvProtocol = findViewById(R.id.tv_protocol);
|
||||
@@ -126,8 +119,8 @@ public class ChargeActivity extends BaseMvpActivity<IChargeView, ChargePresenter
|
||||
SpannableString ss = new SpannableString(privacyAgreementDescTip);
|
||||
int privacyAgreementTipIndex = privacyAgreementDescTip.indexOf(privacyAgreementTip);
|
||||
|
||||
ss.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.color_1F1A4E)), privacyAgreementTipIndex, privacyAgreementTipIndex + privacyAgreementTip.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
ss.setSpan(new OriginalDrawStatusClickSpan(ContextCompat.getColor(context, R.color.color_1F1A4E)) {
|
||||
ss.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.color_8E9094)), privacyAgreementTipIndex, privacyAgreementTipIndex + privacyAgreementTip.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
ss.setSpan(new OriginalDrawStatusClickSpan(ContextCompat.getColor(context, R.color.color_1E1E1F)) {
|
||||
@Override
|
||||
public void onClick(@NonNull View widget) {
|
||||
if (widget instanceof TextView)
|
||||
@@ -169,6 +162,9 @@ public class ChargeActivity extends BaseMvpActivity<IChargeView, ChargePresenter
|
||||
/*初始化*/
|
||||
public void initBilling() {
|
||||
billingManager = IGoogleService.Companion.newBillingService(this, this);
|
||||
if (billingManager == null) {
|
||||
toast(R.string.bean_response_serviceresult_015);
|
||||
}
|
||||
}
|
||||
|
||||
/*客户端设置成功回调*/
|
||||
@@ -182,7 +178,6 @@ public class ChargeActivity extends BaseMvpActivity<IChargeView, ChargePresenter
|
||||
}
|
||||
|
||||
public void initProduceList(List<ChargeBean> chargeBeanList) {
|
||||
|
||||
final List<String> productKeys = new ArrayList<>();
|
||||
for (ChargeBean chargeBean : chargeBeanList) {
|
||||
productKeys.add(chargeBean.getChargeProdId());
|
||||
@@ -327,7 +322,6 @@ public class ChargeActivity extends BaseMvpActivity<IChargeView, ChargePresenter
|
||||
}
|
||||
|
||||
private void initViews() {
|
||||
mRecyclerView.setLayoutManager(new LinearLayoutManager(context));
|
||||
mChargeAdapter = new ChargeAdapter();
|
||||
mRecyclerView.setAdapter(mChargeAdapter);
|
||||
mChargeAdapter.setOnItemClickListener((baseQuickAdapter, view, position) -> {
|
||||
@@ -370,8 +364,8 @@ public class ChargeActivity extends BaseMvpActivity<IChargeView, ChargePresenter
|
||||
if (mTitleBar != null) {
|
||||
mTitleBar.setTitle(getString(R.string.charge_my));
|
||||
mTitleBar.setImmersive(false);
|
||||
mTitleBar.setTitleColor(getResources().getColor(R.color.white));
|
||||
mTitleBar.setLeftImageResource(R.drawable.arrow_left_white);
|
||||
mTitleBar.setTitleColor(getResources().getColor(R.color.color_1E1E1F));
|
||||
mTitleBar.setLeftImageResource(R.drawable.arrow_left);
|
||||
mTitleBar.setBackgroundResource(R.color.transparent);
|
||||
mTitleBar.setLeftClickListener(v -> finish());
|
||||
}
|
||||
@@ -397,24 +391,24 @@ public class ChargeActivity extends BaseMvpActivity<IChargeView, ChargePresenter
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadedBanners(List<Banner> banners) {
|
||||
mVpBanner.setVisibility(View.VISIBLE);
|
||||
mVpBanner.setLifecycleRegistry(getLifecycle())
|
||||
.setAdapter(new BaseBannerAdapter<>() {
|
||||
@Override
|
||||
protected void bindData(BaseViewHolder<Banner> holder, Banner data, int position, int pageSize) {
|
||||
ImageView ivBanner = holder.findViewById(R.id.iv_banner);
|
||||
ImageLoadUtilsV2.loadImage(ivBanner, data.getBannerUrl());
|
||||
ivBanner.setOnClickListener(v ->
|
||||
CommonWebViewActivity.start(ChargeActivity.this, data.getLinkUrl()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLayoutId(int viewType) {
|
||||
return R.layout.item_banner_charge;
|
||||
}
|
||||
})
|
||||
.create(banners);
|
||||
}
|
||||
// @Override
|
||||
// public void onLoadedBanners(List<Banner> banners) {
|
||||
// mVpBanner.setVisibility(View.VISIBLE);
|
||||
// mVpBanner.setLifecycleRegistry(getLifecycle())
|
||||
// .setAdapter(new BaseBannerAdapter<>() {
|
||||
// @Override
|
||||
// protected void bindData(BaseViewHolder<Banner> holder, Banner data, int position, int pageSize) {
|
||||
// ImageView ivBanner = holder.findViewById(R.id.iv_banner);
|
||||
// ImageLoadUtilsV2.loadImage(ivBanner, data.getBannerUrl());
|
||||
// ivBanner.setOnClickListener(v ->
|
||||
// CommonWebViewActivity.start(ChargeActivity.this, data.getLinkUrl()));
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int getLayoutId(int viewType) {
|
||||
// return R.layout.item_banner_charge;
|
||||
// }
|
||||
// })
|
||||
// .create(banners);
|
||||
// }
|
||||
}
|
||||
|
@@ -21,7 +21,7 @@ public class ChargeAdapter extends BaseQuickAdapter<ChargeBean, BaseViewHolder>
|
||||
if (chargeBean == null) return;
|
||||
baseViewHolder.getView(R.id.ll_bg).setSelected(chargeBean.isSelected);
|
||||
baseViewHolder.setText(R.id.tv_title, chargeBean.getProdName());
|
||||
if (chargeBean.getProductDetails() != null) {
|
||||
if (chargeBean.getProductDetails() != null && chargeBean.getProductDetails().getOneTimePurchaseOfferDetails() != null) {
|
||||
baseViewHolder.setText(R.id.item_charge_money, chargeBean.getProductDetails().getOneTimePurchaseOfferDetails().getFormattedPrice());
|
||||
} else {
|
||||
baseViewHolder.setText(R.id.item_charge_money, "USD$" + chargeBean.getMoney());
|
||||
|
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 139 KiB After Width: | Height: | Size: 139 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charge_bg_balance.webp
Normal file
After Width: | Height: | Size: 75 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_charge_diamond.webp
Normal file
After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 882 B |
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/bg_gradient_cc66ff_9cb3ff_13" android:state_selected="true" />
|
||||
<item android:drawable="@drawable/bg_f0f5f6_13" android:state_selected="false" />
|
||||
<item android:drawable="@drawable/base_shape_f7f7f7_b_1e1e1f_w1dp_8dp" android:state_selected="true" />
|
||||
<item android:drawable="@drawable/base_shape_f7f7f7_8dp" android:state_selected="false" />
|
||||
</selector>
|
@@ -4,157 +4,163 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical">
|
||||
android:background="@color/color_F7F7F7">
|
||||
|
||||
<View
|
||||
android:id="@+id/iv_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="210dp"
|
||||
android:background="@drawable/bg_common_normal"
|
||||
android:layout_height="0dp"
|
||||
android:background="@drawable/bg_theme_top"
|
||||
app:layout_constraintDimensionRatio="375:178"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.chwl.app.base.TitleBar
|
||||
android:id="@+id/title_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:layout_marginTop="@dimen/dp_44"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:layout_height="50dp" />
|
||||
|
||||
<View
|
||||
android:id="@+id/iv_translate_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="88dp"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:background="@drawable/bg_common_translate_rectangle"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/iv_bg"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginHorizontal="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:background="@drawable/charge_bg_balance"
|
||||
app:layout_constraintDimensionRatio="343:92"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_bar" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/iv_diamond"
|
||||
android:layout_width="@dimen/dp_24"
|
||||
android:layout_height="@dimen/dp_24"
|
||||
android:layout_marginEnd="@dimen/dp_4"
|
||||
android:src="@mipmap/ic_charge_diamond"
|
||||
android:src="@drawable/ic_charge_diamond"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_title_diamond"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_title_diamond"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_title_diamond" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title_diamond"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:gravity="center"
|
||||
android:text="@string/charge_my_diamond"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textColor="@color/color_FFFFFF"
|
||||
android:textSize="@dimen/text_size_14"
|
||||
app:layout_constraintBottom_toTopOf="@id/tv_gold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_translate_bg" />
|
||||
app:layout_constraintStart_toEndOf="@id/iv_diamond"
|
||||
app:layout_constraintTop_toTopOf="@+id/iv_translate_bg"
|
||||
app:layout_constraintVertical_chainStyle="packed" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_gold"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginTop="@dimen/dp_5"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:includeFontPadding="false"
|
||||
android:text="0.0"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="@dimen/text_size_30"
|
||||
android:textColor="@color/color_FFFFFF"
|
||||
android:textSize="@dimen/dp_28"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_translate_bg"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_title_diamond"
|
||||
tools:text="1960.00" />
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
<View
|
||||
android:id="@+id/v_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:background="@drawable/base_shape_ffffff_top_16dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_translate_bg"
|
||||
app:layout_constraintVertical_bias="0.0"
|
||||
tools:layout_editor_absoluteX="198dp">
|
||||
app:layout_constraintTop_toBottomOf="@+id/iv_translate_bg" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_common_top_14_white"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:id="@+id/tv_buy"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_24"
|
||||
android:layout_marginTop="@dimen/dp_24"
|
||||
android:text="購買"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="@dimen/dp_16"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/v_bg" />
|
||||
|
||||
<com.zhpan.bannerview.BannerViewPager
|
||||
android:id="@+id/vp_banner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_90"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:visibility="gone" />
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginHorizontal="@dimen/dp_19"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:layout_marginBottom="@dimen/dp_4"
|
||||
android:orientation="vertical"
|
||||
android:visibility="visible"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:layout_constraintBottom_toTopOf="@id/tv_charge"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_buy"
|
||||
app:spanCount="2" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:paddingStart="@dimen/dp_16"
|
||||
android:paddingEnd="@dimen/dp_16"
|
||||
android:visibility="visible" />
|
||||
<TextView
|
||||
android:id="@+id/tv_charge"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_48"
|
||||
android:layout_marginHorizontal="@dimen/dp_36"
|
||||
android:layout_marginTop="@dimen/dp_28"
|
||||
android:layout_marginBottom="@dimen/dp_40"
|
||||
android:background="@drawable/base_shape_theme_26dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/charge_confirm_charge"
|
||||
android:textColor="@color/color_1E1E1F"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/tv_protocol" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_charge"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="@dimen/dp_25"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:layout_marginBottom="@dimen/dp_18"
|
||||
android:background="@drawable/bg_common_confirm_30"
|
||||
android:gravity="center"
|
||||
android:text="@string/charge_confirm_charge"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_20"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
<TextView
|
||||
android:id="@+id/tv_protocol_hint"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginBottom="@dimen/dp_2"
|
||||
android:background="@drawable/bg_login_protocol_hint"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="@dimen/dp_6"
|
||||
android:text="@string/charge_agree_with_the_protocol"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_10"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@id/tv_protocol"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_protocol_hint"
|
||||
android:layout_width="180dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:background="@drawable/bg_login_protocol_hint"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="6dp"
|
||||
android:text="@string/charge_agree_with_the_protocol"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_10"
|
||||
android:visibility="gone" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/tv_protocol"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginBottom="25dp"
|
||||
android:button="@null"
|
||||
android:checked="true"
|
||||
android:drawableStart="@drawable/selector_login_radio_btn"
|
||||
android:drawablePadding="@dimen/dp_5"
|
||||
android:text="@string/text_login_charge_protocol"
|
||||
android:textColor="@color/color_B3B3C3"
|
||||
android:textSize="@dimen/dp_11"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:ignore="SpUsage" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
<CheckBox
|
||||
android:id="@+id/tv_protocol"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginBottom="@dimen/dp_24"
|
||||
android:button="@null"
|
||||
android:checked="true"
|
||||
android:drawableStart="@drawable/selector_login_radio_btn"
|
||||
android:drawablePadding="@dimen/dp_5"
|
||||
android:text="@string/text_login_charge_protocol"
|
||||
android:textColor="#8E9094"
|
||||
android:textSize="@dimen/dp_12"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:ignore="SpUsage" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
@@ -55,7 +55,7 @@
|
||||
android:layout_width="@dimen/dp_18"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:src="@mipmap/ic_charge_diamond"
|
||||
android:src="@drawable/ic_charge_diamond"
|
||||
app:layout_constraintEnd_toStartOf="@id/tv_value"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
@@ -145,7 +145,7 @@
|
||||
android:layout_width="@dimen/dp_16"
|
||||
android:layout_height="@dimen/dp_16"
|
||||
android:layout_marginEnd="@dimen/dp_2"
|
||||
android:src="@mipmap/ic_charge_diamond"
|
||||
android:src="@drawable/ic_charge_diamond"
|
||||
app:layout_constraintBottom_toBottomOf="@id/v_gift"
|
||||
app:layout_constraintEnd_toStartOf="@id/tv_gift_value"
|
||||
app:layout_constraintTop_toTopOf="@id/v_gift" />
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:background="@drawable/bg_home_top"
|
||||
android:background="@drawable/bg_theme_top"
|
||||
app:layout_constraintDimensionRatio="375:178"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:background="@drawable/bg_home_top"
|
||||
android:background="@drawable/bg_theme_top"
|
||||
app:layout_constraintDimensionRatio="375:178"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
@@ -33,7 +33,7 @@
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:background="@drawable/bg_home_top"
|
||||
android:background="@drawable/bg_theme_top"
|
||||
app:layout_constraintDimensionRatio="375:178"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
@@ -29,7 +29,7 @@
|
||||
android:id="@+id/iv_diamond"
|
||||
android:layout_width="@dimen/dp_16"
|
||||
android:layout_height="@dimen/dp_16"
|
||||
android:src="@mipmap/ic_charge_diamond"
|
||||
android:src="@drawable/ic_charge_diamond"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tv_value"
|
||||
app:layout_constraintEnd_toStartOf="@id/tv_value"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
|
@@ -65,7 +65,7 @@
|
||||
android:layout_width="@dimen/dp_16"
|
||||
android:layout_height="@dimen/dp_16"
|
||||
android:layout_marginStart="@dimen/dp_6"
|
||||
android:src="@mipmap/ic_charge_diamond"
|
||||
android:src="@drawable/ic_charge_diamond"
|
||||
app:layout_constraintBottom_toBottomOf="@id/v_bottom_mask"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_gift"
|
||||
app:layout_constraintTop_toTopOf="@id/v_bottom_mask" />
|
||||
|
@@ -79,7 +79,7 @@
|
||||
android:layout_width="@dimen/dp_14"
|
||||
android:layout_height="@dimen/dp_14"
|
||||
android:layout_marginStart="@dimen/dp_2"
|
||||
android:src="@mipmap/ic_charge_diamond"
|
||||
android:src="@drawable/ic_charge_diamond"
|
||||
app:layout_constraintBottom_toBottomOf="@id/v_bottom_mask"
|
||||
app:layout_constraintStart_toEndOf="@id/iv_gift"
|
||||
app:layout_constraintTop_toTopOf="@id/v_bottom_mask" />
|
||||
|
@@ -1,43 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/ll_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:background="@drawable/bg_google_charge_bg_selector"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
android:layout_height="@dimen/dp_72"
|
||||
android:layout_margin="@dimen/dp_8"
|
||||
android:background="@drawable/bg_google_charge_bg_selector">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
android:drawablePadding="@dimen/dp_2"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:textColor="@color/color_333333"
|
||||
android:textSize="20sp"
|
||||
app:drawableStartCompat="@mipmap/ic_charge_diamond"
|
||||
android:textColor="@color/color_1E1E1F"
|
||||
android:textSize="@dimen/dp_16"
|
||||
app:drawableStartCompat="@drawable/ic_charge_diamond"
|
||||
app:layout_constraintBottom_toTopOf="@id/item_charge_money"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
tools:text="400" />
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_charge_money"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_18"
|
||||
android:gravity="end"
|
||||
android:includeFontPadding="false"
|
||||
android:textColor="@color/text_title_color"
|
||||
android:textSize="18sp"
|
||||
android:textColor="@color/color_84868A"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_title"
|
||||
tools:text="0.99" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
Before Width: | Height: | Size: 2.5 KiB |
@@ -714,4 +714,5 @@
|
||||
<color name="color_C9CBD1">#C9CBD1</color>
|
||||
<color name="color_1E1E1F">#1E1E1F</color>
|
||||
<color name="color_84868A">#84868A</color>
|
||||
<color name="color_8E9094">#8E9094</color>
|
||||
</resources>
|
||||
|
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#F7F7F7" />
|
||||
<corners android:radius="8dp" />
|
||||
</shape>
|
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#F7F7F7" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#1E1E1F" />
|
||||
<corners android:radius="8dp" />
|
||||
</shape>
|
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#ffffff" />
|
||||
<corners
|
||||
android:topLeftRadius="16dp"
|
||||
android:topRightRadius="16dp" />
|
||||
</shape>
|
@@ -11,7 +11,6 @@ import com.android.billingclient.api.BillingFlowParams.ProductDetailsParams
|
||||
import com.android.billingclient.api.BillingResult
|
||||
import com.android.billingclient.api.ConsumeParams
|
||||
import com.android.billingclient.api.ProductDetails
|
||||
import com.android.billingclient.api.ProductDetailsResponseListener
|
||||
import com.android.billingclient.api.Purchase
|
||||
import com.android.billingclient.api.PurchasesUpdatedListener
|
||||
import com.android.billingclient.api.QueryProductDetailsParams
|
||||
@@ -19,7 +18,6 @@ import com.android.billingclient.api.QueryPurchasesParams
|
||||
import com.example.module_base.support.billing.IBillingService
|
||||
import com.example.module_base.support.billing.IProductDetails
|
||||
import com.example.module_base.support.billing.IPurchase
|
||||
import com.example.module_base.support.google.IGoogleService
|
||||
import java.io.IOException
|
||||
|
||||
class BillingService(/*活动*/
|
||||
@@ -45,14 +43,6 @@ class BillingService(/*活动*/
|
||||
/*商品列表*/
|
||||
private val purchaseList: MutableList<IPurchase> = ArrayList()
|
||||
|
||||
/*监听接口*/
|
||||
interface BillingUpdatesListener {
|
||||
fun onBillingClientSetupFinished()
|
||||
fun onPurchasesUpdated(purchases: List<Purchase>?)
|
||||
fun onConsumeFinished(token: String?, @BillingResponseCode result: Int)
|
||||
fun onFailedHandle(@BillingResponseCode result: Int)
|
||||
}
|
||||
|
||||
init {
|
||||
billingClient =
|
||||
BillingClient.newBuilder(activity).enablePendingPurchases().setListener(this).build()
|
||||
|