Commit ef10c020 authored by jyx's avatar jyx

更新VIP页面样式

parent df0c7c61
......@@ -2,15 +2,12 @@ package com.mints.helivideo.mvp.presenters
import com.mints.helivideo.MintsApplication
import com.mints.helivideo.manager.AppHttpManager
import com.mints.helivideo.mvp.model.BaseResponse
import com.mints.helivideo.mvp.model.VipBean
import com.mints.helivideo.mvp.model.WxPayParamBean
import com.mints.helivideo.mvp.views.VipView
import com.mints.library.net.neterror.BaseSubscriber
import com.mints.library.net.neterror.Throwable
import com.mints.helivideo.common.DeviceInfo
import com.mints.helivideo.manager.UserManager
import com.mints.helivideo.mvp.model.UserBean
import com.mints.helivideo.mvp.model.*
import com.mints.helivideo.utils.DeviceUuidFactory
import java.util.*
......@@ -209,4 +206,34 @@ class VipPresenter : BasePresenter<VipView>() {
}
})
}
fun orders() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.orders(),
object : BaseSubscriber<BaseResponse<BannerList>>() {
override fun onCompleted() {
if (isLinkView) return
}
override fun onError(e: Throwable) {
if (isLinkView) return
}
override fun onNext(baseResponse: BaseResponse<BannerList>) {
if (isLinkView) return
val code = baseResponse.status
val message = baseResponse.message
when (code) {
200 -> {
view.ordersSuc(baseResponse.data)
}
else -> {
view.showToast(message)
}
}
}
})
}
}
\ No newline at end of file
package com.mints.helivideo.mvp.views
import com.mints.helivideo.mvp.model.BannerList
import com.mints.helivideo.mvp.model.VipBean
import com.mints.helivideo.mvp.model.WxPayParamBean
......@@ -7,4 +8,6 @@ interface VipView : BaseView {
fun getVipProductSuc(data: VipBean)
fun getVipPayParamsSuc(payChannel:String,data: WxPayParamBean)
fun queryVipOrderSuc(isPay:Boolean)
fun ordersSuc(data: BannerList?)
}
\ No newline at end of file
package com.mints.helivideo.ui.adapter
import android.content.Context
import android.graphics.Color
import android.graphics.Paint
import android.text.TextUtils
import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.RelativeLayout
import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import com.mints.helivideo.R
import com.mints.helivideo.mvp.model.VipBean
import com.mints.helivideo.utils.UIUtils
class VipAdapter(val vipList: MutableList<VipBean.ListBean>) :
RecyclerView.Adapter<VipAdapter.ViewHolder>() {
......@@ -53,12 +51,18 @@ class VipAdapter(val vipList: MutableList<VipBean.ListBean>) :
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val vipBean = vipList[position]
holder.tvVipItemTitle.text = vipBean.title
if (TextUtils.isEmpty(vipBean.topTitle)) {
holder.tvVipItemLable.visibility = View.INVISIBLE
if (vipBean.trial != 0) {
holder.tvVipItemLable.setPadding(0, 0, 0, 0)
holder.tvVipItemLable.text = "限时特惠"
holder.tvVipItemLable.gravity = Gravity.CENTER
holder.tvVipItemLable.setBackgroundResource(R.mipmap.ic_vip_lable)
} else {
holder.tvVipItemLable.text = vipBean.topTitle
holder.tvVipItemLable.visibility = View.VISIBLE
holder.tvVipItemLable.setPadding(0, 0, UIUtils.dp2px(10), 0)
holder.tvVipItemLable.gravity = Gravity.END or Gravity.CENTER_VERTICAL
holder.tvVipItemLable.text = "可微信支付"
holder.tvVipItemLable.setBackgroundResource(R.mipmap.ic_vip_lable_wx)
}
if (vipBean.price < 1) {
holder.tvVipItemCurMoney.text = "¥${vipBean.price}"
} else {
......@@ -84,11 +88,11 @@ class VipAdapter(val vipList: MutableList<VipBean.ListBean>) :
if (getPosition() == position) {
//当前选中
holder.rlVipItemRoot.setBackgroundResource(R.drawable.shape_vip_adapter)
holder.rlVipItemRoot.setBackgroundResource(R.mipmap.ic_vip_selected)
holder.tvVipItemCurMoney.setTextColor(
ContextCompat.getColor(
context,
R.color.color_FF7563
R.color.color_FD7E0E
)
)
} else {
......
package com.mints.helivideo.ui.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import com.mints.helivideo.R;
import com.mints.helivideo.mvp.model.VedioBean;
import com.mints.library.utils.GlideUtils;
import com.youth.banner.adapter.BannerAdapter;
import java.util.List;
public class VipBannerAdapter extends BannerAdapter<VedioBean, ImageTitleHolder> {
private Context context;
public VipBannerAdapter(List<VedioBean> data) {
super(data);
}
@Override
public ImageTitleHolder onCreateHolder(ViewGroup parent, int viewType) {
context = parent.getContext();
return new ImageTitleHolder(LayoutInflater.from(context).inflate(R.layout.item_banner_vip, parent, false));
}
@Override
public void onBindView(ImageTitleHolder holder, VedioBean data, int position, int size) {
if (data.getCoverImage() != null) {
GlideUtils.INSTANCE.loadImageViewGifForCenterCrop(context, data.getCoverImage(), holder.imageView, 15);
}
holder.title.setText(data.getTitle());
}
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:centerColor="@color/half_transparent"
android:centerX="0.5"
android:centerY="0.5"
android:endColor="@color/black"
android:gradientRadius="200dp"
android:startColor="@color/full_transparent"
android:type="radial" />
</shape>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
......@@ -27,7 +27,7 @@
<color name="apk_uninstalled">#fea54c</color>
<color name="color_2F155E">#2F155E</color>
<color name="color_8D8F90">#7F8182</color>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment