Browse Source

增加内购商品展示

zk 1 year ago
parent
commit
926eaa8309

+ 48 - 3
app/src/main/java/com/atmob/voiceai/data/api/bean/GoodsBean.java

@@ -8,6 +8,9 @@ import com.atmob.voiceai.BR;
 import com.atmob.voiceai.sdk.billing.bean.GPProductInfo;
 import com.atmob.voiceai.sdk.billing.bean.GPProductInfo;
 import com.google.gson.annotations.SerializedName;
 import com.google.gson.annotations.SerializedName;
 
 
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+
 public class GoodsBean extends BaseObservable implements Comparable<GoodsBean> {
 public class GoodsBean extends BaseObservable implements Comparable<GoodsBean> {
     @SerializedName("id")
     @SerializedName("id")
     private int id;
     private int id;
@@ -43,11 +46,39 @@ public class GoodsBean extends BaseObservable implements Comparable<GoodsBean> {
     private boolean popular;
     private boolean popular;
     @SerializedName("authValue")
     @SerializedName("authValue")
     private int authValue;
     private int authValue;
-
+    @SerializedName("subscribable")
+    private int subscribable;
+    @SerializedName("coefficient")
+    private int coefficient;
+    @SerializedName("remark")
+    private String remark;
     private boolean isSelect;
     private boolean isSelect;
-
     private GPProductInfo gpProductInfo;
     private GPProductInfo gpProductInfo;
 
 
+
+    private int integralType;
+
+
+    public int getIntegralType() {
+        return integralType;
+    }
+
+    public void setIntegralType(int integralType) {
+        this.integralType = integralType;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public int getCoefficient() {
+        return coefficient;
+    }
+
+    public int getSubscribable() {
+        return subscribable;
+    }
+
     public int getAuthValue() {
     public int getAuthValue() {
         return authValue;
         return authValue;
     }
     }
@@ -142,7 +173,6 @@ public class GoodsBean extends BaseObservable implements Comparable<GoodsBean> {
         return content;
         return content;
     }
     }
 
 
-
     public void setContent(String content) {
     public void setContent(String content) {
         this.content = content;
         this.content = content;
     }
     }
@@ -171,6 +201,21 @@ public class GoodsBean extends BaseObservable implements Comparable<GoodsBean> {
         this.popular = popular;
         this.popular = popular;
     }
     }
 
 
+    public String getIntegralContent() {
+        if (content == null || content.isEmpty() || gpProductInfo == null) {
+            return content;
+        }
+        BigDecimal amountBigDecimal = new BigDecimal(gpProductInfo.getAmount()).divide(new BigDecimal(1000000), 2, RoundingMode.HALF_UP);
+        float goodsAmount = amountBigDecimal.floatValue();
+        String unit = "";
+        int unitIndex = gpProductInfo.getFormatPrice().indexOf(String.valueOf(goodsAmount));
+        if (unitIndex != -1) {
+            unit = gpProductInfo.getFormatPrice().substring(0, unitIndex);
+        }
+        String unPrice = unit + TextUtil.formatFloatWithout0End(goodsAmount / coefficient, 2);
+        return content.replace("%s", unPrice);
+    }
+
 
 
     @Override
     @Override
     public int compareTo(GoodsBean o) {
     public int compareTo(GoodsBean o) {

+ 6 - 0
app/src/main/java/com/atmob/voiceai/data/repositories/MemberRepository.java

@@ -106,6 +106,12 @@ public class MemberRepository {
                 .compose(RxJavaUtil.SingleSchedule.io2Main());
                 .compose(RxJavaUtil.SingleSchedule.io2Main());
     }
     }
 
 
+    public Single<PayGoodsResponse> purchaseList() {
+        return atmobApi.purchaseList(new PayGoodsRequest(KochavaHelper.isAttributed()))
+                .compose(RxHttpHandler.handle(true))
+                .compose(RxJavaUtil.SingleSchedule.io2Main());
+    }
+
     public Single<OrderPayResponse> requestGoodsPayOrder(int itemId, int payPlatform, int payMethod) {
     public Single<OrderPayResponse> requestGoodsPayOrder(int itemId, int payPlatform, int payMethod) {
         return gpBillingClient.queryPurchase(BillingClient.ProductType.SUBS)
         return gpBillingClient.queryPurchase(BillingClient.ProductType.SUBS)
                 .map(list -> {
                 .map(list -> {

+ 75 - 1
app/src/main/java/com/atmob/voiceai/module/integral/IntegralPurchaseActivity.java

@@ -3,11 +3,17 @@ package com.atmob.voiceai.module.integral;
 import android.app.Activity;
 import android.app.Activity;
 import android.content.Context;
 import android.content.Context;
 import android.content.Intent;
 import android.content.Intent;
+import android.graphics.Rect;
 import android.os.Bundle;
 import android.os.Bundle;
+import android.view.View;
 
 
+import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
 import androidx.annotation.Nullable;
+import androidx.recyclerview.widget.GridLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
 
 
 import com.atmob.app.lib.base.BaseActivity;
 import com.atmob.app.lib.base.BaseActivity;
+import com.atmob.common.ui.SizeUtil;
 import com.atmob.voiceai.databinding.ActivityInternalPurchaseBinding;
 import com.atmob.voiceai.databinding.ActivityInternalPurchaseBinding;
 import com.atmob.voiceai.dialog.CommonLoadingDialog;
 import com.atmob.voiceai.dialog.CommonLoadingDialog;
 import com.atmob.voiceai.utils.BoxingUtil;
 import com.atmob.voiceai.utils.BoxingUtil;
@@ -22,6 +28,9 @@ public class IntegralPurchaseActivity extends BaseActivity<ActivityInternalPurch
     private IntegralPurchaseViewModel integralPurchaseViewModel;
     private IntegralPurchaseViewModel integralPurchaseViewModel;
     private CommonLoadingDialog loadingDialog;
     private CommonLoadingDialog loadingDialog;
 
 
+    private IntegralPurchaseAdapter integralPurchaseAdapter;
+
+
     public static void start(Context context) {
     public static void start(Context context) {
         Intent intent = new Intent(context, IntegralPurchaseActivity.class);
         Intent intent = new Intent(context, IntegralPurchaseActivity.class);
         if (!(context instanceof Activity)) {
         if (!(context instanceof Activity)) {
@@ -39,14 +48,79 @@ public class IntegralPurchaseActivity extends BaseActivity<ActivityInternalPurch
     }
     }
 
 
     private void initView() {
     private void initView() {
-
+        initGoodsList();
     }
     }
 
 
     private void initObserver() {
     private void initObserver() {
+        integralPurchaseViewModel.getGoodsList().observe(this, list -> integralPurchaseAdapter.submitList(list));
         integralPurchaseViewModel.getShowLoading().observe(this, data -> showLoadingDialog(BoxingUtil.boxing(data.getFirst()), data.getSecond()));
         integralPurchaseViewModel.getShowLoading().observe(this, data -> showLoadingDialog(BoxingUtil.boxing(data.getFirst()), data.getSecond()));
         integralPurchaseViewModel.getFinishEvent().observe(this, o -> finish());
         integralPurchaseViewModel.getFinishEvent().observe(this, o -> finish());
     }
     }
 
 
+    private void initGoodsList() {
+        integralPurchaseAdapter = new IntegralPurchaseAdapter(this);
+        integralPurchaseAdapter.setActionHandler(goodsBean -> integralPurchaseViewModel.setCheckGoodsBean(goodsBean));
+        binding.rvGoodsList.setAdapter(integralPurchaseAdapter);
+        GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 6);
+        binding.rvGoodsList.setLayoutManager(gridLayoutManager);
+        gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
+            @Override
+            public int getSpanSize(int position) {
+                int itemViewType = integralPurchaseAdapter.getItemViewType(position);
+                if (itemViewType == IntegralPurchaseAdapter.TYPE_FIRST_ROW) {
+                    return 6;
+                } else if (itemViewType == IntegralPurchaseAdapter.TYPE_SECOND_ROW) {
+                    return 2;
+                } else {
+                    return 3;
+                }
+            }
+        });
+        int horSpacing = (int) (SizeUtil.getScreenWidth() * 0.0305555555555556f);
+        int verSpacing = (int) (SizeUtil.getScreenWidth() * 0.0277777777777778f);
+        binding.rvGoodsList.addItemDecoration(new IntegralGridItemDecoration(horSpacing, verSpacing));
+    }
+
+    public class IntegralGridItemDecoration extends RecyclerView.ItemDecoration {
+
+        private final int horSpacing;
+        private final int verSpacing;
+        private final int spanCount = 6;
+
+        public IntegralGridItemDecoration(int horSpacing, int verSpacing) {
+            this.horSpacing = horSpacing;
+            this.verSpacing = verSpacing;
+        }
+
+        @Override
+        public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
+            int spanSize = spanCount / ((GridLayoutManager.LayoutParams) view.getLayoutParams()).getSpanSize();
+            int childAdapterPosition = parent.getChildAdapterPosition(view);
+            int i = childAdapterPosition % spanSize;
+            outRect.bottom = verSpacing;
+            int itemViewType = integralPurchaseAdapter.getItemViewType(childAdapterPosition);
+            if (itemViewType == IntegralPurchaseAdapter.TYPE_FIRST_ROW) {
+                outRect.left = 0;
+                outRect.right = 0;
+            } else if (itemViewType == IntegralPurchaseAdapter.TYPE_SECOND_ROW) {
+                if (i == 1) {
+                    outRect.right = (horSpacing / spanSize) * (spanSize - 1);
+                } else if (i == 2) {
+                    outRect.left = horSpacing / spanSize;
+                    outRect.right = horSpacing / spanSize;
+                } else {
+                    outRect.left = (horSpacing / spanSize) * (spanSize - 1);
+                }
+            } else if (itemViewType == IntegralPurchaseAdapter.TYPE_THIRD_ROW) {
+                if (i == 0) {
+                    outRect.right = horSpacing / 2;
+                } else {
+                    outRect.left = horSpacing / 2;
+                }
+            }
+        }
+    }
+
     public void showLoadingDialog(boolean show, String msg) {
     public void showLoadingDialog(boolean show, String msg) {
         if (show) {
         if (show) {
             if (loadingDialog == null) {
             if (loadingDialog == null) {

+ 175 - 0
app/src/main/java/com/atmob/voiceai/module/integral/IntegralPurchaseAdapter.java

@@ -0,0 +1,175 @@
+package com.atmob.voiceai.module.integral;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.databinding.ViewDataBinding;
+import androidx.lifecycle.LifecycleOwner;
+import androidx.recyclerview.widget.AsyncListDiffer;
+import androidx.recyclerview.widget.DiffUtil;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.atmob.voiceai.data.api.bean.GoodsBean;
+import com.atmob.voiceai.databinding.ItemIntegralPurchaseGoodsList1Binding;
+import com.atmob.voiceai.databinding.ItemIntegralPurchaseGoodsList2Binding;
+import com.atmob.voiceai.databinding.ItemIntegralPurchaseGoodsList3Binding;
+
+import java.util.List;
+import java.util.Objects;
+
+public class IntegralPurchaseAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
+
+
+    private ActionHandler actionHandler;
+    private final AsyncListDiffer<GoodsBean> listDiffer;
+    private final LifecycleOwner lifecycleOwner;
+
+    private GoodsBean checkedGoodsBean;
+
+    public static final int TYPE_FIRST_ROW = 0;
+    public static final int TYPE_SECOND_ROW = 1;
+    public static final int TYPE_THIRD_ROW = 2;
+
+
+    public IntegralPurchaseAdapter(LifecycleOwner lifecycleOwner) {
+        this.lifecycleOwner = lifecycleOwner;
+        listDiffer = new AsyncListDiffer<>(this, new DiffUtil.ItemCallback<GoodsBean>() {
+            @Override
+            public boolean areItemsTheSame(@NonNull GoodsBean oldItem, @NonNull GoodsBean newItem) {
+                return oldItem.getId() == newItem.getId();
+            }
+
+            @Override
+            public boolean areContentsTheSame(@NonNull GoodsBean oldItem, @NonNull GoodsBean newItem) {
+                return Objects.equals(oldItem.getName(), newItem.getName()) &&
+                        oldItem.getAmount() == newItem.getAmount() &&
+                        oldItem.getOriginalAmount() == newItem.getOriginalAmount() &&
+                        Objects.equals(oldItem.getDescription(), newItem.getDescription()) &&
+                        Objects.equals(oldItem.getRemark(), newItem.getRemark()) &&
+                        oldItem.isPopular() == newItem.isPopular();
+            }
+        });
+    }
+
+    public void setActionHandler(ActionHandler actionHandler) {
+        this.actionHandler = actionHandler;
+    }
+
+    @NonNull
+    @Override
+    public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+        Context context = parent.getContext();
+        LayoutInflater layoutInflater = LayoutInflater.from(context);
+        if (viewType == TYPE_FIRST_ROW) {
+            return new FirstViewHolder(ItemIntegralPurchaseGoodsList1Binding.inflate(layoutInflater, parent, false));
+        } else if (viewType == TYPE_SECOND_ROW) {
+            return new SecondViewHolder(ItemIntegralPurchaseGoodsList2Binding.inflate(layoutInflater, parent, false));
+        } else {
+            return new ThirdViewHolder(ItemIntegralPurchaseGoodsList3Binding.inflate(layoutInflater, parent, false));
+        }
+    }
+
+    @Override
+    public int getItemViewType(int position) {
+        return listDiffer.getCurrentList().get(position).getIntegralType();
+    }
+
+    @Override
+    public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
+        if (holder instanceof FirstViewHolder) {
+            ((FirstViewHolder) holder).bind(listDiffer.getCurrentList().get(position));
+        } else if (holder instanceof SecondViewHolder) {
+            ((SecondViewHolder) holder).bind(listDiffer.getCurrentList().get(position));
+        } else {
+            ((ThirdViewHolder) holder).bind(listDiffer.getCurrentList().get(position));
+        }
+    }
+
+    @Override
+    public int getItemCount() {
+        return listDiffer.getCurrentList().size();
+    }
+
+    public void submitList(List<GoodsBean> list) {
+        if (list != null && !list.isEmpty()) {
+            checkedGoodsBean = list.get(0);
+            checkedGoodsBean.setSelect(true);
+        } else {
+            checkedGoodsBean = null;
+        }
+        if (actionHandler != null) {
+            actionHandler.onItemClick(checkedGoodsBean);
+        }
+        listDiffer.submitList(list);
+    }
+
+    public void setCheckedGoodsBean(GoodsBean viewBean) {
+        if (viewBean == checkedGoodsBean) {
+            return;
+        }
+        if (checkedGoodsBean != null) {
+            checkedGoodsBean.setSelect(false);
+        }
+        checkedGoodsBean = viewBean;
+        checkedGoodsBean.setSelect(true);
+        if (actionHandler != null) {
+            actionHandler.onItemClick(viewBean);
+        }
+    }
+
+    public class FirstViewHolder extends RecyclerView.ViewHolder {
+
+        ItemIntegralPurchaseGoodsList1Binding binding;
+
+        public FirstViewHolder(@NonNull ItemIntegralPurchaseGoodsList1Binding binding) {
+            super(binding.getRoot());
+            this.binding = binding;
+            binding.setLifecycleOwner(lifecycleOwner);
+            binding.setOnItemClick(v -> setCheckedGoodsBean(binding.getGoodsBean()));
+        }
+
+        public void bind(GoodsBean goodsBean) {
+            binding.setGoodsBean(goodsBean);
+        }
+    }
+
+    public class SecondViewHolder extends RecyclerView.ViewHolder {
+
+        ItemIntegralPurchaseGoodsList2Binding binding;
+
+        public SecondViewHolder(@NonNull ItemIntegralPurchaseGoodsList2Binding binding) {
+            super(binding.getRoot());
+            this.binding = binding;
+            binding.setLifecycleOwner(lifecycleOwner);
+            binding.setOnItemClick(v -> setCheckedGoodsBean(binding.getGoodsBean()));
+        }
+
+        public void bind(GoodsBean goodsBean) {
+            binding.setGoodsBean(goodsBean);
+        }
+    }
+
+    public class ThirdViewHolder extends RecyclerView.ViewHolder {
+
+        ItemIntegralPurchaseGoodsList3Binding binding;
+
+        public ThirdViewHolder(@NonNull ItemIntegralPurchaseGoodsList3Binding binding) {
+            super(binding.getRoot());
+            this.binding = binding;
+            binding.setLifecycleOwner(lifecycleOwner);
+            binding.setOnItemClick(v -> setCheckedGoodsBean(binding.getGoodsBean()));
+        }
+
+        public void bind(GoodsBean goodsBean) {
+            binding.setGoodsBean(goodsBean);
+        }
+    }
+
+
+    public interface ActionHandler {
+        void onItemClick(GoodsBean goodsBean);
+    }
+}

+ 94 - 6
app/src/main/java/com/atmob/voiceai/module/integral/IntegralPurchaseViewModel.java

@@ -3,15 +3,30 @@ package com.atmob.voiceai.module.integral;
 import androidx.lifecycle.LiveData;
 import androidx.lifecycle.LiveData;
 import androidx.lifecycle.MutableLiveData;
 import androidx.lifecycle.MutableLiveData;
 
 
+import com.android.billingclient.api.BillingClient;
 import com.atmob.app.lib.base.BaseViewModel;
 import com.atmob.app.lib.base.BaseViewModel;
 import com.atmob.app.lib.livedata.SingleLiveEvent;
 import com.atmob.app.lib.livedata.SingleLiveEvent;
-import com.atmob.voiceai.data.consts.EventId;
-import com.atmob.voiceai.handlers.EventHandler;
-
+import com.atmob.voiceai.data.api.bean.GoodsBean;
+import com.atmob.voiceai.data.api.bean.PayOptionsBean;
+import com.atmob.voiceai.data.repositories.MemberRepository;
+import com.atmob.voiceai.helper.ErrorHelper;
+import com.atmob.voiceai.sdk.billing.GPBillingClient;
+import com.atmob.voiceai.utils.ToastUtil;
+
+import java.util.List;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeUnit;
 
 
 import javax.inject.Inject;
 import javax.inject.Inject;
 
 
+import atmob.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
+import atmob.reactivex.rxjava3.annotations.NonNull;
+import atmob.reactivex.rxjava3.core.Observable;
+import atmob.reactivex.rxjava3.core.ObservableSource;
+import atmob.reactivex.rxjava3.core.SingleObserver;
+import atmob.reactivex.rxjava3.core.SingleSource;
+import atmob.reactivex.rxjava3.disposables.Disposable;
+import atmob.reactivex.rxjava3.functions.Function;
+import atmob.reactivex.rxjava3.schedulers.Schedulers;
 import atmob.rxjava.utils.RxJavaUtil;
 import atmob.rxjava.utils.RxJavaUtil;
 import dagger.hilt.android.lifecycle.HiltViewModel;
 import dagger.hilt.android.lifecycle.HiltViewModel;
 import kotlin.Pair;
 import kotlin.Pair;
@@ -25,11 +40,23 @@ public class IntegralPurchaseViewModel extends BaseViewModel {
     private final MutableLiveData<Boolean> isShowCloseBtn = new MutableLiveData<>();
     private final MutableLiveData<Boolean> isShowCloseBtn = new MutableLiveData<>();
     private final SingleLiveEvent<?> finishEvent = new SingleLiveEvent<>();
     private final SingleLiveEvent<?> finishEvent = new SingleLiveEvent<>();
     private final SingleLiveEvent<Pair<Boolean, String>> showLoading = new SingleLiveEvent<>();
     private final SingleLiveEvent<Pair<Boolean, String>> showLoading = new SingleLiveEvent<>();
+    private final MemberRepository memberRepository;
+    private final GPBillingClient gpBillingClient;
+    private List<PayOptionsBean> payList;
+    private final MutableLiveData<List<GoodsBean>> goodsList = new MutableLiveData<>();
+    private GoodsBean checkGoodsBean;
 
 
 
 
     @Inject
     @Inject
-    public IntegralPurchaseViewModel() {
+    public IntegralPurchaseViewModel(MemberRepository memberRepository, GPBillingClient gpBillingClient) {
+        this.memberRepository = memberRepository;
+        this.gpBillingClient = gpBillingClient;
         init();
         init();
+        refreshIntegralPurchaseDetail();
+    }
+
+    public LiveData<List<GoodsBean>> getGoodsList() {
+        return goodsList;
     }
     }
 
 
     public LiveData<Pair<Boolean, String>> getShowLoading() {
     public LiveData<Pair<Boolean, String>> getShowLoading() {
@@ -52,15 +79,76 @@ public class IntegralPurchaseViewModel extends BaseViewModel {
         addDisposable(RxJavaUtil.timer(3000, TimeUnit.MILLISECONDS, () -> isShowCloseBtn.setValue(true)));
         addDisposable(RxJavaUtil.timer(3000, TimeUnit.MILLISECONDS, () -> isShowCloseBtn.setValue(true)));
     }
     }
 
 
+    public void setCheckGoodsBean(GoodsBean checkGoodsBean) {
+        this.checkGoodsBean = checkGoodsBean;
+    }
+
+
+    private void refreshIntegralPurchaseDetail() {
+        memberRepository.purchaseList()
+                .map(payGoodsResponse -> {
+                    payList = payGoodsResponse.getPayOptions();
+                    return payGoodsResponse.getList();
+                })
+                .flatMapObservable((Function<List<GoodsBean>, ObservableSource<GoodsBean>>) Observable::fromIterable)
+                .flatMapSingle((Function<GoodsBean, SingleSource<GoodsBean>>) memberBean
+                        -> gpBillingClient.queryGoodsDetails(BillingClient.ProductType.INAPP,
+                                memberBean.getGoogleProductId(), memberBean.getPlanId(), memberBean.getLowGoogleProductId())
+                        .map(gPProductInfo -> {
+                            memberBean.setGpProductInfo(gPProductInfo);
+                            return memberBean;
+                        })
+                        .subscribeOn(Schedulers.io())
+                        .onErrorReturn(throwable -> memberBean)
+                )
+                .filter(goodsBean -> goodsBean.getGpProductInfo() != null)
+                .toSortedList()
+                .map(goodsBeanList -> {
+                    for (int i = 0; i < goodsBeanList.size(); i++) {
+                        GoodsBean goodsBean = goodsBeanList.get(i);
+                        if (i == 0) {
+                            goodsBean.setIntegralType(IntegralPurchaseAdapter.TYPE_FIRST_ROW);
+                        } else if (i < 4) {
+                            goodsBean.setIntegralType(IntegralPurchaseAdapter.TYPE_SECOND_ROW);
+                        } else {
+                            goodsBean.setIntegralType(IntegralPurchaseAdapter.TYPE_THIRD_ROW);
+                        }
+                    }
+                    return goodsBeanList;
+                })
+                .subscribeOn(Schedulers.io())
+                .observeOn(AndroidSchedulers.mainThread())
+                .subscribe(new SingleObserver<List<GoodsBean>>() {
+                    @Override
+                    public void onSubscribe(@NonNull Disposable d) {
+                        addDisposable(d);
+                        showQuerySubLoading.setValue(true);
+                    }
+
+                    @Override
+                    public void onSuccess(@NonNull List<GoodsBean> goodsBeanList) {
+                        goodsList.setValue(goodsBeanList);
+                        showQuerySubLoading.setValue(false);
+                    }
+
+                    @Override
+                    public void onError(@NonNull Throwable e) {
+                        showQuerySubLoading.setValue(false);
+                        ErrorHelper.errorThrowableToast(e, ToastUtil.LENGTH_SHORT);
+                    }
+                });
+    }
+
     public void onBackClick() {
     public void onBackClick() {
         finishEvent.call();
         finishEvent.call();
     }
     }
 
 
-    public void onRestoreClick() {
+
+    public void onBuyNowClick() {
 
 
     }
     }
 
 
-    public void onBuyNowClick() {
+    public void onRestoreClick() {
 
 
     }
     }
 
 

+ 1 - 1
app/src/main/java/com/atmob/voiceai/module/subscription/SubscriptionAdapter.java

@@ -44,7 +44,7 @@ public class SubscriptionAdapter extends RecyclerView.Adapter<SubscriptionAdapte
                         oldItem.getAmount() == newItem.getAmount() &&
                         oldItem.getAmount() == newItem.getAmount() &&
                         oldItem.getOriginalAmount() == newItem.getOriginalAmount() &&
                         oldItem.getOriginalAmount() == newItem.getOriginalAmount() &&
                         Objects.equals(oldItem.getDescription(), newItem.getDescription()) &&
                         Objects.equals(oldItem.getDescription(), newItem.getDescription()) &&
-                        Objects.equals(oldItem.getContent(), newItem.getContent()) &&
+                        Objects.equals(oldItem.getRemark(), newItem.getRemark()) &&
                         oldItem.isPopular() == newItem.isPopular();
                         oldItem.isPopular() == newItem.isPopular();
             }
             }
         });
         });

+ 1 - 3
app/src/main/java/com/atmob/voiceai/module/subscription/SubscriptionPageViewModel.java

@@ -8,7 +8,6 @@ import androidx.lifecycle.MutableLiveData;
 
 
 import com.android.billingclient.api.BillingClient;
 import com.android.billingclient.api.BillingClient;
 import com.android.billingclient.api.BillingResult;
 import com.android.billingclient.api.BillingResult;
-import com.android.billingclient.api.Purchase;
 import com.atmob.app.lib.base.BaseViewModel;
 import com.atmob.app.lib.base.BaseViewModel;
 import com.atmob.app.lib.handler.RxHttpHandler;
 import com.atmob.app.lib.handler.RxHttpHandler;
 import com.atmob.app.lib.livedata.SingleLiveEvent;
 import com.atmob.app.lib.livedata.SingleLiveEvent;
@@ -27,7 +26,6 @@ import com.atmob.voiceai.handlers.EventHandler;
 import com.atmob.voiceai.helper.ErrorHelper;
 import com.atmob.voiceai.helper.ErrorHelper;
 import com.atmob.voiceai.sdk.billing.GPBillingClient;
 import com.atmob.voiceai.sdk.billing.GPBillingClient;
 import com.atmob.voiceai.utils.BoxingUtil;
 import com.atmob.voiceai.utils.BoxingUtil;
-import com.atmob.voiceai.utils.SpannableUtil;
 import com.atmob.voiceai.utils.ToastUtil;
 import com.atmob.voiceai.utils.ToastUtil;
 
 
 import java.util.List;
 import java.util.List;
@@ -163,7 +161,7 @@ public class SubscriptionPageViewModel extends BaseViewModel {
                 })
                 })
                 .flatMapObservable((Function<List<GoodsBean>, ObservableSource<GoodsBean>>) Observable::fromIterable)
                 .flatMapObservable((Function<List<GoodsBean>, ObservableSource<GoodsBean>>) Observable::fromIterable)
                 .flatMapSingle((Function<GoodsBean, SingleSource<GoodsBean>>) memberBean
                 .flatMapSingle((Function<GoodsBean, SingleSource<GoodsBean>>) memberBean
-                        -> gpBillingClient.querySkuDetails(BillingClient.ProductType.SUBS,
+                        -> gpBillingClient.queryGoodsDetails(BillingClient.ProductType.SUBS,
                                 memberBean.getGoogleProductId(), memberBean.getPlanId(), memberBean.getLowGoogleProductId())
                                 memberBean.getGoogleProductId(), memberBean.getPlanId(), memberBean.getLowGoogleProductId())
                         .map(gPProductInfo -> {
                         .map(gPProductInfo -> {
                             memberBean.setGpProductInfo(gPProductInfo);
                             memberBean.setGpProductInfo(gPProductInfo);

+ 1 - 1
app/src/main/java/com/atmob/voiceai/sdk/billing/GPBillingClient.java

@@ -344,7 +344,7 @@ public class GPBillingClient implements PurchasesUpdatedListener {
     }
     }
 
 
 
 
-    public Single<GPProductInfo> querySkuDetails(String productType, @NonNull String productId, @Nullable String basePlanId, @Nullable String legacyProductId) {
+    public Single<GPProductInfo> queryGoodsDetails(String productType, @NonNull String productId, @Nullable String basePlanId, @Nullable String legacyProductId) {
         return Single.fromCallable(() -> {
         return Single.fromCallable(() -> {
                     if (ProcessUtil.isMainThread()) {
                     if (ProcessUtil.isMainThread()) {
                         throw new IllegalStateException("querySkuDetails must not be called on the main thread");
                         throw new IllegalStateException("querySkuDetails must not be called on the main thread");

+ 3 - 1
app/src/main/java/com/atmob/voiceai/sdk/billing/classify/QueryGoods.java

@@ -1,5 +1,7 @@
 package com.atmob.voiceai.sdk.billing.classify;
 package com.atmob.voiceai.sdk.billing.classify;
 
 
+import android.text.TextUtils;
+
 import androidx.annotation.NonNull;
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
 import androidx.annotation.Nullable;
 
 
@@ -78,8 +80,8 @@ public class QueryGoods {
     private static Single<GPProductInfo> querySkuDetails(BillingClient billingClient, String productType, @NonNull String productId, @Nullable String basePlanId, @Nullable String legacyProductId) {
     private static Single<GPProductInfo> querySkuDetails(BillingClient billingClient, String productType, @NonNull String productId, @Nullable String basePlanId, @Nullable String legacyProductId) {
         AtmobLog.i(TAG, "querySkuDetails() called with: productType = [" + productType + "], productId = [" + productId + "], legacyProductId = [" + legacyProductId + "]");
         AtmobLog.i(TAG, "querySkuDetails() called with: productType = [" + productType + "], productId = [" + productId + "], legacyProductId = [" + legacyProductId + "]");
         SkuDetailsParams detailsParams = SkuDetailsParams.newBuilder()
         SkuDetailsParams detailsParams = SkuDetailsParams.newBuilder()
+                .setSkusList(Collections.singletonList(!TextUtils.isEmpty(legacyProductId) ? legacyProductId : productId))
                 .setType(productType)
                 .setType(productType)
-                .setSkusList(Collections.singletonList(legacyProductId != null ? legacyProductId : productId))
                 .build();
                 .build();
         return Single.create(emitter -> billingClient.querySkuDetailsAsync(detailsParams, (billingResult, list) -> {
         return Single.create(emitter -> billingClient.querySkuDetailsAsync(detailsParams, (billingResult, list) -> {
             AtmobLog.d(TAG, "onSkuDetailsResponse() called with: billingResult = [" + billingResult + "], list = [" + list + "]");
             AtmobLog.d(TAG, "onSkuDetailsResponse() called with: billingResult = [" + billingResult + "], list = [" + list + "]");

+ 7 - 0
app/src/main/res/drawable/bg_integral_purchase_goods_list_2.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <corners
+        android:bottomLeftRadius="18dp"
+        android:bottomRightRadius="18dp" />
+    <solid android:color="#39413A" />
+</shape>

+ 9 - 0
app/src/main/res/drawable/bg_sub_goods_list_2.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <corners android:radius="16dp" />
+    <solid android:color="#202320" />
+
+    <stroke
+        android:width="2dp"
+        android:color="#32333C" />
+</shape>

+ 4 - 0
app/src/main/res/drawable/bg_sub_goods_selected.xml

@@ -4,4 +4,8 @@
     <stroke
     <stroke
         android:width="2dp"
         android:width="2dp"
         android:color="@color/colorPrimaryVariant" />
         android:color="@color/colorPrimaryVariant" />
+
+    <gradient
+        android:startColor="#2B3230"
+        android:endColor="#002B3230" />
 </shape>
 </shape>

+ 15 - 28
app/src/main/res/layout/activity_internal_purchase.xml

@@ -254,8 +254,8 @@
                     android:overScrollMode="never"
                     android:overScrollMode="never"
                     app:layout_constraintTop_toBottomOf="@+id/space3"
                     app:layout_constraintTop_toBottomOf="@+id/space3"
                     tools:itemCount="3"
                     tools:itemCount="3"
-                    tools:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
-                    tools:listitem="@layout/item_sub_goods_list"
+                    tools:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
+                    tools:listitem="@layout/item_integral_purchase_goods_list_1"
                     tools:orientation="vertical" />
                     tools:orientation="vertical" />
 
 
                 <Space
                 <Space
@@ -285,19 +285,6 @@
             app:layout_constraintDimensionRatio="360:65"
             app:layout_constraintDimensionRatio="360:65"
             app:layout_constraintTop_toBottomOf="@+id/v_status_bar" />
             app:layout_constraintTop_toBottomOf="@+id/v_status_bar" />
 
 
-        <TextView
-            android:id="@+id/tv_bar_title"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:alpha="0"
-            android:text="@string/sub_bar_title"
-            android:textColor="@color/white"
-            android:textSize="17sp"
-            android:textStyle="bold"
-            app:layout_constraintBottom_toBottomOf="@+id/v_menu"
-            app:layout_constraintEnd_toEndOf="@+id/v_menu"
-            app:layout_constraintStart_toStartOf="@+id/v_menu"
-            app:layout_constraintTop_toTopOf="@+id/v_menu" />
 
 
         <ImageView
         <ImageView
             android:id="@+id/iv_back"
             android:id="@+id/iv_back"
@@ -314,19 +301,6 @@
             app:layout_constraintTop_toTopOf="@+id/v_menu"
             app:layout_constraintTop_toTopOf="@+id/v_menu"
             app:layout_constraintWidth_percent="0.1" />
             app:layout_constraintWidth_percent="0.1" />
 
 
-        <TextView
-            expandTouchSize="@{5}"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginEnd="@dimen/app_common_page_horizontal_padding"
-            android:onClick="@{()-> integralViewModel.onRestoreClick()}"
-            android:text="@string/sub_restore"
-            android:textColor="@color/white"
-            android:textSize="14sp"
-            app:layout_constraintBottom_toBottomOf="@+id/iv_back"
-            app:layout_constraintEnd_toEndOf="parent"
-            app:layout_constraintTop_toTopOf="@+id/iv_back" />
-
 
 
         <Space
         <Space
             android:id="@+id/space_sub"
             android:id="@+id/space_sub"
@@ -355,6 +329,19 @@
             app:layout_constraintWidth_percent="0.9333333333333333" />
             app:layout_constraintWidth_percent="0.9333333333333333" />
 
 
         <TextView
         <TextView
+            expandTouchSize="@{5}"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginEnd="@dimen/app_common_page_horizontal_padding"
+            android:onClick="@{()-> integralViewModel.onRestoreClick()}"
+            android:text="@string/sub_restore"
+            android:textColor="@color/white"
+            android:textSize="14sp"
+            app:layout_constraintBottom_toBottomOf="@+id/iv_back"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintTop_toTopOf="@+id/iv_back" />
+
+        <TextView
             android:id="@+id/tv_auto_renewable"
             android:id="@+id/tv_auto_renewable"
             android:layout_width="0dp"
             android:layout_width="0dp"
             android:layout_height="wrap_content"
             android:layout_height="wrap_content"

+ 84 - 0
app/src/main/res/layout/item_integral_purchase_goods_list_1.xml

@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout 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">
+
+    <data>
+
+        <variable
+            name="goodsBean"
+            type="com.atmob.voiceai.data.api.bean.GoodsBean" />
+
+        <variable
+            name="onItemClick"
+            type="android.view.View.OnClickListener" />
+    </data>
+
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+
+        <View
+            android:id="@+id/v_goods_bg"
+            android:layout_width="match_parent"
+            android:layout_height="0dp"
+            android:background="@{goodsBean.select ? @drawable/bg_sub_goods_selected : @drawable/bg_sub_goods_list}"
+            android:onClick="@{onItemClick}"
+            tools:background="@drawable/bg_sub_goods_list"
+            app:layout_constraintDimensionRatio="328:80"
+            app:layout_constraintTop_toTopOf="parent" />
+
+        <ImageView
+            android:id="@+id/iv_goods_icon"
+            app:layout_constraintHorizontal_bias="0.0686274509803922"
+            app:layout_constraintVertical_bias="0.2727272727272727"
+            app:layout_constraintWidth_percent="0.0670731707317073"
+            app:layout_constraintStart_toStartOf="@+id/v_goods_bg"
+            app:layout_constraintEnd_toEndOf="@+id/v_goods_bg"
+            app:layout_constraintBottom_toBottomOf="@+id/v_goods_bg"
+            app:layout_constraintTop_toTopOf="@+id/v_goods_bg"
+            android:src="@drawable/icon_voice_consumption_integration"
+            app:layout_constraintDimensionRatio="59:71"
+            android:layout_width="0dp"
+            android:layout_height="0dp" />
+
+        <TextView
+            tools:text="50,000"
+            android:textColor="@color/colorPrimaryVariant"
+            android:textSize="20sp"
+            android:layout_marginStart="7dp"
+            app:layout_constraintTop_toTopOf="@+id/iv_goods_icon"
+            app:layout_constraintBottom_toBottomOf="@+id/iv_goods_icon"
+            app:layout_constraintStart_toEndOf="@+id/iv_goods_icon"
+            android:text="@{goodsBean.name}"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content" />
+
+        <TextView
+            android:text="@{goodsBean.gpProductInfo.formatPrice}"
+            tools:text="US$ 69.99"
+            android:layout_marginEnd="17dp"
+            app:layout_constraintEnd_toEndOf="@id/v_goods_bg"
+            app:layout_constraintTop_toTopOf="@+id/iv_goods_icon"
+            app:layout_constraintBottom_toBottomOf="@+id/iv_goods_icon"
+            android:id="@+id/tv_goods_price"
+            android:textSize="20sp"
+            android:textColor="@color/white"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content" />
+
+        <TextView
+            android:text="@{goodsBean.integralContent}"
+            app:layout_constraintVertical_bias="0.7936507936507937"
+            app:layout_constraintStart_toStartOf="@+id/v_goods_bg"
+            app:layout_constraintEnd_toEndOf="@+id/v_goods_bg"
+            app:layout_constraintTop_toTopOf="@+id/v_goods_bg"
+            app:layout_constraintBottom_toBottomOf="@+id/v_goods_bg"
+            android:textSize="15sp"
+            android:textColor="#848E8B"
+            tools:text="US$1.39 / 1,000 credits"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content" />
+
+    </androidx.constraintlayout.widget.ConstraintLayout>
+</layout>

+ 84 - 0
app/src/main/res/layout/item_integral_purchase_goods_list_2.xml

@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout 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">
+
+    <data>
+
+        <variable
+            name="goodsBean"
+            type="com.atmob.voiceai.data.api.bean.GoodsBean" />
+
+        <variable
+            name="onItemClick"
+            type="android.view.View.OnClickListener" />
+
+    </data>
+
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+
+        <View
+            android:id="@+id/v_goods_bg"
+            android:layout_width="match_parent"
+            android:layout_height="0dp"
+            android:background="@{goodsBean.select ? @drawable/bg_sub_goods_selected : @drawable/bg_sub_goods_list}"
+            android:onClick="@{onItemClick}"
+            tools:background="@drawable/bg_sub_goods_list_2"
+            app:layout_constraintDimensionRatio="102:113"
+            app:layout_constraintTop_toTopOf="parent" />
+
+        <ImageView
+            app:layout_constraintVertical_bias="0.1473684210526316"
+            android:id="@+id/iv_goods_icon"
+            app:layout_constraintWidth_percent="0.1568627450980392"
+            app:layout_constraintStart_toStartOf="@+id/v_goods_bg"
+            app:layout_constraintEnd_toEndOf="@+id/v_goods_bg"
+            app:layout_constraintBottom_toBottomOf="@+id/v_goods_bg"
+            app:layout_constraintTop_toTopOf="@+id/v_goods_bg"
+            android:src="@drawable/icon_voice_consumption_integration"
+            app:layout_constraintDimensionRatio="59:71"
+            android:layout_width="0dp"
+            android:layout_height="0dp" />
+
+        <TextView
+            app:layout_constraintStart_toStartOf="@+id/v_goods_bg"
+            app:layout_constraintEnd_toEndOf="@+id/v_goods_bg"
+            app:layout_constraintTop_toTopOf="@+id/v_goods_bg"
+            app:layout_constraintVertical_bias="0.4666666666666667"
+            app:layout_constraintBottom_toBottomOf="@+id/v_goods_bg"
+            tools:text="50,000"
+            android:textColor="@color/colorPrimaryVariant"
+            android:textSize="20sp"
+            android:text="@{goodsBean.name}"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content" />
+
+
+        <View
+            android:id="@+id/v_goods_price"
+            android:background="@drawable/bg_integral_purchase_goods_list_2"
+            android:layout_marginBottom="2dp"
+            android:layout_marginHorizontal="2dp"
+            app:layout_constraintBottom_toBottomOf="@id/v_goods_bg"
+            app:layout_constraintDimensionRatio="98:32"
+            android:layout_width="match_parent"
+            android:layout_height="0dp" />
+
+        <TextView
+            app:layout_constraintTop_toTopOf="@+id/v_goods_price"
+            app:layout_constraintBottom_toBottomOf="@+id/v_goods_price"
+            app:layout_constraintStart_toStartOf="@+id/v_goods_price"
+            app:layout_constraintEnd_toEndOf="@+id/v_goods_price"
+            android:text="@{goodsBean.gpProductInfo.formatPrice}"
+            tools:text="US$ 69.99"
+            android:id="@+id/tv_goods_price"
+            android:textSize="14sp"
+            android:textColor="@color/white"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content" />
+
+
+    </androidx.constraintlayout.widget.ConstraintLayout>
+</layout>

+ 71 - 0
app/src/main/res/layout/item_integral_purchase_goods_list_3.xml

@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layout 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">
+
+    <data>
+
+        <variable
+            name="goodsBean"
+            type="com.atmob.voiceai.data.api.bean.GoodsBean" />
+
+        <variable
+            name="onItemClick"
+            type="android.view.View.OnClickListener" />
+    </data>
+
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+
+        <View
+            android:id="@+id/v_goods_bg"
+            android:layout_width="match_parent"
+            android:layout_height="0dp"
+            android:background="@{goodsBean.select ? @drawable/bg_sub_goods_selected : @drawable/bg_sub_goods_list}"
+            android:onClick="@{onItemClick}"
+            tools:background="@drawable/bg_sub_goods_list_2"
+            app:layout_constraintDimensionRatio="159:70"
+            app:layout_constraintTop_toTopOf="parent" />
+
+        <ImageView
+            android:id="@+id/iv_goods_icon"
+            app:layout_constraintHorizontal_bias="0.1048951048951049"
+            app:layout_constraintVertical_bias="0.25"
+            app:layout_constraintWidth_percent="0.1006289308176101"
+            app:layout_constraintStart_toStartOf="@+id/v_goods_bg"
+            app:layout_constraintEnd_toEndOf="@+id/v_goods_bg"
+            app:layout_constraintBottom_toBottomOf="@+id/v_goods_bg"
+            app:layout_constraintTop_toTopOf="@+id/v_goods_bg"
+            android:src="@drawable/icon_voice_consumption_integration"
+            app:layout_constraintDimensionRatio="59:71"
+            android:layout_width="0dp"
+            android:layout_height="0dp" />
+
+        <TextView
+            tools:text="50,000"
+            android:textColor="@color/colorPrimaryVariant"
+            android:textSize="20sp"
+            android:layout_marginStart="7dp"
+            app:layout_constraintTop_toTopOf="@+id/iv_goods_icon"
+            app:layout_constraintBottom_toBottomOf="@+id/iv_goods_icon"
+            app:layout_constraintStart_toEndOf="@+id/iv_goods_icon"
+            android:text="@{goodsBean.name}"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content" />
+
+        <TextView
+            android:text="@{goodsBean.gpProductInfo.formatPrice}"
+            tools:text="US$ 69.99"
+            app:layout_constraintStart_toStartOf="@+id/iv_goods_icon"
+            android:id="@+id/tv_goods_price"
+            android:textSize="14sp"
+            app:layout_constraintTop_toTopOf="@+id/v_goods_bg"
+            app:layout_constraintBottom_toBottomOf="@+id/v_goods_bg"
+            app:layout_constraintVertical_bias="0.7847866419294991"
+            android:textColor="@color/white"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content" />
+
+    </androidx.constraintlayout.widget.ConstraintLayout>
+</layout>

+ 10 - 14
app/src/main/res/layout/item_sub_goods_list.xml

@@ -30,6 +30,14 @@
             app:layout_constraintDimensionRatio="360:12.5"
             app:layout_constraintDimensionRatio="360:12.5"
             app:layout_constraintTop_toTopOf="parent" />
             app:layout_constraintTop_toTopOf="parent" />
 
 
+        <View
+            android:id="@+id/v_divider"
+            isGone="@{!showDivider}"
+            android:layout_width="match_parent"
+            android:layout_height="1dp"
+            android:layout_marginHorizontal="9dp"
+            android:background="@drawable/bg_sub_line"
+            app:layout_constraintBottom_toBottomOf="@+id/v_goods_bg" />
 
 
         <View
         <View
             android:id="@+id/v_goods_bg"
             android:id="@+id/v_goods_bg"
@@ -67,7 +75,6 @@
             android:text="@{goodsBean.name}"
             android:text="@{goodsBean.name}"
             android:textColor="@{goodsBean.select ? @color/colorPrimaryVariant : @color/white}"
             android:textColor="@{goodsBean.select ? @color/colorPrimaryVariant : @color/white}"
             android:textSize="20sp"
             android:textSize="20sp"
-            android:textStyle="bold"
             app:layout_constraintBottom_toTopOf="@+id/tv_content"
             app:layout_constraintBottom_toTopOf="@+id/tv_content"
             app:layout_constraintStart_toStartOf="@+id/v_goods_bg"
             app:layout_constraintStart_toStartOf="@+id/v_goods_bg"
             app:layout_constraintTop_toTopOf="@+id/v_goods_bg"
             app:layout_constraintTop_toTopOf="@+id/v_goods_bg"
@@ -93,13 +100,13 @@
             android:layout_height="wrap_content"
             android:layout_height="wrap_content"
             android:layout_marginStart="5.5dp"
             android:layout_marginStart="5.5dp"
             android:layout_marginTop="4dp"
             android:layout_marginTop="4dp"
-            android:text="@{goodsBean.content}"
+            android:text="@{goodsBean.remark}"
             android:textColor="@color/white50"
             android:textColor="@color/white50"
             android:textSize="12sp"
             android:textSize="12sp"
             app:layout_constraintBottom_toBottomOf="@+id/v_goods_bg"
             app:layout_constraintBottom_toBottomOf="@+id/v_goods_bg"
             app:layout_constraintStart_toEndOf="@+id/iv_icon"
             app:layout_constraintStart_toEndOf="@+id/iv_icon"
             app:layout_constraintTop_toBottomOf="@+id/tv_goods_name"
             app:layout_constraintTop_toBottomOf="@+id/tv_goods_name"
-            tools:text="$0.77/week" />
+            tools:text="20000 renew yearly" />
 
 
         <TextView
         <TextView
             android:id="@+id/tv_price"
             android:id="@+id/tv_price"
@@ -109,7 +116,6 @@
             android:text="@{goodsBean.gpProductInfo.formatPrice}"
             android:text="@{goodsBean.gpProductInfo.formatPrice}"
             android:textColor="@color/white"
             android:textColor="@color/white"
             android:textSize="20sp"
             android:textSize="20sp"
-            android:textStyle="bold"
             app:layout_constraintBottom_toTopOf="@+id/tv_description"
             app:layout_constraintBottom_toTopOf="@+id/tv_description"
             app:layout_constraintEnd_toEndOf="@id/v_goods_bg"
             app:layout_constraintEnd_toEndOf="@id/v_goods_bg"
             app:layout_constraintTop_toTopOf="@id/v_goods_bg"
             app:layout_constraintTop_toTopOf="@id/v_goods_bg"
@@ -133,15 +139,5 @@
             tools:text="80% OFF" />
             tools:text="80% OFF" />
 
 
 
 
-        <View
-            android:id="@+id/v_divider"
-            isGone="@{!showDivider}"
-            android:layout_width="match_parent"
-            android:layout_height="1dp"
-            android:layout_marginHorizontal="9dp"
-            android:background="@drawable/bg_sub_line"
-            app:layout_constraintBottom_toBottomOf="@+id/v_goods_bg" />
-
-
     </androidx.constraintlayout.widget.ConstraintLayout>
     </androidx.constraintlayout.widget.ConstraintLayout>
 </layout>
 </layout>