完善优惠券逻辑
|
|
@ -20,8 +20,8 @@ android {
|
||||||
applicationId "com.cheng.BoLe"
|
applicationId "com.cheng.BoLe"
|
||||||
minSdk 26
|
minSdk 26
|
||||||
targetSdk 34
|
targetSdk 34
|
||||||
versionCode 273
|
versionCode 280
|
||||||
versionName "2.7.3"
|
versionName "2.8.0"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
vectorDrawables {
|
vectorDrawables {
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ import com.cheng.blzb.bean.LoginEntity
|
||||||
import com.cheng.blzb.bean.MerchantGoodsEntity
|
import com.cheng.blzb.bean.MerchantGoodsEntity
|
||||||
import com.cheng.blzb.bean.OrderEntity
|
import com.cheng.blzb.bean.OrderEntity
|
||||||
import com.cheng.blzb.bean.OrderPayEntity
|
import com.cheng.blzb.bean.OrderPayEntity
|
||||||
import com.cheng.blzb.bean.ZZDBInfoEntity
|
|
||||||
import com.cheng.blzb.bean.SeatItemEntity
|
import com.cheng.blzb.bean.SeatItemEntity
|
||||||
import com.cheng.blzb.bean.SendCodeEntity
|
import com.cheng.blzb.bean.SendCodeEntity
|
||||||
import com.cheng.blzb.bean.SourceEntity
|
import com.cheng.blzb.bean.SourceEntity
|
||||||
|
|
@ -27,6 +26,7 @@ import com.cheng.blzb.bean.UserConfigEntity
|
||||||
import com.cheng.blzb.bean.UserEntity
|
import com.cheng.blzb.bean.UserEntity
|
||||||
import com.cheng.blzb.bean.VipGoodsEntity
|
import com.cheng.blzb.bean.VipGoodsEntity
|
||||||
import com.cheng.blzb.bean.WxServiceEntity
|
import com.cheng.blzb.bean.WxServiceEntity
|
||||||
|
import com.cheng.blzb.bean.ZZDBInfoEntity
|
||||||
import com.cheng.blzb.net.model.HttpBaseResult
|
import com.cheng.blzb.net.model.HttpBaseResult
|
||||||
import com.cheng.blzb.net.model.HttpListResult
|
import com.cheng.blzb.net.model.HttpListResult
|
||||||
import com.ylqh.cube.bean.CouponActivityEntity
|
import com.ylqh.cube.bean.CouponActivityEntity
|
||||||
|
|
@ -183,6 +183,12 @@ interface ApiService {
|
||||||
@GET("/api/order")
|
@GET("/api/order")
|
||||||
suspend fun getOrderInfo(@Query("order_id") orderId: String): HttpBaseResult<OrderEntity>
|
suspend fun getOrderInfo(@Query("order_id") orderId: String): HttpBaseResult<OrderEntity>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付提示
|
||||||
|
*/
|
||||||
|
@GET("/api/pay/tips")
|
||||||
|
suspend fun getPayTips(): HttpBaseResult<List<String>>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新订单
|
* 更新订单
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,6 @@ class LauncherActivity : BaseActivity() {
|
||||||
|
|
||||||
private fun intentMain() {
|
private fun intentMain() {
|
||||||
if (UserConfigManager.isFirstUseApp()) {
|
if (UserConfigManager.isFirstUseApp()) {
|
||||||
UserConfigManager.saveFirstUseApp(false)
|
|
||||||
if (UserConfigManager.getGuideEnable()) {
|
if (UserConfigManager.getGuideEnable()) {
|
||||||
startActivity<GuideActivity>()
|
startActivity<GuideActivity>()
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -1,208 +0,0 @@
|
||||||
package com.cheng.blzb.ui.dialog
|
|
||||||
|
|
||||||
import android.animation.AnimatorSet
|
|
||||||
import android.animation.ObjectAnimator
|
|
||||||
import android.animation.PropertyValuesHolder
|
|
||||||
import android.animation.ValueAnimator
|
|
||||||
import android.annotation.SuppressLint
|
|
||||||
import android.app.Dialog
|
|
||||||
import android.graphics.Color
|
|
||||||
import android.graphics.drawable.ColorDrawable
|
|
||||||
import android.os.Bundle
|
|
||||||
import android.text.TextUtils
|
|
||||||
import android.view.LayoutInflater
|
|
||||||
import android.view.View
|
|
||||||
import android.view.ViewGroup
|
|
||||||
import androidx.core.animation.addListener
|
|
||||||
import androidx.fragment.app.DialogFragment
|
|
||||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
|
||||||
import com.chad.library.adapter.base.viewholder.BaseViewHolder
|
|
||||||
import com.cheng.blzb.R
|
|
||||||
import com.cheng.blzb.bean.VipGoodsEntity
|
|
||||||
import com.cheng.blzb.databinding.DialogGoodsCouponBinding
|
|
||||||
import com.cheng.blzb.manager.DialogEnum
|
|
||||||
import com.example.base.extensions.gone
|
|
||||||
import com.example.base.extensions.visible
|
|
||||||
import com.example.base.utils.DensityUtils
|
|
||||||
import com.example.base.utils.ScreenUtils
|
|
||||||
import com.google.gson.Gson
|
|
||||||
import com.google.gson.reflect.TypeToken
|
|
||||||
|
|
||||||
class GoodsCouponDialog : DialogFragment() {
|
|
||||||
private val mAdapter by lazy { ActivityCouponAdapter() }
|
|
||||||
|
|
||||||
private var mOnBackListener: ((DialogEnum) -> Unit)? = null //回调事件
|
|
||||||
|
|
||||||
lateinit var binding: DialogGoodsCouponBinding
|
|
||||||
|
|
||||||
override fun onStart() {
|
|
||||||
super.onStart()
|
|
||||||
val window = dialog?.window
|
|
||||||
val windowParams = window?.attributes
|
|
||||||
windowParams?.dimAmount = 0.7f
|
|
||||||
windowParams?.width = ScreenUtils.getWindowSize().x
|
|
||||||
windowParams?.height = ScreenUtils.getWindowSize().y
|
|
||||||
dialog?.window?.attributes = windowParams
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
|
||||||
dialog?.window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
|
|
||||||
dialog?.setCancelable(false)
|
|
||||||
return super.onCreateView(inflater, container, savedInstanceState)
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressLint("SetTextI18n")
|
|
||||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
|
||||||
val view = layoutInflater.inflate(R.layout.dialog_goods_coupon, null)
|
|
||||||
|
|
||||||
binding = DialogGoodsCouponBinding.bind(view)
|
|
||||||
|
|
||||||
val listStr = arguments?.getString("list")
|
|
||||||
if (!TextUtils.isEmpty(listStr)) {
|
|
||||||
val list = Gson().fromJson<List<VipGoodsEntity>>(listStr, object : TypeToken<List<VipGoodsEntity>>() {}.type)
|
|
||||||
mAdapter.setList(list)
|
|
||||||
}
|
|
||||||
|
|
||||||
startAnim1()
|
|
||||||
|
|
||||||
val dialog = Dialog(requireContext())
|
|
||||||
dialog.setContentView(view)
|
|
||||||
return dialog
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun startAnim1() {
|
|
||||||
val scaleXHolder = PropertyValuesHolder.ofFloat("scaleX", 0.85f, 1.15f, 0.9f, 1.1f, 0.95f, 1f)
|
|
||||||
val scaleYHolder = PropertyValuesHolder.ofFloat("scaleY", 0.85f, 1.15f, 0.9f, 1.1f, 0.95f, 1f)
|
|
||||||
|
|
||||||
val descScaleAnim = ObjectAnimator.ofPropertyValuesHolder(binding.ivEffect1Desc, scaleXHolder, scaleYHolder)
|
|
||||||
descScaleAnim.duration = 500
|
|
||||||
descScaleAnim.addListener(onStart = {
|
|
||||||
binding.ivEffect1Desc.visible()
|
|
||||||
})
|
|
||||||
|
|
||||||
val descTransAnim = ObjectAnimator.ofFloat(binding.ivEffect1Desc, "translationY", 0f, -DensityUtils.dp2px(200f).toFloat())
|
|
||||||
descTransAnim.duration = 1000
|
|
||||||
descTransAnim.addListener(onStart = {
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
val bgTransAnim = ObjectAnimator.ofFloat(binding.ivEffect1Bg, "translationX", ScreenUtils.getScreenWidth().toFloat(), 0f)
|
|
||||||
bgTransAnim.duration = 500
|
|
||||||
bgTransAnim.addListener(onStart = {
|
|
||||||
binding.ivEffect1Bg.visible()
|
|
||||||
})
|
|
||||||
|
|
||||||
val fgTransAnim = ObjectAnimator.ofFloat(binding.ivEffect1Fg, "translationX", -ScreenUtils.getScreenWidth().toFloat(), 0f)
|
|
||||||
fgTransAnim.duration = 500
|
|
||||||
fgTransAnim.addListener(onStart = {
|
|
||||||
binding.ivEffect1Fg.visible()
|
|
||||||
}, onEnd = {
|
|
||||||
descScaleAnim.start()
|
|
||||||
})
|
|
||||||
|
|
||||||
val starRotateAnim = ValueAnimator.ofFloat( 0f, 1f)
|
|
||||||
starRotateAnim.duration = 1500
|
|
||||||
starRotateAnim.addUpdateListener { animation: ValueAnimator ->
|
|
||||||
val value = animation.getAnimatedValue() as Float
|
|
||||||
val transX = DensityUtils.dp2px(50f) * value
|
|
||||||
val alpha = 0.5f + 0.5f * value
|
|
||||||
val rotate = 360f * value
|
|
||||||
|
|
||||||
binding.ivEffect1Light1.translationX = transX
|
|
||||||
binding.ivEffect1Light2.translationX = transX
|
|
||||||
binding.ivEffect1Light3.translationX = transX
|
|
||||||
binding.ivEffect1Light4.translationX = transX
|
|
||||||
|
|
||||||
binding.ivEffect1Star1.translationX = transX
|
|
||||||
binding.ivEffect1Star2.translationX = transX
|
|
||||||
binding.ivEffect1Star3.translationX = transX
|
|
||||||
binding.ivEffect1Star4.translationX = transX
|
|
||||||
|
|
||||||
binding.ivEffect1Light1.alpha = alpha
|
|
||||||
binding.ivEffect1Light2.alpha = alpha
|
|
||||||
binding.ivEffect1Light3.alpha = alpha
|
|
||||||
binding.ivEffect1Light4.alpha = alpha
|
|
||||||
|
|
||||||
binding.ivEffect1Star1.alpha = alpha
|
|
||||||
binding.ivEffect1Star2.alpha = alpha
|
|
||||||
binding.ivEffect1Star3.alpha = alpha
|
|
||||||
binding.ivEffect1Star4.alpha = alpha
|
|
||||||
|
|
||||||
binding.ivEffect1Star1.rotation = rotate
|
|
||||||
binding.ivEffect1Star2.rotation = rotate
|
|
||||||
binding.ivEffect1Star3.rotation = rotate
|
|
||||||
binding.ivEffect1Star4.rotation = rotate
|
|
||||||
}
|
|
||||||
starRotateAnim.addListener(onEnd = {
|
|
||||||
binding.ivEffect1Bg.gone()
|
|
||||||
binding.ivEffect1Fg.gone()
|
|
||||||
binding.ivEffect1Light1.gone()
|
|
||||||
binding.ivEffect1Light2.gone()
|
|
||||||
binding.ivEffect1Light3.gone()
|
|
||||||
binding.ivEffect1Light4.gone()
|
|
||||||
binding.ivEffect1Star1.gone()
|
|
||||||
binding.ivEffect1Star2.gone()
|
|
||||||
binding.ivEffect1Star3.gone()
|
|
||||||
binding.ivEffect1Star4.gone()
|
|
||||||
|
|
||||||
descTransAnim.start()
|
|
||||||
})
|
|
||||||
|
|
||||||
val starTransAnim = ValueAnimator.ofFloat(ScreenUtils.getScreenWidth().toFloat(), 0f)
|
|
||||||
starTransAnim.duration = 500
|
|
||||||
starTransAnim.addUpdateListener { animation: ValueAnimator ->
|
|
||||||
val value = animation.getAnimatedValue() as Float
|
|
||||||
binding.ivEffect1Light1.translationX = value
|
|
||||||
binding.ivEffect1Light2.translationX = value
|
|
||||||
binding.ivEffect1Light3.translationX = value
|
|
||||||
binding.ivEffect1Light4.translationX = value
|
|
||||||
|
|
||||||
binding.ivEffect1Star1.translationX = value
|
|
||||||
binding.ivEffect1Star2.translationX = value
|
|
||||||
binding.ivEffect1Star3.translationX = value
|
|
||||||
binding.ivEffect1Star4.translationX = value
|
|
||||||
}
|
|
||||||
starTransAnim.addListener(onStart = {
|
|
||||||
binding.ivEffect1Light1.setVisibility(View.VISIBLE)
|
|
||||||
binding.ivEffect1Light2.setVisibility(View.VISIBLE)
|
|
||||||
binding.ivEffect1Light3.setVisibility(View.VISIBLE)
|
|
||||||
binding.ivEffect1Light4.setVisibility(View.VISIBLE)
|
|
||||||
|
|
||||||
binding.ivEffect1Star1.setVisibility(View.VISIBLE)
|
|
||||||
binding.ivEffect1Star2.setVisibility(View.VISIBLE)
|
|
||||||
binding.ivEffect1Star3.setVisibility(View.VISIBLE)
|
|
||||||
binding.ivEffect1Star4.setVisibility(View.VISIBLE)
|
|
||||||
}, onEnd = {
|
|
||||||
starRotateAnim.start()
|
|
||||||
})
|
|
||||||
|
|
||||||
val animSet = AnimatorSet()
|
|
||||||
animSet.playTogether(
|
|
||||||
bgTransAnim,
|
|
||||||
fgTransAnim,
|
|
||||||
starTransAnim
|
|
||||||
)
|
|
||||||
animSet.start()
|
|
||||||
}
|
|
||||||
|
|
||||||
fun setOnBackListener(listener: ((DialogEnum) -> Unit)) {
|
|
||||||
mOnBackListener = listener
|
|
||||||
}
|
|
||||||
|
|
||||||
companion object {
|
|
||||||
fun newInstance(list: List<VipGoodsEntity>): GoodsCouponDialog {
|
|
||||||
val arg = Bundle()
|
|
||||||
arg.putSerializable("list", Gson().toJson(list))
|
|
||||||
val fragment = GoodsCouponDialog()
|
|
||||||
fragment.arguments = arg
|
|
||||||
return fragment
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class ActivityCouponAdapter : BaseQuickAdapter<VipGoodsEntity, BaseViewHolder>(R.layout.listitem_goods_coupon) {
|
|
||||||
|
|
||||||
override fun convert(holder: BaseViewHolder, item: VipGoodsEntity) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,545 @@
|
||||||
|
package com.cheng.blzb.ui.dialog
|
||||||
|
|
||||||
|
import android.animation.AnimatorSet
|
||||||
|
import android.animation.ObjectAnimator
|
||||||
|
import android.animation.PropertyValuesHolder
|
||||||
|
import android.animation.ValueAnimator
|
||||||
|
import android.annotation.SuppressLint
|
||||||
|
import android.app.Dialog
|
||||||
|
import android.content.Context
|
||||||
|
import android.graphics.Color
|
||||||
|
import android.graphics.drawable.ColorDrawable
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.text.TextUtils
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewGroup
|
||||||
|
import android.view.animation.LinearInterpolator
|
||||||
|
import android.widget.BaseAdapter
|
||||||
|
import android.widget.ImageView
|
||||||
|
import android.widget.TextView
|
||||||
|
import androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
import androidx.core.animation.addListener
|
||||||
|
import androidx.core.view.marginStart
|
||||||
|
import androidx.fragment.app.DialogFragment
|
||||||
|
import androidx.lifecycle.lifecycleScope
|
||||||
|
import coil.load
|
||||||
|
import coil.transform.CircleCropTransformation
|
||||||
|
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||||
|
import com.chad.library.adapter.base.viewholder.BaseViewHolder
|
||||||
|
import com.cheng.blzb.R
|
||||||
|
import com.cheng.blzb.bean.VipGoodsEntity
|
||||||
|
import com.cheng.blzb.common.Constants
|
||||||
|
import com.cheng.blzb.databinding.DialogGoodsPromotionBinding
|
||||||
|
import com.cheng.blzb.manager.DialogEnum
|
||||||
|
import com.cheng.blzb.net.ApiFactory
|
||||||
|
import com.example.base.extensions.gone
|
||||||
|
import com.example.base.extensions.onClick
|
||||||
|
import com.example.base.extensions.visible
|
||||||
|
import com.example.base.utils.DensityUtils
|
||||||
|
import com.example.base.utils.L
|
||||||
|
import com.example.base.utils.ScreenUtils
|
||||||
|
import com.example.base.utils.SpanUtils
|
||||||
|
import com.google.gson.Gson
|
||||||
|
import com.google.gson.reflect.TypeToken
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
|
import org.jetbrains.anko.find
|
||||||
|
import java.text.DecimalFormat
|
||||||
|
import kotlin.math.pow
|
||||||
|
|
||||||
|
class GoodsPromotionDialog : DialogFragment() {
|
||||||
|
private val goodsAdapter by lazy { GoodsAdapter() }
|
||||||
|
|
||||||
|
private val tipsAdapter by lazy { PayTipsAdapter(requireContext()) }
|
||||||
|
|
||||||
|
private var mOnBackListener: ((DialogEnum) -> Unit)? = null //回调事件
|
||||||
|
|
||||||
|
lateinit var binding: DialogGoodsPromotionBinding
|
||||||
|
|
||||||
|
override fun onStart() {
|
||||||
|
super.onStart()
|
||||||
|
val window = dialog?.window
|
||||||
|
val windowParams = window?.attributes
|
||||||
|
windowParams?.dimAmount = 0.7f
|
||||||
|
windowParams?.width = ScreenUtils.getWindowSize().x
|
||||||
|
windowParams?.height = ScreenUtils.getWindowSize().y
|
||||||
|
dialog?.window?.attributes = windowParams
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||||
|
dialog?.window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
|
||||||
|
dialog?.setCancelable(false)
|
||||||
|
return super.onCreateView(inflater, container, savedInstanceState)
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("SetTextI18n")
|
||||||
|
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||||
|
val view = layoutInflater.inflate(R.layout.dialog_goods_promotion, null)
|
||||||
|
|
||||||
|
binding = DialogGoodsPromotionBinding.bind(view)
|
||||||
|
|
||||||
|
binding.rvGoods.adapter = goodsAdapter
|
||||||
|
binding.viewFlipper.adapter = tipsAdapter
|
||||||
|
|
||||||
|
val listStr = arguments?.getString("list")
|
||||||
|
if (!TextUtils.isEmpty(listStr)) {
|
||||||
|
val list = Gson().fromJson<List<VipGoodsEntity>>(listStr, object : TypeToken<List<VipGoodsEntity>>() {}.type)
|
||||||
|
for (i in 0 until list.size.coerceAtMost(3)) {
|
||||||
|
goodsAdapter.addData(list[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.ivClose.onClick {
|
||||||
|
dismiss()
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.layoutNext.onClick {
|
||||||
|
mOnBackListener?.invoke(DialogEnum.CLICK_OK)
|
||||||
|
dismiss()
|
||||||
|
}
|
||||||
|
|
||||||
|
getPayTips()
|
||||||
|
startAnim1()
|
||||||
|
|
||||||
|
val dialog = Dialog(requireContext())
|
||||||
|
dialog.setContentView(view)
|
||||||
|
return dialog
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getPayTips() {
|
||||||
|
lifecycleScope.launch {
|
||||||
|
try {
|
||||||
|
val response = ApiFactory.apiService.getPayTips()
|
||||||
|
if (response.status) {
|
||||||
|
tipsAdapter.setList(response.data)
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
L.d(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun startAnim1() {
|
||||||
|
val scaleXHolder = PropertyValuesHolder.ofFloat("scaleX", 0.85f, 1.15f, 0.9f, 1.1f, 0.95f, 1f)
|
||||||
|
val scaleYHolder = PropertyValuesHolder.ofFloat("scaleY", 0.85f, 1.15f, 0.9f, 1.1f, 0.95f, 1f)
|
||||||
|
|
||||||
|
val descScaleAnim = ObjectAnimator.ofPropertyValuesHolder(binding.ivEffect1Desc, scaleXHolder, scaleYHolder)
|
||||||
|
descScaleAnim.duration = 500
|
||||||
|
descScaleAnim.addListener(onStart = {
|
||||||
|
binding.ivEffect1Desc.visible()
|
||||||
|
})
|
||||||
|
|
||||||
|
val bgTransAnim = ObjectAnimator.ofFloat(binding.ivEffect1Bg, "translationX", ScreenUtils.getScreenWidth().toFloat(), 0f)
|
||||||
|
bgTransAnim.duration = 500
|
||||||
|
bgTransAnim.addListener(onStart = {
|
||||||
|
binding.ivEffect1Bg.visible()
|
||||||
|
})
|
||||||
|
|
||||||
|
val fgTransAnim = ObjectAnimator.ofFloat(binding.ivEffect1Fg, "translationX", -ScreenUtils.getScreenWidth().toFloat(), 0f)
|
||||||
|
fgTransAnim.duration = 500
|
||||||
|
fgTransAnim.addListener(onStart = {
|
||||||
|
binding.ivEffect1Fg.visible()
|
||||||
|
}, onEnd = {
|
||||||
|
descScaleAnim.start()
|
||||||
|
})
|
||||||
|
|
||||||
|
val starRotateAnim = ValueAnimator.ofFloat( 0f, 1f)
|
||||||
|
starRotateAnim.duration = 1500
|
||||||
|
starRotateAnim.addUpdateListener { animation: ValueAnimator ->
|
||||||
|
val value = animation.getAnimatedValue() as Float
|
||||||
|
val transX = DensityUtils.dp2px(50f) * value
|
||||||
|
val alpha = 0.5f + 0.5f * value
|
||||||
|
val rotate = 360f * value
|
||||||
|
|
||||||
|
binding.ivEffect1Light1.translationX = transX
|
||||||
|
binding.ivEffect1Light2.translationX = transX
|
||||||
|
binding.ivEffect1Light3.translationX = transX
|
||||||
|
binding.ivEffect1Light4.translationX = transX
|
||||||
|
|
||||||
|
binding.ivEffect1Star1.translationX = transX
|
||||||
|
binding.ivEffect1Star2.translationX = transX
|
||||||
|
binding.ivEffect1Star3.translationX = transX
|
||||||
|
binding.ivEffect1Star4.translationX = transX
|
||||||
|
|
||||||
|
binding.ivEffect1Light1.alpha = alpha
|
||||||
|
binding.ivEffect1Light2.alpha = alpha
|
||||||
|
binding.ivEffect1Light3.alpha = alpha
|
||||||
|
binding.ivEffect1Light4.alpha = alpha
|
||||||
|
|
||||||
|
binding.ivEffect1Star1.alpha = alpha
|
||||||
|
binding.ivEffect1Star2.alpha = alpha
|
||||||
|
binding.ivEffect1Star3.alpha = alpha
|
||||||
|
binding.ivEffect1Star4.alpha = alpha
|
||||||
|
|
||||||
|
binding.ivEffect1Star1.rotation = rotate
|
||||||
|
binding.ivEffect1Star2.rotation = rotate
|
||||||
|
binding.ivEffect1Star3.rotation = rotate
|
||||||
|
binding.ivEffect1Star4.rotation = rotate
|
||||||
|
}
|
||||||
|
starRotateAnim.addListener(onEnd = {
|
||||||
|
binding.ivEffect1Bg.gone()
|
||||||
|
binding.ivEffect1Fg.gone()
|
||||||
|
binding.ivEffect1Light1.gone()
|
||||||
|
binding.ivEffect1Light2.gone()
|
||||||
|
binding.ivEffect1Light3.gone()
|
||||||
|
binding.ivEffect1Light4.gone()
|
||||||
|
binding.ivEffect1Star1.gone()
|
||||||
|
binding.ivEffect1Star2.gone()
|
||||||
|
binding.ivEffect1Star3.gone()
|
||||||
|
binding.ivEffect1Star4.gone()
|
||||||
|
|
||||||
|
startAnim2()
|
||||||
|
})
|
||||||
|
|
||||||
|
val starTransAnim = ValueAnimator.ofFloat(ScreenUtils.getScreenWidth().toFloat(), 0f)
|
||||||
|
starTransAnim.duration = 500
|
||||||
|
starTransAnim.addUpdateListener { animation: ValueAnimator ->
|
||||||
|
val value = animation.getAnimatedValue() as Float
|
||||||
|
binding.ivEffect1Light1.translationX = value
|
||||||
|
binding.ivEffect1Light2.translationX = value
|
||||||
|
binding.ivEffect1Light3.translationX = value
|
||||||
|
binding.ivEffect1Light4.translationX = value
|
||||||
|
|
||||||
|
binding.ivEffect1Star1.translationX = value
|
||||||
|
binding.ivEffect1Star2.translationX = value
|
||||||
|
binding.ivEffect1Star3.translationX = value
|
||||||
|
binding.ivEffect1Star4.translationX = value
|
||||||
|
}
|
||||||
|
starTransAnim.addListener(onStart = {
|
||||||
|
binding.ivEffect1Light1.setVisibility(View.VISIBLE)
|
||||||
|
binding.ivEffect1Light2.setVisibility(View.VISIBLE)
|
||||||
|
binding.ivEffect1Light3.setVisibility(View.VISIBLE)
|
||||||
|
binding.ivEffect1Light4.setVisibility(View.VISIBLE)
|
||||||
|
|
||||||
|
binding.ivEffect1Star1.setVisibility(View.VISIBLE)
|
||||||
|
binding.ivEffect1Star2.setVisibility(View.VISIBLE)
|
||||||
|
binding.ivEffect1Star3.setVisibility(View.VISIBLE)
|
||||||
|
binding.ivEffect1Star4.setVisibility(View.VISIBLE)
|
||||||
|
}, onEnd = {
|
||||||
|
starRotateAnim.start()
|
||||||
|
})
|
||||||
|
|
||||||
|
val animSet = AnimatorSet()
|
||||||
|
animSet.playTogether(
|
||||||
|
bgTransAnim,
|
||||||
|
fgTransAnim,
|
||||||
|
starTransAnim
|
||||||
|
)
|
||||||
|
animSet.start()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun startAnim2() {
|
||||||
|
val scaleXHolder1 = PropertyValuesHolder.ofFloat("scaleX", 0f, 1f)
|
||||||
|
val scaleYHolder1 = PropertyValuesHolder.ofFloat("scaleY", 0f, 1f)
|
||||||
|
|
||||||
|
val scaleXHolder2 = PropertyValuesHolder.ofFloat("scaleX", 1f, 1.1f)
|
||||||
|
val scaleYHolder2 = PropertyValuesHolder.ofFloat("scaleY", 1f, 1.1f)
|
||||||
|
|
||||||
|
val descTransAnim = ObjectAnimator.ofFloat(binding.ivEffect1Desc, "translationY", 0f, -DensityUtils.dp2px(200f).toFloat()).setDuration(1000)
|
||||||
|
|
||||||
|
val coverTransAnim = ObjectAnimator.ofFloat(binding.ivGoodsCover, "translationY", 0f, -ScreenUtils.getScreenHeight().toFloat())
|
||||||
|
coverTransAnim.duration = 1000
|
||||||
|
coverTransAnim.addListener(onEnd = {
|
||||||
|
binding.ivGoodsCover.gone()
|
||||||
|
})
|
||||||
|
|
||||||
|
val baseAlphaAnim = ObjectAnimator.ofFloat(binding.ivGoodsBase, "alpha", 1f, 0f)
|
||||||
|
baseAlphaAnim.duration = 1000
|
||||||
|
baseAlphaAnim.addListener(onEnd = {
|
||||||
|
binding.ivGoodsBase.gone()
|
||||||
|
})
|
||||||
|
|
||||||
|
val userCountTransAnim1 = ObjectAnimator.ofFloat(binding.tvAdd1, "translationY", 0f, -DensityUtils.dp2px(5f).toFloat())
|
||||||
|
userCountTransAnim1.duration = 1000
|
||||||
|
userCountTransAnim1.repeatCount = -1
|
||||||
|
userCountTransAnim1.startDelay = 3000
|
||||||
|
|
||||||
|
val userCountTransAnim2 = ObjectAnimator.ofFloat(binding.tvAdd2, "translationY", 0f, -DensityUtils.dp2px(5f).toFloat())
|
||||||
|
userCountTransAnim2.duration = 1000
|
||||||
|
userCountTransAnim2.repeatCount = -1
|
||||||
|
userCountTransAnim2.startDelay = 3500
|
||||||
|
|
||||||
|
val userCountAlphaAnim1 = ObjectAnimator.ofFloat(binding.tvAdd1, "alpha", 0f, 1f, 0f)
|
||||||
|
userCountAlphaAnim1.duration = 1000
|
||||||
|
userCountAlphaAnim1.repeatCount = -1
|
||||||
|
userCountAlphaAnim1.startDelay = 3000
|
||||||
|
userCountAlphaAnim1.addListener(onStart = {
|
||||||
|
binding.tvAdd1.visible()
|
||||||
|
})
|
||||||
|
|
||||||
|
val userCountAlphaAnim2 = ObjectAnimator.ofFloat(binding.tvAdd2, "alpha", 0f, 1f, 0f)
|
||||||
|
userCountAlphaAnim2.duration = 1000
|
||||||
|
userCountAlphaAnim2.repeatCount = -1
|
||||||
|
userCountAlphaAnim2.startDelay = 3500
|
||||||
|
userCountAlphaAnim2.addListener(onStart = {
|
||||||
|
binding.tvAdd2.visible()
|
||||||
|
})
|
||||||
|
|
||||||
|
val lightScaleAnim = ObjectAnimator.ofPropertyValuesHolder(binding.ivGoodsLight, scaleXHolder1, scaleYHolder1)
|
||||||
|
lightScaleAnim.duration = 2000
|
||||||
|
lightScaleAnim.startDelay = 3000
|
||||||
|
lightScaleAnim.addListener(onStart = {
|
||||||
|
binding.ivGoodsLight.visible()
|
||||||
|
})
|
||||||
|
|
||||||
|
val lightRotateAnim = ObjectAnimator.ofFloat(binding.ivGoodsLight, "rotation", 0f, 360f)
|
||||||
|
lightRotateAnim.duration = 6000
|
||||||
|
lightRotateAnim.repeatCount = -1
|
||||||
|
lightRotateAnim.interpolator = LinearInterpolator()
|
||||||
|
lightScaleAnim.startDelay = 2800
|
||||||
|
|
||||||
|
val goodsScaleAnim = ObjectAnimator.ofPropertyValuesHolder(binding.layoutGoods, scaleXHolder1, scaleYHolder1)
|
||||||
|
goodsScaleAnim.duration = 1000
|
||||||
|
goodsScaleAnim.startDelay = 600
|
||||||
|
goodsScaleAnim.addListener(onStart = {
|
||||||
|
binding.rvGoods.visible()
|
||||||
|
binding.ivGoodsCover.visible()
|
||||||
|
binding.ivGoodsBase.visible()
|
||||||
|
}, onEnd = {
|
||||||
|
coverTransAnim.start()
|
||||||
|
baseAlphaAnim.start()
|
||||||
|
})
|
||||||
|
|
||||||
|
val btnScaleAnim = ObjectAnimator.ofPropertyValuesHolder(binding.layoutNext, scaleXHolder2, scaleYHolder2)
|
||||||
|
btnScaleAnim.duration = 600
|
||||||
|
btnScaleAnim.repeatCount = -1
|
||||||
|
btnScaleAnim.repeatMode = ValueAnimator.REVERSE
|
||||||
|
|
||||||
|
val btnAlphaAnim = ObjectAnimator.ofFloat(binding.layoutNext, "alpha", 0f, 1f)
|
||||||
|
btnAlphaAnim.duration = 1000
|
||||||
|
btnAlphaAnim.startDelay = 3000
|
||||||
|
btnAlphaAnim.addListener(onStart = {
|
||||||
|
binding.layoutNext.visible()
|
||||||
|
binding.viewFlipper.visible()
|
||||||
|
}, onEnd = {
|
||||||
|
btnScaleAnim.start()
|
||||||
|
})
|
||||||
|
|
||||||
|
val closeAlphaAnim = ObjectAnimator.ofFloat(binding.ivClose, "alpha", 0f, 1f)
|
||||||
|
closeAlphaAnim.duration = 1000
|
||||||
|
closeAlphaAnim.startDelay = 4000
|
||||||
|
closeAlphaAnim.addListener(onStart = {
|
||||||
|
binding.ivClose.visible()
|
||||||
|
})
|
||||||
|
|
||||||
|
val animSet = AnimatorSet()
|
||||||
|
animSet.playTogether(
|
||||||
|
descTransAnim,
|
||||||
|
goodsScaleAnim,
|
||||||
|
lightScaleAnim,
|
||||||
|
lightRotateAnim,
|
||||||
|
userCountTransAnim1,
|
||||||
|
userCountAlphaAnim1,
|
||||||
|
userCountTransAnim2,
|
||||||
|
userCountAlphaAnim2,
|
||||||
|
btnAlphaAnim,
|
||||||
|
closeAlphaAnim
|
||||||
|
)
|
||||||
|
animSet.start()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setOnBackListener(listener: ((DialogEnum) -> Unit)) {
|
||||||
|
mOnBackListener = listener
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
fun newInstance(list: List<VipGoodsEntity>): GoodsPromotionDialog {
|
||||||
|
val arg = Bundle()
|
||||||
|
arg.putSerializable("list", Gson().toJson(list))
|
||||||
|
val fragment = GoodsPromotionDialog()
|
||||||
|
fragment.arguments = arg
|
||||||
|
return fragment
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class GoodsAdapter : BaseQuickAdapter<VipGoodsEntity, BaseViewHolder>(R.layout.listitem_promotion_goods) {
|
||||||
|
|
||||||
|
@SuppressLint("SetTextI18n")
|
||||||
|
override fun convert(holder: BaseViewHolder, item: VipGoodsEntity) {
|
||||||
|
val tvName = holder.getView<TextView>(R.id.tv_name)
|
||||||
|
val tvPrice = holder.getView<TextView>(R.id.tv_price)
|
||||||
|
val tvSavedPrice = holder.getView<TextView>(R.id.tv_saved_price)
|
||||||
|
val tvOriginPrice = holder.getView<TextView>(R.id.tv_origin_price)
|
||||||
|
tvName.typeface = Constants.douyinsansB
|
||||||
|
tvPrice.typeface = Constants.dDIN_PRO_M
|
||||||
|
|
||||||
|
tvName.text = item.goods_name
|
||||||
|
SpanUtils.with(tvPrice)
|
||||||
|
.append("¥")
|
||||||
|
.setFontSize(16, true)
|
||||||
|
.append(DecimalFormat("0.##").format(item.origin_price.toFloat()))
|
||||||
|
.create()
|
||||||
|
tvSavedPrice.text = "立减${DecimalFormat("0.##").format(item.origin_price.toFloat() - item.price.toFloat())}"
|
||||||
|
SpanUtils.with(tvOriginPrice)
|
||||||
|
.append("¥${DecimalFormat("0.##").format(item.origin_price.toFloat())}")
|
||||||
|
.setStrikethrough()
|
||||||
|
.create()
|
||||||
|
holder.setText(R.id.tv_tag, item.tips)
|
||||||
|
|
||||||
|
if (data.size == 3) {
|
||||||
|
val contentView = holder.getView<ConstraintLayout>(R.id.layout_content)
|
||||||
|
if (holder.layoutPosition == 1) {
|
||||||
|
val lp = contentView.layoutParams as ConstraintLayout.LayoutParams
|
||||||
|
lp.width = DensityUtils.dp2px(110f * 0.9f)
|
||||||
|
lp.height = DensityUtils.dp2px(140f * 0.9f)
|
||||||
|
contentView.layoutParams = lp
|
||||||
|
|
||||||
|
tvName.textSize = 16f
|
||||||
|
} else {
|
||||||
|
val lp = contentView.layoutParams as ConstraintLayout.LayoutParams
|
||||||
|
lp.width = DensityUtils.dp2px(90f)
|
||||||
|
lp.height = DensityUtils.dp2px(115f)
|
||||||
|
contentView.layoutParams = lp
|
||||||
|
|
||||||
|
tvName.textSize = 12f
|
||||||
|
}
|
||||||
|
|
||||||
|
holder.itemView.elevation = if (holder.layoutPosition == 1) 2f else 1f
|
||||||
|
holder.itemView.postDelayed({
|
||||||
|
startTransAnim(holder.itemView, holder.layoutPosition, data.size, item)
|
||||||
|
}, 100)
|
||||||
|
} else {
|
||||||
|
holder.itemView.visible()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("Recycle")
|
||||||
|
private fun startTransAnim(view: View, position: Int, total: Int, item: VipGoodsEntity) {
|
||||||
|
val contentView = view.find<ConstraintLayout>(R.id.layout_content)
|
||||||
|
val tvName = view.find<TextView>(R.id.tv_name)
|
||||||
|
val tvPrice = view.find<TextView>(R.id.tv_price)
|
||||||
|
val tvSavedPrice = view.find<TextView>(R.id.tv_saved_price)
|
||||||
|
val tvOriginPrice = view.find<TextView>(R.id.tv_origin_price)
|
||||||
|
val tvTag = view.find<TextView>(R.id.tv_tag)
|
||||||
|
|
||||||
|
|
||||||
|
val originStart = view.measuredWidth * (total - 1) / 2 + view.marginStart * (total - 1)
|
||||||
|
val start = if (total == 2) ((originStart * (-1.0).pow(position))).toInt() else -originStart * (position - 1)
|
||||||
|
|
||||||
|
view.translationX = start.toFloat()
|
||||||
|
tvName.translationY = DensityUtils.dp2px(15f).toFloat()
|
||||||
|
tvPrice.translationY = DensityUtils.dp2px(15f).toFloat()
|
||||||
|
|
||||||
|
val animator1 = if (position == 1) {
|
||||||
|
val lp = contentView.layoutParams as ConstraintLayout.LayoutParams
|
||||||
|
|
||||||
|
val valueAnim = ValueAnimator.ofFloat(0.9f, 1f).setDuration(1000)
|
||||||
|
valueAnim.addUpdateListener { animator ->
|
||||||
|
val value = animator.animatedValue as Float
|
||||||
|
lp.width = DensityUtils.dp2px(110f * value)
|
||||||
|
lp.height = DensityUtils.dp2px(140f * value)
|
||||||
|
contentView.layoutParams = lp
|
||||||
|
}
|
||||||
|
valueAnim
|
||||||
|
} else {
|
||||||
|
ObjectAnimator.ofFloat(view, "translationX", start.toFloat(), 0f).setDuration(1000)
|
||||||
|
}
|
||||||
|
animator1.startDelay = 3500
|
||||||
|
|
||||||
|
val animator2 = ValueAnimator.ofFloat(0f, 1f).setDuration(1000)
|
||||||
|
animator2.addUpdateListener { animator ->
|
||||||
|
val value = animator.animatedValue as Float
|
||||||
|
val savedPrice = item.origin_price.toFloat() - item.price.toFloat()
|
||||||
|
val price = if (value == 1f) {
|
||||||
|
DecimalFormat("0.##").format(item.origin_price.toFloat() - savedPrice * value)
|
||||||
|
} else {
|
||||||
|
"${(item.origin_price.toFloat() - savedPrice * value).toInt()}"
|
||||||
|
}
|
||||||
|
SpanUtils.with(tvPrice)
|
||||||
|
.append("¥")
|
||||||
|
.setFontSize(16, true)
|
||||||
|
.append(price)
|
||||||
|
.create()
|
||||||
|
}
|
||||||
|
animator2.startDelay = 800
|
||||||
|
|
||||||
|
val animator3 = ObjectAnimator.ofFloat(tvTag, "alpha", 0f, 1f).setDuration(1000)
|
||||||
|
animator3.repeatCount = -1
|
||||||
|
animator3.repeatMode = ValueAnimator.REVERSE
|
||||||
|
|
||||||
|
val alphaAnim1 = ObjectAnimator.ofFloat(tvOriginPrice, "alpha", 0f, 1f)
|
||||||
|
alphaAnim1.duration = 1500
|
||||||
|
alphaAnim1.addListener(onStart = {
|
||||||
|
tvOriginPrice.visible()
|
||||||
|
animator2.start()
|
||||||
|
})
|
||||||
|
|
||||||
|
val alphaAnim2 = ObjectAnimator.ofFloat(tvSavedPrice, "alpha", 0f, 1f)
|
||||||
|
alphaAnim2.duration = 1500
|
||||||
|
alphaAnim2.addListener(onStart = {
|
||||||
|
tvSavedPrice.visible()
|
||||||
|
})
|
||||||
|
|
||||||
|
val transAnim1 = ObjectAnimator.ofFloat(tvName, "translationY", DensityUtils.dp2px(15f).toFloat(), 0f)
|
||||||
|
transAnim1.duration = 300
|
||||||
|
|
||||||
|
val transAnim2 = ObjectAnimator.ofFloat(tvPrice, "translationY", DensityUtils.dp2px(15f).toFloat(), 0f)
|
||||||
|
transAnim2.duration = 300
|
||||||
|
|
||||||
|
animator1.addListener(onEnd = {
|
||||||
|
transAnim1.start()
|
||||||
|
transAnim2.start()
|
||||||
|
alphaAnim1.start()
|
||||||
|
})
|
||||||
|
|
||||||
|
animator2.addListener(onStart = {
|
||||||
|
alphaAnim2.start()
|
||||||
|
}, onEnd = {
|
||||||
|
if (!TextUtils.isEmpty(item.tips)) {
|
||||||
|
animator3.start()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
animator3.addListener(onStart = {
|
||||||
|
tvTag.visible()
|
||||||
|
})
|
||||||
|
|
||||||
|
animator1.start()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class PayTipsAdapter(val context: Context): BaseAdapter() {
|
||||||
|
val data: MutableList<String> = mutableListOf()
|
||||||
|
|
||||||
|
override fun getCount(): Int {
|
||||||
|
return data.size
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getItem(position: Int): String {
|
||||||
|
return data[position]
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getItemId(position: Int): Long {
|
||||||
|
return position.toLong()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getView(position: Int, convertView: View?, parent: ViewGroup?): View {
|
||||||
|
val view: View
|
||||||
|
val viewHolder: ViewHolder
|
||||||
|
if (convertView == null) {
|
||||||
|
view = View.inflate(context, R.layout.listitem_goods_promotion_tips, null)
|
||||||
|
viewHolder = ViewHolder(view)
|
||||||
|
view.tag = viewHolder
|
||||||
|
} else {
|
||||||
|
view = convertView
|
||||||
|
viewHolder = convertView.tag as ViewHolder
|
||||||
|
}
|
||||||
|
viewHolder.ivAvatar.load(context.resources.getIdentifier("yq_${position % 51}", "mipmap", context.packageName)) {
|
||||||
|
transformations(CircleCropTransformation())
|
||||||
|
}
|
||||||
|
viewHolder.tvContent.text = getItem(position)
|
||||||
|
return view
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setList(list: List<String>) {
|
||||||
|
data.clear()
|
||||||
|
data.addAll(list)
|
||||||
|
notifyDataSetChanged()
|
||||||
|
}
|
||||||
|
|
||||||
|
inner class ViewHolder(val view: View) {
|
||||||
|
val ivAvatar: ImageView = view.findViewById(R.id.iv_avatar)
|
||||||
|
val tvContent: TextView = view.findViewById(R.id.tv_content)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -18,6 +18,7 @@ import com.example.base.extensions.onClick
|
||||||
import com.example.base.utils.DensityUtils
|
import com.example.base.utils.DensityUtils
|
||||||
import com.example.base.utils.SpanUtils
|
import com.example.base.utils.SpanUtils
|
||||||
import kotlin.math.ceil
|
import kotlin.math.ceil
|
||||||
|
import kotlin.random.Random
|
||||||
|
|
||||||
class GuideItem3Adapter(val context: Context): RecyclerView.Adapter<BaseViewHolder>() {
|
class GuideItem3Adapter(val context: Context): RecyclerView.Adapter<BaseViewHolder>() {
|
||||||
val data: MutableList<HotWordEntity.Child> = mutableListOf()
|
val data: MutableList<HotWordEntity.Child> = mutableListOf()
|
||||||
|
|
@ -54,24 +55,11 @@ class GuideItem3Adapter(val context: Context): RecyclerView.Adapter<BaseViewHold
|
||||||
val keywordItem = keywordAdapter.getItem(position)
|
val keywordItem = keywordAdapter.getItem(position)
|
||||||
mOnKeywordClickListener?.invoke(keywordItem)
|
mOnKeywordClickListener?.invoke(keywordItem)
|
||||||
}
|
}
|
||||||
val keywordList = mutableListOf<HotWordEntity.Child>()
|
keywordAdapter.setList(getKeywordList(item))
|
||||||
for (i in 0 until 15) {
|
|
||||||
keywordList.add(item.children[i])
|
|
||||||
}
|
|
||||||
keywordAdapter.setList(keywordList)
|
|
||||||
|
|
||||||
holder.getView<ImageView>(R.id.iv_refresh).onClick { view ->
|
holder.getView<ImageView>(R.id.iv_refresh).onClick { view ->
|
||||||
startRotate(view)
|
startRotate(view)
|
||||||
if (ceil(item.children.size / 15.0) > keywordAdapter.page + 1) {
|
keywordAdapter.setList(getKeywordList(item))
|
||||||
keywordAdapter.page++
|
|
||||||
} else {
|
|
||||||
keywordAdapter.page = 0
|
|
||||||
}
|
|
||||||
val keywordList = mutableListOf<HotWordEntity.Child>()
|
|
||||||
for (i in keywordAdapter.page * 15 until ((keywordAdapter.page + 1) * 15).coerceAtMost(item.children.size)) {
|
|
||||||
keywordList.add(item.children[i])
|
|
||||||
}
|
|
||||||
keywordAdapter.setList(keywordList)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -88,6 +76,17 @@ class GuideItem3Adapter(val context: Context): RecyclerView.Adapter<BaseViewHold
|
||||||
view.startAnimation(anim)
|
view.startAnimation(anim)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun getKeywordList(item: HotWordEntity.Child): List<HotWordEntity.Child> {
|
||||||
|
val list = mutableListOf<HotWordEntity.Child>()
|
||||||
|
while (list.size < 12) {
|
||||||
|
val keyword = item.children[Random.nextInt(item.children.size)]
|
||||||
|
if (!list.contains(keyword)) {
|
||||||
|
list.add(keyword)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressLint("NotifyDataSetChanged")
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
fun setList(list: List<HotWordEntity.Child>) {
|
fun setList(list: List<HotWordEntity.Child>) {
|
||||||
data.clear()
|
data.clear()
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,7 @@ class GuideItem1Fragment : BaseFragment<FragmentGuideItem1Binding, GuideViewMode
|
||||||
|
|
||||||
binding.layoutNext.onClick {
|
binding.layoutNext.onClick {
|
||||||
if (canClick) {
|
if (canClick) {
|
||||||
|
UserConfigManager.saveFirstUseApp(false)
|
||||||
RxBus.defaultInstance.post(GuideEvent(1))
|
RxBus.defaultInstance.post(GuideEvent(1))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package com.cheng.blzb.ui.fragment.home
|
package com.cheng.blzb.ui.fragment.home
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
|
||||||
import android.view.MotionEvent
|
import android.view.MotionEvent
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
||||||
|
|
@ -21,7 +20,7 @@ import com.cheng.blzb.manager.SearchHistoryManager
|
||||||
import com.cheng.blzb.manager.UserConfigManager
|
import com.cheng.blzb.manager.UserConfigManager
|
||||||
import com.cheng.blzb.ui.activity.PublicActivity
|
import com.cheng.blzb.ui.activity.PublicActivity
|
||||||
import com.cheng.blzb.ui.dialog.CouponActivityDialog
|
import com.cheng.blzb.ui.dialog.CouponActivityDialog
|
||||||
import com.cheng.blzb.ui.dialog.GoodsCouponDialog
|
import com.cheng.blzb.ui.dialog.GoodsPromotionDialog
|
||||||
import com.cheng.blzb.ui.dialog.RedPacketActivityDialog
|
import com.cheng.blzb.ui.dialog.RedPacketActivityDialog
|
||||||
import com.cheng.blzb.ui.fragment.bid.BidAdapter
|
import com.cheng.blzb.ui.fragment.bid.BidAdapter
|
||||||
import com.cheng.blzb.ui.fragment.bid.detail.BidDetailFragment
|
import com.cheng.blzb.ui.fragment.bid.detail.BidDetailFragment
|
||||||
|
|
@ -32,8 +31,10 @@ import com.cheng.blzb.ui.fragment.home.zzdb.ZZDBFragment
|
||||||
import com.cheng.blzb.ui.fragment.mine.vip.VipFragment
|
import com.cheng.blzb.ui.fragment.mine.vip.VipFragment
|
||||||
import com.cheng.blzb.ui.fragment.search.SearchFragment
|
import com.cheng.blzb.ui.fragment.search.SearchFragment
|
||||||
import com.cheng.blzb.ui.fragment.search.list.SearchListFragment
|
import com.cheng.blzb.ui.fragment.search.list.SearchListFragment
|
||||||
|
import com.cheng.blzb.utils.DateUtils
|
||||||
import com.cheng.blzb.utils.PermissionUtils
|
import com.cheng.blzb.utils.PermissionUtils
|
||||||
import com.example.base.common.RxBus
|
import com.example.base.common.RxBus
|
||||||
|
import com.example.base.common.RxCountDown
|
||||||
import com.example.base.decoration.GridSpaceItemDecoration
|
import com.example.base.decoration.GridSpaceItemDecoration
|
||||||
import com.example.base.decoration.SpacesItemDecoration
|
import com.example.base.decoration.SpacesItemDecoration
|
||||||
import com.example.base.extensions.getColor
|
import com.example.base.extensions.getColor
|
||||||
|
|
@ -49,10 +50,10 @@ import com.example.base.utils.MMKVUtils
|
||||||
import com.example.base.utils.ScreenUtils
|
import com.example.base.utils.ScreenUtils
|
||||||
import com.example.base.utils.SpanUtils
|
import com.example.base.utils.SpanUtils
|
||||||
import com.ylqh.cube.bean.CouponActivityEntity
|
import com.ylqh.cube.bean.CouponActivityEntity
|
||||||
|
import io.reactivex.rxjava3.disposables.Disposable
|
||||||
import org.libpag.PAGFile
|
import org.libpag.PAGFile
|
||||||
import java.text.DecimalFormat
|
import java.text.DecimalFormat
|
||||||
import kotlin.math.abs
|
import kotlin.math.abs
|
||||||
import kotlin.text.toInt
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -79,6 +80,8 @@ class HomeFragment : ListFragment<FragmentHomeBinding, HomeViewModel, BidItemEnt
|
||||||
private var startY = 0f
|
private var startY = 0f
|
||||||
private var downX = 0f
|
private var downX = 0f
|
||||||
private var downY = 0f
|
private var downY = 0f
|
||||||
|
|
||||||
|
private var countdownTask: Disposable? = null
|
||||||
/*****红包优惠券*****/
|
/*****红包优惠券*****/
|
||||||
|
|
||||||
override fun initView() {
|
override fun initView() {
|
||||||
|
|
@ -87,6 +90,7 @@ class HomeFragment : ListFragment<FragmentHomeBinding, HomeViewModel, BidItemEnt
|
||||||
binding.tvHotTitle.typeface = Constants.pmzdbt
|
binding.tvHotTitle.typeface = Constants.pmzdbt
|
||||||
binding.tvBidTitleNew.typeface = Constants.pmzdbt
|
binding.tvBidTitleNew.typeface = Constants.pmzdbt
|
||||||
binding.tvBidTitle.typeface = Constants.pmzdbt
|
binding.tvBidTitle.typeface = Constants.pmzdbt
|
||||||
|
binding.tvCountdown.typeface = Constants.almmsht
|
||||||
|
|
||||||
binding.rvMenu.adapter = menuAdapter
|
binding.rvMenu.adapter = menuAdapter
|
||||||
binding.rvMenu.addItemDecoration(GridSpaceItemDecoration(4, DensityUtils.dp2px(16f), 0))
|
binding.rvMenu.addItemDecoration(GridSpaceItemDecoration(4, DensityUtils.dp2px(16f), 0))
|
||||||
|
|
@ -123,7 +127,6 @@ class HomeFragment : ListFragment<FragmentHomeBinding, HomeViewModel, BidItemEnt
|
||||||
firstLoad()
|
firstLoad()
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("ClickableViewAccessibility")
|
|
||||||
override fun initListener() {
|
override fun initListener() {
|
||||||
super.initListener()
|
super.initListener()
|
||||||
binding.appBarLayout.addOnOffsetChangedListener { appBarLayout, verticalOffset ->
|
binding.appBarLayout.addOnOffsetChangedListener { appBarLayout, verticalOffset ->
|
||||||
|
|
@ -193,13 +196,13 @@ class HomeFragment : ListFragment<FragmentHomeBinding, HomeViewModel, BidItemEnt
|
||||||
isFirstCheckCouponActivity = false
|
isFirstCheckCouponActivity = false
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.pvGoodsCoupon.onClick {
|
binding.layoutGoodsCoupon.onClick {
|
||||||
if (isFirstCheckGoodsCoupon) {
|
if (isFirstCheckGoodsCoupon) {
|
||||||
showGoodsCouponDialog()
|
showGoodsCouponDialog()
|
||||||
} else {
|
} else {
|
||||||
PublicActivity.start(requireContext(), VipFragment::class.java, Pair("origin", "home_coupon"))
|
PublicActivity.start(requireContext(), VipFragment::class.java, Pair("origin", "home_coupon"))
|
||||||
}
|
}
|
||||||
// isFirstCheckGoodsCoupon = false
|
isFirstCheckGoodsCoupon = false
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.pvCouponActivity.setOnTouchListener { v, event ->
|
binding.pvCouponActivity.setOnTouchListener { v, event ->
|
||||||
|
|
@ -247,7 +250,7 @@ class HomeFragment : ListFragment<FragmentHomeBinding, HomeViewModel, BidItemEnt
|
||||||
isNoClick
|
isNoClick
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.pvGoodsCoupon.setOnTouchListener { v, event ->
|
binding.layoutGoodsCoupon.setOnTouchListener { v, event ->
|
||||||
when (event.action) {
|
when (event.action) {
|
||||||
MotionEvent.ACTION_DOWN -> {
|
MotionEvent.ACTION_DOWN -> {
|
||||||
isNoClick = false
|
isNoClick = false
|
||||||
|
|
@ -359,6 +362,7 @@ class HomeFragment : ListFragment<FragmentHomeBinding, HomeViewModel, BidItemEnt
|
||||||
if (UserConfigManager.isShowGoodsCouponAnim()) {
|
if (UserConfigManager.isShowGoodsCouponAnim()) {
|
||||||
mViewModel.getGoodsList()
|
mViewModel.getGoodsList()
|
||||||
} else {
|
} else {
|
||||||
|
stopCouponActivityAnim(false)
|
||||||
mViewModel.couponActivityList()
|
mViewModel.couponActivityList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -367,7 +371,7 @@ class HomeFragment : ListFragment<FragmentHomeBinding, HomeViewModel, BidItemEnt
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun showGoodsCouponDialog() {
|
private fun showGoodsCouponDialog() {
|
||||||
val f = GoodsCouponDialog.newInstance(goodsList)
|
val f = GoodsPromotionDialog.newInstance(goodsList)
|
||||||
f.setOnBackListener { d ->
|
f.setOnBackListener { d ->
|
||||||
if (d == DialogEnum.CLICK_OK) {
|
if (d == DialogEnum.CLICK_OK) {
|
||||||
PublicActivity.start(requireContext(), VipFragment::class.java, Pair("origin", "home_coupon"))
|
PublicActivity.start(requireContext(), VipFragment::class.java, Pair("origin", "home_coupon"))
|
||||||
|
|
@ -375,8 +379,8 @@ class HomeFragment : ListFragment<FragmentHomeBinding, HomeViewModel, BidItemEnt
|
||||||
EventReportManager.eventReport(EventConstants.COUPON_ANIMATION_CLOSE, "home", "")
|
EventReportManager.eventReport(EventConstants.COUPON_ANIMATION_CLOSE, "home", "")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
f.show(childFragmentManager, CouponActivityDialog::class.java.simpleName)
|
f.show(childFragmentManager, GoodsPromotionDialog::class.java.simpleName)
|
||||||
// UserConfigManager.hideGoodsCouponAnim()
|
UserConfigManager.hideGoodsCouponAnim()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun showRedPacketActivityDialog() {
|
private fun showRedPacketActivityDialog() {
|
||||||
|
|
@ -410,18 +414,19 @@ class HomeFragment : ListFragment<FragmentHomeBinding, HomeViewModel, BidItemEnt
|
||||||
private fun startCouponActivityAnim(isRedPacket: Boolean) {
|
private fun startCouponActivityAnim(isRedPacket: Boolean) {
|
||||||
if (isRedPacket) {
|
if (isRedPacket) {
|
||||||
binding.pvCouponActivity.visible()
|
binding.pvCouponActivity.visible()
|
||||||
binding.pvGoodsCoupon.gone()
|
binding.layoutGoodsCoupon.gone()
|
||||||
val pagFile = PAGFile.Load(requireActivity().assets, "effects/red_packet_float.pag")
|
val pagFile = PAGFile.Load(requireActivity().assets, "effects/red_packet_float.pag")
|
||||||
binding.pvCouponActivity.composition = pagFile
|
binding.pvCouponActivity.composition = pagFile
|
||||||
binding.pvCouponActivity.setRepeatCount(0)
|
binding.pvCouponActivity.setRepeatCount(0)
|
||||||
binding.pvCouponActivity.play()
|
binding.pvCouponActivity.play()
|
||||||
} else {
|
} else {
|
||||||
binding.pvGoodsCoupon.visible()
|
binding.layoutGoodsCoupon.visible()
|
||||||
binding.pvCouponActivity.gone()
|
binding.pvCouponActivity.gone()
|
||||||
val pagFile = PAGFile.Load(requireActivity().assets, "effects/coupon_float.pag")
|
val pagFile = PAGFile.Load(requireActivity().assets, "effects/coupon_float.pag")
|
||||||
binding.pvGoodsCoupon.composition = pagFile
|
binding.pvGoodsCoupon.composition = pagFile
|
||||||
binding.pvGoodsCoupon.setRepeatCount(0)
|
binding.pvGoodsCoupon.setRepeatCount(0)
|
||||||
binding.pvGoodsCoupon.play()
|
binding.pvGoodsCoupon.play()
|
||||||
|
startCountdown()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -431,7 +436,31 @@ class HomeFragment : ListFragment<FragmentHomeBinding, HomeViewModel, BidItemEnt
|
||||||
binding.pvCouponActivity.gone()
|
binding.pvCouponActivity.gone()
|
||||||
} else {
|
} else {
|
||||||
binding.pvGoodsCoupon.pause()
|
binding.pvGoodsCoupon.pause()
|
||||||
binding.pvCouponActivity.gone()
|
binding.layoutGoodsCoupon.gone()
|
||||||
|
stopCountdown()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun startCountdown() {
|
||||||
|
stopCountdown()
|
||||||
|
countdownTask = RxCountDown.countdown(DateUtils.getDayEndTime() - System.currentTimeMillis() / 1000).subscribe {
|
||||||
|
if (it == 0L) {
|
||||||
|
startCountdown()
|
||||||
|
} else {
|
||||||
|
val minutes = it / 60
|
||||||
|
val hours = minutes / 60
|
||||||
|
binding.tvCountdown.text = String.format("%02d:%02d:%02d", hours, minutes % 60, it % 60)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun stopCountdown() {
|
||||||
|
countdownTask?.dispose()
|
||||||
|
countdownTask = null
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDestroyView() {
|
||||||
|
stopCountdown()
|
||||||
|
super.onDestroyView()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -94,6 +94,7 @@ class AccountManageFragment : BaseFragment<FragmentAccountManageBinding, Account
|
||||||
|
|
||||||
mViewModel.loginLiveData.observe(this) {
|
mViewModel.loginLiveData.observe(this) {
|
||||||
EventReportManager.eventReport(EventConstants.LOGIN, "device", it.user_id)
|
EventReportManager.eventReport(EventConstants.LOGIN, "device", it.user_id)
|
||||||
|
LoginManager.saveLastLoginType("device")
|
||||||
loginSuccess(it)
|
loginSuccess(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ import com.cheng.blzb.manager.UserConfigManager
|
||||||
import com.cheng.blzb.ui.activity.MainActivity
|
import com.cheng.blzb.ui.activity.MainActivity
|
||||||
import com.cheng.blzb.ui.activity.PublicActivity
|
import com.cheng.blzb.ui.activity.PublicActivity
|
||||||
import com.cheng.blzb.ui.dialog.CouponActivityDialog
|
import com.cheng.blzb.ui.dialog.CouponActivityDialog
|
||||||
|
import com.cheng.blzb.ui.dialog.GoodsPromotionDialog
|
||||||
import com.cheng.blzb.ui.dialog.PayTipDialog
|
import com.cheng.blzb.ui.dialog.PayTipDialog
|
||||||
import com.cheng.blzb.ui.dialog.RedPacketActivityDialog
|
import com.cheng.blzb.ui.dialog.RedPacketActivityDialog
|
||||||
import com.cheng.blzb.ui.dialog.SelectCouponDialog
|
import com.cheng.blzb.ui.dialog.SelectCouponDialog
|
||||||
|
|
@ -130,8 +131,10 @@ class VipFragment : BaseFragment<FragmentVipBinding, VipViewModel>() {
|
||||||
mViewModel.getGoodsList(if (vipType == 0) "member" else "corp")
|
mViewModel.getGoodsList(if (vipType == 0) "member" else "corp")
|
||||||
mViewModel.getCorpInfo()
|
mViewModel.getCorpInfo()
|
||||||
mViewModel.couponList()
|
mViewModel.couponList()
|
||||||
if (!MainActivity.hasCheckedVipEnterCouponActivity) {
|
if (!UserConfigManager.isShowGoodsCouponAnim()) {
|
||||||
mViewModel.couponEnterActivityList()
|
if (!MainActivity.hasCheckedVipEnterCouponActivity) {
|
||||||
|
mViewModel.couponEnterActivityList()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!MainActivity.hasCheckedVipReturnCouponActivity) {
|
if (!MainActivity.hasCheckedVipReturnCouponActivity) {
|
||||||
mViewModel.couponReturnActivityList()
|
mViewModel.couponReturnActivityList()
|
||||||
|
|
@ -354,6 +357,10 @@ class VipFragment : BaseFragment<FragmentVipBinding, VipViewModel>() {
|
||||||
setCoupon()
|
setCoupon()
|
||||||
setCouponCount()
|
setCouponCount()
|
||||||
initPrivacyTv()
|
initPrivacyTv()
|
||||||
|
|
||||||
|
if (UserConfigManager.isShowGoodsCouponAnim()) {
|
||||||
|
showGoodsCouponDialog()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mViewModel.couponListLiveData.observe(this) { list ->
|
mViewModel.couponListLiveData.observe(this) { list ->
|
||||||
|
|
@ -747,6 +754,12 @@ class VipFragment : BaseFragment<FragmentVipBinding, VipViewModel>() {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun showGoodsCouponDialog() {
|
||||||
|
val f = GoodsPromotionDialog.newInstance(goodsAdapter.data)
|
||||||
|
f.show(childFragmentManager, GoodsPromotionDialog::class.java.simpleName)
|
||||||
|
UserConfigManager.hideGoodsCouponAnim()
|
||||||
|
}
|
||||||
|
|
||||||
private fun showRedPacketActivityDialog(isEnter: Boolean) {
|
private fun showRedPacketActivityDialog(isEnter: Boolean) {
|
||||||
val coupon = if (isEnter) {
|
val coupon = if (isEnter) {
|
||||||
MainActivity.hasCheckedVipEnterCouponActivity = true
|
MainActivity.hasCheckedVipEnterCouponActivity = true
|
||||||
|
|
|
||||||
|
|
@ -1,154 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<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:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
|
||||||
android:id="@+id/iv_effect1_bg"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:scaleType="fitXY"
|
|
||||||
android:src="@mipmap/ic_goods_coupon_bg"
|
|
||||||
android:visibility="invisible"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintDimensionRatio="h,1125:320"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
|
||||||
android:id="@+id/iv_effect1_fg"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:scaleType="fitXY"
|
|
||||||
android:src="@mipmap/ic_goods_coupon_fg"
|
|
||||||
android:visibility="invisible"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintDimensionRatio="h,1125:245"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
|
||||||
android:id="@+id/iv_effect1_desc"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_marginStart="@dimen/dp_50"
|
|
||||||
android:layout_marginEnd="@dimen/dp_50"
|
|
||||||
android:src="@mipmap/ic_goods_coupon_desc"
|
|
||||||
android:visibility="invisible"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintDimensionRatio="h,963:174"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
|
||||||
android:id="@+id/iv_effect1_light1"
|
|
||||||
android:layout_width="194dp"
|
|
||||||
android:layout_height="60dp"
|
|
||||||
android:layout_marginStart="-30dp"
|
|
||||||
android:layout_marginTop="-30dp"
|
|
||||||
android:alpha="0.5"
|
|
||||||
android:src="@mipmap/ic_goods_coupon_light"
|
|
||||||
android:visibility="invisible"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="@id/iv_effect1_bg"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
|
||||||
android:id="@+id/iv_effect1_star1"
|
|
||||||
android:layout_width="43dp"
|
|
||||||
android:layout_height="43dp"
|
|
||||||
android:layout_marginStart="-30dp"
|
|
||||||
android:layout_marginBottom="@dimen/dp_5"
|
|
||||||
android:alpha="0.5"
|
|
||||||
android:src="@mipmap/ic_goods_coupon_star"
|
|
||||||
android:visibility="invisible"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@id/iv_effect1_light1"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/iv_effect1_light1"
|
|
||||||
app:layout_constraintTop_toTopOf="@id/iv_effect1_light1"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
|
||||||
android:id="@+id/iv_effect1_light2"
|
|
||||||
android:layout_width="194dp"
|
|
||||||
android:layout_height="60dp"
|
|
||||||
android:layout_marginStart="-30dp"
|
|
||||||
android:layout_marginTop="-10dp"
|
|
||||||
android:layout_marginEnd="@dimen/dp_20"
|
|
||||||
android:alpha="0.5"
|
|
||||||
android:src="@mipmap/ic_goods_coupon_light"
|
|
||||||
android:visibility="invisible"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="@id/iv_effect1_bg"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
|
||||||
android:id="@+id/iv_effect1_star2"
|
|
||||||
android:layout_width="43dp"
|
|
||||||
android:layout_height="43dp"
|
|
||||||
android:layout_marginStart="-30dp"
|
|
||||||
android:layout_marginBottom="@dimen/dp_5"
|
|
||||||
android:alpha="0.5"
|
|
||||||
android:src="@mipmap/ic_goods_coupon_star"
|
|
||||||
android:visibility="invisible"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@id/iv_effect1_light2"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/iv_effect1_light2"
|
|
||||||
app:layout_constraintTop_toTopOf="@id/iv_effect1_light2"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
|
||||||
android:id="@+id/iv_effect1_light3"
|
|
||||||
android:layout_width="194dp"
|
|
||||||
android:layout_height="60dp"
|
|
||||||
android:layout_marginStart="-80dp"
|
|
||||||
android:layout_marginBottom="-20dp"
|
|
||||||
android:alpha="0.5"
|
|
||||||
android:src="@mipmap/ic_goods_coupon_light"
|
|
||||||
android:visibility="invisible"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@id/iv_effect1_bg"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
|
||||||
android:id="@+id/iv_effect1_star3"
|
|
||||||
android:layout_width="43dp"
|
|
||||||
android:layout_height="43dp"
|
|
||||||
android:layout_marginStart="-30dp"
|
|
||||||
android:layout_marginBottom="@dimen/dp_5"
|
|
||||||
android:alpha="0.5"
|
|
||||||
android:src="@mipmap/ic_goods_coupon_star"
|
|
||||||
android:visibility="invisible"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@id/iv_effect1_light3"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/iv_effect1_light3"
|
|
||||||
app:layout_constraintTop_toTopOf="@id/iv_effect1_light3"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
|
||||||
android:id="@+id/iv_effect1_light4"
|
|
||||||
android:layout_width="194dp"
|
|
||||||
android:layout_height="60dp"
|
|
||||||
android:layout_marginEnd="70dp"
|
|
||||||
android:layout_marginBottom="-36dp"
|
|
||||||
android:alpha="0.5"
|
|
||||||
android:src="@mipmap/ic_goods_coupon_light"
|
|
||||||
android:visibility="invisible"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@id/iv_effect1_bg"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView
|
|
||||||
android:id="@+id/iv_effect1_star4"
|
|
||||||
android:layout_width="43dp"
|
|
||||||
android:layout_height="43dp"
|
|
||||||
android:layout_marginStart="-30dp"
|
|
||||||
android:layout_marginBottom="@dimen/dp_5"
|
|
||||||
android:alpha="0.5"
|
|
||||||
android:src="@mipmap/ic_goods_coupon_star"
|
|
||||||
android:visibility="invisible"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@id/iv_effect1_light4"
|
|
||||||
app:layout_constraintStart_toEndOf="@id/iv_effect1_light4"
|
|
||||||
app:layout_constraintTop_toTopOf="@id/iv_effect1_light4"
|
|
||||||
tools:visibility="visible" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
@ -0,0 +1,305 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<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:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/layout_tip"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/iv_effect1_bg"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:scaleType="fitXY"
|
||||||
|
android:src="@mipmap/ic_goods_promotion_bg"
|
||||||
|
android:visibility="invisible"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintDimensionRatio="h,1125:320"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/iv_effect1_fg"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:scaleType="fitXY"
|
||||||
|
android:src="@mipmap/ic_goods_promotion_fg"
|
||||||
|
android:visibility="invisible"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintDimensionRatio="h,1125:245"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/iv_effect1_desc"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginStart="@dimen/dp_50"
|
||||||
|
android:layout_marginEnd="@dimen/dp_50"
|
||||||
|
android:src="@mipmap/ic_goods_promotion_desc"
|
||||||
|
android:visibility="invisible"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintDimensionRatio="h,963:174"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/iv_effect1_light1"
|
||||||
|
android:layout_width="194dp"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:layout_marginStart="-30dp"
|
||||||
|
android:layout_marginTop="-30dp"
|
||||||
|
android:alpha="0.5"
|
||||||
|
android:src="@mipmap/ic_goods_promotion_light"
|
||||||
|
android:visibility="invisible"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/iv_effect1_bg"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/iv_effect1_star1"
|
||||||
|
android:layout_width="43dp"
|
||||||
|
android:layout_height="43dp"
|
||||||
|
android:layout_marginStart="-30dp"
|
||||||
|
android:layout_marginBottom="@dimen/dp_5"
|
||||||
|
android:alpha="0.5"
|
||||||
|
android:src="@mipmap/ic_goods_promotion_star"
|
||||||
|
android:visibility="invisible"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/iv_effect1_light1"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/iv_effect1_light1"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/iv_effect1_light1"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/iv_effect1_light2"
|
||||||
|
android:layout_width="194dp"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:layout_marginStart="-30dp"
|
||||||
|
android:layout_marginTop="-10dp"
|
||||||
|
android:layout_marginEnd="@dimen/dp_20"
|
||||||
|
android:alpha="0.5"
|
||||||
|
android:src="@mipmap/ic_goods_promotion_light"
|
||||||
|
android:visibility="invisible"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/iv_effect1_bg"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/iv_effect1_star2"
|
||||||
|
android:layout_width="43dp"
|
||||||
|
android:layout_height="43dp"
|
||||||
|
android:layout_marginStart="-30dp"
|
||||||
|
android:layout_marginBottom="@dimen/dp_5"
|
||||||
|
android:alpha="0.5"
|
||||||
|
android:src="@mipmap/ic_goods_promotion_star"
|
||||||
|
android:visibility="invisible"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/iv_effect1_light2"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/iv_effect1_light2"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/iv_effect1_light2"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/iv_effect1_light3"
|
||||||
|
android:layout_width="194dp"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:layout_marginStart="-80dp"
|
||||||
|
android:layout_marginBottom="-20dp"
|
||||||
|
android:alpha="0.5"
|
||||||
|
android:src="@mipmap/ic_goods_promotion_light"
|
||||||
|
android:visibility="invisible"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/iv_effect1_bg"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/iv_effect1_star3"
|
||||||
|
android:layout_width="43dp"
|
||||||
|
android:layout_height="43dp"
|
||||||
|
android:layout_marginStart="-30dp"
|
||||||
|
android:layout_marginBottom="@dimen/dp_5"
|
||||||
|
android:alpha="0.5"
|
||||||
|
android:src="@mipmap/ic_goods_promotion_star"
|
||||||
|
android:visibility="invisible"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/iv_effect1_light3"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/iv_effect1_light3"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/iv_effect1_light3"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/iv_effect1_light4"
|
||||||
|
android:layout_width="194dp"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:layout_marginEnd="70dp"
|
||||||
|
android:layout_marginBottom="-36dp"
|
||||||
|
android:alpha="0.5"
|
||||||
|
android:src="@mipmap/ic_goods_promotion_light"
|
||||||
|
android:visibility="invisible"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/iv_effect1_bg"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/iv_effect1_star4"
|
||||||
|
android:layout_width="43dp"
|
||||||
|
android:layout_height="43dp"
|
||||||
|
android:layout_marginStart="-30dp"
|
||||||
|
android:layout_marginBottom="@dimen/dp_5"
|
||||||
|
android:alpha="0.5"
|
||||||
|
android:src="@mipmap/ic_goods_promotion_star"
|
||||||
|
android:visibility="invisible"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/iv_effect1_light4"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/iv_effect1_light4"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/iv_effect1_light4"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/layout_goods"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<AdapterViewFlipper
|
||||||
|
android:id="@+id/viewFlipper"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginStart="@dimen/dp_58"
|
||||||
|
android:layout_marginEnd="@dimen/dp_58"
|
||||||
|
android:autoStart="true"
|
||||||
|
android:flipInterval="600"
|
||||||
|
android:layout_marginBottom="@dimen/dp_60"
|
||||||
|
tools:visibility="visible"
|
||||||
|
android:visibility="invisible"
|
||||||
|
android:background="@mipmap/ic_goods_promotion_user_bg"
|
||||||
|
android:inAnimation="@animator/anim_vf_in"
|
||||||
|
android:loopViews="true"
|
||||||
|
app:layout_constraintDimensionRatio="h,260:34"
|
||||||
|
android:outAnimation="@animator/anim_vf_out"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/rv_goods" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_add1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="@dimen/dp_48"
|
||||||
|
android:layout_marginBottom="@dimen/dp_5"
|
||||||
|
android:text="+1"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/sp_12"
|
||||||
|
android:visibility="invisible"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/viewFlipper"
|
||||||
|
app:layout_constraintEnd_toEndOf="@id/viewFlipper"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_add2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="+1"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/sp_12"
|
||||||
|
android:visibility="invisible"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/tv_add1"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tv_add1"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/iv_goods_light"
|
||||||
|
android:layout_width="600dp"
|
||||||
|
android:layout_height="600dp"
|
||||||
|
android:src="@mipmap/ic_goods_promotion_bg_light"
|
||||||
|
android:visibility="invisible"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/rv_goods"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/rv_goods"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/iv_goods_base"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="-45dp"
|
||||||
|
android:src="@mipmap/ic_goods_promotion_goods_base"
|
||||||
|
android:visibility="invisible"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/rv_goods"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/rv_goods"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="@dimen/dp_170"
|
||||||
|
android:layout_marginTop="@dimen/dp_100"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:visibility="invisible"
|
||||||
|
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
tools:itemCount="3"
|
||||||
|
tools:listitem="@layout/listitem_promotion_goods"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/iv_goods_cover"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp_12"
|
||||||
|
android:layout_marginBottom="-60dp"
|
||||||
|
android:src="@mipmap/ic_goods_promotion_goods_cover"
|
||||||
|
android:visibility="invisible"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/rv_goods"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
tools:visibility="visible" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/layout_next"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_65"
|
||||||
|
android:visibility="invisible"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/rv_goods"
|
||||||
|
tools:visibility="visible">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:layout_width="186dp"
|
||||||
|
android:layout_height="70dp"
|
||||||
|
android:src="@mipmap/ic_goods_promotion_btn" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginTop="@dimen/dp_13"
|
||||||
|
android:shadowColor="#4d000000"
|
||||||
|
android:shadowDy="1"
|
||||||
|
android:shadowRadius="2"
|
||||||
|
android:text="前往成为会员"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/sp_16" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/iv_close"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:src="@mipmap/ic_close_dialog2"
|
||||||
|
android:visibility="invisible"
|
||||||
|
tools:visibility="visible"
|
||||||
|
android:layout_marginEnd="@dimen/dp_50"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
android:layout_marginTop="@dimen/dp_100"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
@ -143,8 +143,8 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:background="@color/windowBackground"
|
android:background="@color/windowBackground"
|
||||||
app:layout_constraintTop_toBottomOf="@id/iv_title_bg"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
app:layout_constraintTop_toBottomOf="@id/iv_title_bg" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_bid_title_new"
|
android:id="@+id/tv_bid_title_new"
|
||||||
|
|
@ -213,19 +213,42 @@
|
||||||
android:layout_width="@dimen/dp_76"
|
android:layout_width="@dimen/dp_76"
|
||||||
android:layout_height="@dimen/dp_76"
|
android:layout_height="@dimen/dp_76"
|
||||||
android:layout_marginBottom="@dimen/dp_200"
|
android:layout_marginBottom="@dimen/dp_200"
|
||||||
android:visibility="gone"
|
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent" />
|
app:layout_constraintEnd_toEndOf="parent" />
|
||||||
|
|
||||||
<org.libpag.PAGImageView
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/pv_goods_coupon"
|
android:id="@+id/layout_goods_coupon"
|
||||||
android:layout_width="@dimen/dp_76"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="@dimen/dp_76"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="@dimen/dp_200"
|
android:layout_marginBottom="@dimen/dp_200"
|
||||||
android:visibility="gone"
|
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent" />
|
app:layout_constraintEnd_toEndOf="parent">
|
||||||
|
|
||||||
|
<org.libpag.PAGImageView
|
||||||
|
android:id="@+id/pv_goods_coupon"
|
||||||
|
android:layout_width="@dimen/dp_76"
|
||||||
|
android:layout_height="@dimen/dp_76"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_countdown"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="00:00:00"
|
||||||
|
android:textColor="#FF533D"
|
||||||
|
android:textSize="@dimen/sp_10"
|
||||||
|
android:layout_marginTop="-5dp"
|
||||||
|
android:layout_marginEnd="@dimen/dp_2"
|
||||||
|
app:layout_constraintEnd_toEndOf="@id/pv_goods_coupon"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/pv_goods_coupon"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/pv_goods_coupon" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/iv_avatar"
|
||||||
|
android:layout_width="@dimen/dp_20"
|
||||||
|
android:layout_height="@dimen/dp_20" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_content"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="@dimen/sp_12"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:layout_marginStart="@dimen/dp_5"
|
||||||
|
android:text="54813用户成为了终身会员" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
@ -0,0 +1,92 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<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:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/layout_content"
|
||||||
|
android:layout_width="110dp"
|
||||||
|
android:layout_height="140dp"
|
||||||
|
android:layout_marginStart="@dimen/dp_10"
|
||||||
|
android:layout_marginEnd="@dimen/dp_10"
|
||||||
|
android:paddingTop="@dimen/dp_14"
|
||||||
|
android:paddingBottom="@dimen/dp_8"
|
||||||
|
android:background="@mipmap/ic_goods_promotion_goods_bg"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintDimensionRatio="w,107:134"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent">
|
||||||
|
|
||||||
|
<com.flyjingfish.gradienttextviewlib.GradientTextView
|
||||||
|
android:id="@+id/tv_name"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="终身会员"
|
||||||
|
android:textSize="@dimen/sp_16"
|
||||||
|
app:gradient_endColor="#643207"
|
||||||
|
app:gradient_startColor="#E8A266"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/tv_price"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<com.flyjingfish.gradienttextviewlib.GradientTextView
|
||||||
|
android:id="@+id/tv_price"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="¥398"
|
||||||
|
android:textSize="@dimen/sp_30"
|
||||||
|
app:gradient_endColor="#643207"
|
||||||
|
app:gradient_startColor="#E8A266"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/tv_saved_price"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tv_name" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_saved_price"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="立减3601"
|
||||||
|
android:visibility="invisible"
|
||||||
|
tools:visibility="visible"
|
||||||
|
android:textColor="#844E1E"
|
||||||
|
android:textSize="@dimen/sp_10"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/tv_origin_price"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tv_price" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_origin_price"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="¥3999"
|
||||||
|
android:visibility="invisible"
|
||||||
|
tools:visibility="visible"
|
||||||
|
android:textColor="#844E1E"
|
||||||
|
android:textSize="@dimen/sp_10"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tv_saved_price" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_tag"
|
||||||
|
android:layout_width="56dp"
|
||||||
|
android:layout_height="29dp"
|
||||||
|
android:layout_marginBottom="-5dp"
|
||||||
|
android:background="@mipmap/ic_goods_promotion_goods_tag_bg"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:paddingTop="@dimen/dp_3"
|
||||||
|
android:text="限时优惠"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/sp_10"
|
||||||
|
tools:visibility="visible"
|
||||||
|
android:visibility="invisible"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/layout_content"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/layout_content" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
Before Width: | Height: | Size: 189 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 211 KiB |
|
Before Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 852 B |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 2.0 KiB |