Commit 4776f27b authored by jyx's avatar jyx

优化样式

parent 31d876fc
package com.duben.speedplayletu.ui.adapter
import android.content.Context
import android.graphics.Color
import android.graphics.Paint
import android.text.TextUtils
import android.view.Gravity
......@@ -111,19 +112,34 @@ class VipAdapter(val vipList: MutableList<VipBean.ListBean>) :
// holder.tvVipItemCurMoney.text = "¥${vipBean.price}"
//// holder.tvVipItemCurMoney.text = "¥${String.format("%.0f", vipBean.price)}"
// }
if(vipBean.price==0.0){
if (vipBean.payToModel == 2) {
// 跳转小程序领券
holder.tvVipItemCurMoney.text = SpanUtils()
.append(vipBean.oldPrice.toInt().toString())
.setFontSize(BubbleUtils.sp2px(34))
.append(" 元\n")
.setFontSize(BubbleUtils.sp2px(14))
.append("原价:" + vipBean.price.toInt().toString() + " 元")
.setFontSize(BubbleUtils.sp2px(12))
.setStrikethrough()
.create()
} else {
if (vipBean.price == 0.0) {
holder.tvVipItemCurMoney.text = SpanUtils()
.append("0.01")
.setFontSize(BubbleUtils.sp2px(34))
.append("元")
.create()
}else{
} else {
holder.tvVipItemCurMoney.text = SpanUtils()
.append(vipBean.price.toString())
.append(vipBean.price.toInt().toString())
.setFontSize(BubbleUtils.sp2px(34))
.append("元")
.create()
}
}
// if (vipBean.oldPrice > 0) {
// holder.tvVipItemMoney.visibility = View.VISIBLE
......
......@@ -13,6 +13,7 @@ import android.widget.TextView
import com.duben.speedplayletu.R
import com.duben.speedplayletu.common.AppConfig
import com.duben.speedplayletu.mvp.model.VipBean
import com.duben.speedplayletu.utils.BubbleUtils
import com.duben.speedplayletu.utils.SpanUtils
class PayYesDialog(
......@@ -54,7 +55,20 @@ class PayYesDialog(
rl_dialog_vip_bg = findViewById<View>(R.id.rl_dialog_vip_bg) as RelativeLayout
iv_dialog_vip_quit.setOnClickListener(listener)
tv_dialog_vip_next.setOnClickListener(listener)
iv_dialog_vip_top.setImageResource(R.mipmap.ic_vip_pay_top2)
if (vipBean.payToModel == 2) {
// 跳转小程序领券
tv_dialog_vip_count.text = SpanUtils()
.append(vipBean.oldPrice.toInt().toString())
.setFontSize(BubbleUtils.sp2px(30))
.append(" 元\n")
.setFontSize(BubbleUtils.sp2px(16))
.append("原价:" + vipBean.price.toInt().toString() + " 元")
.setFontSize(BubbleUtils.sp2px(12))
.setStrikethrough()
.create()
} else {
if (vipBean.price == 0.0) {
//0-没签约 无0.01
tv_dialog_vip_count.text = SpanUtils()
......@@ -63,15 +77,14 @@ class PayYesDialog(
.append(" 元")
.setFontSize(16, true)
.create()
iv_dialog_vip_top.setImageResource(R.mipmap.ic_vip_pay_top2)
} else {
tv_dialog_vip_count.text = SpanUtils()
.append(""+vipBean.price)
.append("" + vipBean.price.toInt())
.setFontSize(30, true)
.append(" 元")
.setFontSize(16, true)
.create()
iv_dialog_vip_top.setImageResource(R.mipmap.ic_vip_pay_top2)
}
}
}
}
\ No newline at end of file
......@@ -271,7 +271,11 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
override fun getVipProductSuc(data: VipBean) {
if (data.list != null && data.list.size > 0) {
AppConfig.firstVipPrice = data.list.get(0).price
if (data.list[0].payToModel == 2) {
AppConfig.firstVipPrice = data.list[0].oldPrice
} else {
AppConfig.firstVipPrice = data.list[0].price
}
}
}
......@@ -297,14 +301,19 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
val data = mutableListOf<VideoMultiItemEntity>()
if (videos.size > 0) {
for (video in videos) {
if (video.isLock) {
val item = VideoMultiItemEntity(MULTI_ITEM_2, video, VideoModel(video.vedioUrl))
data.add(item)
} else {
val item = VideoMultiItemEntity(MULTI_ITEM_1, video, VideoModel(video.vedioUrl))
data.add(item)
}
if (mVedioBean!!.unlockIndex < mVedioBean!!.vedioTotal) {
val item =
VideoMultiItemEntity(MULTI_ITEM_2, videos[0], VideoModel(videos[0].vedioUrl))
data.add(item)
}
// if (mVedioBean!!.unlockIndex < mVedioBean!!.vedioTotal) {
// val item =
// VideoMultiItemEntity(MULTI_ITEM_2, videos[0], VideoModel(videos[0].vedioUrl))
// data.add(item)
// }
}
return data
}
......
......@@ -84,7 +84,6 @@ class TxVideoAdapter : BaseMultiItemQuickAdapter<VideoMultiItemEntity, BaseViewH
}
val adBtn = holder.getView<View>(R.id.unlock)
vedioBean?.let {
try {
......@@ -95,7 +94,7 @@ class TxVideoAdapter : BaseMultiItemQuickAdapter<VideoMultiItemEntity, BaseViewH
it.unlockIndex + it.adGiveVedioNum
)
AppConfig.detailDialogUnlockText = unlockText
}catch (e:Exception){
} catch (e: Exception) {
}
......@@ -105,14 +104,13 @@ class TxVideoAdapter : BaseMultiItemQuickAdapter<VideoMultiItemEntity, BaseViewH
vipBtn.visibility = View.GONE
adBtn.visibility = View.VISIBLE
holder.getView<TextView>(R.id.tv_title).text =
if (AppConfig.firstVipPrice == 0.0) "解锁后续剧集" else "${AppConfig.firstVipPrice}元解锁后续剧集"
if (AppConfig.firstVipPrice == 0.0) "解锁后续剧集" else "${AppConfig.firstVipPrice.toInt()}元解锁后续剧集"
} else { // 开通会员解锁
adBtn.visibility = View.GONE
vipBtn.visibility = View.VISIBLE
holder.getView<TextView>(R.id.tv_title).text =
if (AppConfig.firstVipPrice == 0.0) "解锁后续剧集" else "${AppConfig.firstVipPrice}元解锁后续剧集"
if (AppConfig.firstVipPrice == 0.0) "解锁后续剧集" else "${AppConfig.firstVipPrice.toInt()}元解锁后续剧集"
}
} else {
......@@ -120,7 +118,7 @@ class TxVideoAdapter : BaseMultiItemQuickAdapter<VideoMultiItemEntity, BaseViewH
adBtn.visibility = View.GONE
vipBtn.visibility = View.VISIBLE
holder.getView<TextView>(R.id.tv_title).text =
if (AppConfig.firstVipPrice == 0.0) "解锁后续剧集" else "${AppConfig.firstVipPrice}元解锁后续剧集"
if (AppConfig.firstVipPrice == 0.0) "解锁后续剧集" else "${AppConfig.firstVipPrice.toInt()}元解锁后续剧集"
}
holder.getView<TextView>(R.id.unlock).text = String.format("查看激励视频")
......
......@@ -54,7 +54,7 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
private var orderTagsList: ArrayList<String>? = null
private var playIndex = 1
private var vedioAdPosition=0
private var vedioAdPosition = 0
override fun getContentViewLayoutID() = R.layout.activity_new_tx_video
......@@ -247,7 +247,11 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
override fun getVipProductSuc(data: VipBean) {
if (data.list != null && data.list.size > 0) {
AppConfig.firstVipPrice = data.list.get(0).price
if (data.list[0].payToModel == 2) {
AppConfig.firstVipPrice = data.list[0].oldPrice
} else {
AppConfig.firstVipPrice = data.list[0].price
}
}
}
......@@ -288,7 +292,7 @@ class NewTxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
}
override fun onCustomChildClick(view: View, position: Int) {
vedioAdPosition=position
vedioAdPosition = position
when (view.id) {
R.id.ll_collect -> {
// 无收藏
......
......@@ -66,7 +66,7 @@ class NewTxVideoAdapter : BaseMultiItemQuickAdapter<VideoMultiItemEntity4, BaseV
it.unlockIndex + it.adGiveVedioNum
)
AppConfig.detailDialogUnlockText = unlockText
}catch (e:Exception){
} catch (e: Exception) {
}
when (type) {
......@@ -74,7 +74,7 @@ class NewTxVideoAdapter : BaseMultiItemQuickAdapter<VideoMultiItemEntity4, BaseV
vipBtn.visibility = View.GONE
adBtn.visibility = View.VISIBLE
holder.getView<TextView>(R.id.tv_title).text =
if (AppConfig.firstVipPrice == 0.0) "解锁后续剧集" else "${AppConfig.firstVipPrice}元解锁后续剧集"
if (AppConfig.firstVipPrice == 0.0) "解锁后续剧集" else "${AppConfig.firstVipPrice.toInt()}元解锁后续剧集"
}
VEDIO3DOS_PAY -> { // 开通会员解锁
......@@ -82,13 +82,13 @@ class NewTxVideoAdapter : BaseMultiItemQuickAdapter<VideoMultiItemEntity4, BaseV
vipBtn.visibility = View.VISIBLE
holder.getView<TextView>(R.id.tv_title).text =
if (AppConfig.firstVipPrice == 0.0) "解锁后续剧集" else "${AppConfig.firstVipPrice}元解锁后续剧集"
if (AppConfig.firstVipPrice == 0.0) "解锁后续剧集" else "${AppConfig.firstVipPrice.toInt()}元解锁后续剧集"
}
else -> {
adBtn.visibility = View.GONE
vipBtn.visibility = View.VISIBLE
holder.getView<TextView>(R.id.tv_title).text =
if (AppConfig.firstVipPrice == 0.0) "解锁后续剧集" else "${AppConfig.firstVipPrice}元解锁后续剧集"
if (AppConfig.firstVipPrice == 0.0) "解锁后续剧集" else "${AppConfig.firstVipPrice.toInt()}元解锁后续剧集"
}
}
......
......@@ -36,8 +36,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:lineSpacingExtra="-6dp"
android:layout_centerHorizontal="true"
android:layout_marginBottom="136dp"
android:layout_marginBottom="134dp"
android:textColor="@color/color_FFF0D4" />
<TextView
......
......@@ -3,11 +3,11 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="10dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="10dp"
android:layout_height="wrap_content"
android:orientation="vertical">
<FrameLayout
......@@ -20,19 +20,19 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_marginTop="-8dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical">
android:layout_gravity="center_vertical"
android:layout_marginTop="-8dp">
<TextView
android:id="@+id/tvVipItemTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="18dp"
android:textColor="#efbc6a"
android:textSize="20sp"
android:layout_centerVertical="true"
android:textStyle="bold"
tools:text="包年会员" />
......@@ -40,10 +40,11 @@
android:id="@+id/tvVipItemCurMoney"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="18dp"
android:gravity="center"
android:lineSpacingExtra="-6dp"
android:textColor="#efbc6a"
android:textSize="16sp"
tools:text="$78" />
......
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