Commit 4776f27b authored by jyx's avatar jyx

优化样式

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