Commit 916b59c3 authored by mengcuiguang's avatar mengcuiguang

Merge branch 'dev_wangzhuan_0906' of...

Merge branch 'dev_wangzhuan_0906' of http://gitlab.mints-id.com/android/android_vedio into dev_wangzhuan_0906
parents 55a9c9bc ee64f69d
......@@ -163,6 +163,11 @@
android:hardwareAccelerated="true"
android:screenOrientation="portrait" />
<activity
android:name=".ui.activitys.SongAwardActivity"
android:exported="false"
android:screenOrientation="portrait" />
<service
android:name=".ui.service.UpdateService"
android:exported="true" />
......
......@@ -20,7 +20,6 @@ object Constant {
const val ACTION_EXIT_APP = "package.exit"
const val CARRIERTYPE_CSJ_VEDIO = "VEDIO_UNLOCK"
const val CARRIERTYPE_TX_VEDIO = "VEDIO_UNLOCK"
const val CARRIERTYPE_REWARD_FIRST = "REWARD_FIRST" //新人红包视频
const val CARRIERTYPE_SIGN = "FORCASH_SIGN" //签到
......@@ -33,6 +32,8 @@ object Constant {
const val CARRIERTYPE_SONG_MORE = "REWARD_GUESS_SONG_MORE" //翻倍 的入参
const val CARRIERTYPE_SONG_ALL = "REWARD_GUESS_SONG_ALL" //画着红包直接看视频的入参
const val CARRIERTYPE_VEDIO_UNLOCK = "VEDIO_UNLOCK"
const val CARRIERTYPE_VEDIO = "REWARD_VEDIO" //加金币
const val FRAGMENT_CLICK_ONE = 0
const val FRAGMENT_CLICK_TWO = 1
......
......@@ -69,7 +69,10 @@ class MusicPresenter : BasePresenter<MusicView>() {
when (code) {
200 -> {
view.reportAddCoinMsgSuc()
val data = baseResponse.data
if (data != null) {
view.reportAddCoinMsgSuc(data["coin"].asInt, data["di"].asInt)
}
}
else -> {
view.showToast(message)
......
......@@ -132,4 +132,42 @@ class VideoPresenter : BasePresenter<VideoView>() {
}
// 添加金币
fun reportAddCoinMsg(carrierType: String, ecpmId: String = "") {
val vo = HashMap<String, Any>()
vo["ecpmId"] = ecpmId
vo["carrierType"] = carrierType
AppHttpManager.getInstance(loanApplication)
.call(loanService.reportAddCoinMsg(vo),
object : BaseSubscriber<BaseResponse<JsonObject>>() {
override fun onCompleted() {
if (isLinkView) return
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.showToast(e.message)
}
override fun onNext(baseResponse: BaseResponse<JsonObject>) {
if (isLinkView) return
val code = baseResponse.status
val message = baseResponse.message
when (code) {
200 -> {
val data = baseResponse.data
if (data != null) {
view.reportAddCoinMsgSuc(data["coin"].asInt, data["di"].asInt)
}
}
else -> {
view.showToast(message)
}
}
}
})
}
}
\ No newline at end of file
......@@ -5,5 +5,5 @@ import com.duben.dayplaylet.mvp.model.MusicBean
interface MusicView : BaseView {
fun rdSongMsgSuc(data: MusicBean)
fun rdSongMsgFail()
fun reportAddCoinMsgSuc()
fun reportAddCoinMsgSuc(coin: Int, di: Int)
}
\ No newline at end of file
......@@ -3,7 +3,6 @@ package com.duben.dayplaylet.mvp.views
import com.duben.dayplaylet.mvp.model.IndexList
import com.duben.dayplaylet.mvp.model.NineShowBean
interface VideoView : BaseView {
fun getIndexListSuc(indexList: IndexList)
fun getIndexListFail()
......@@ -13,4 +12,6 @@ interface VideoView : BaseView {
fun rdVedioMsgSuc(surplusCount: Int, surplusSeconds: Int)
fun reportAddCoinMsgSuc(coin: Int, di: Int)
}
\ No newline at end of file
package com.duben.dayplaylet.ui.activitys
import android.content.Intent
import android.os.Bundle
import android.view.KeyEvent
import android.view.View
import com.duben.dayplaylet.R
import com.duben.dayplaylet.ui.activitys.base.BaseActivity
import com.duben.library.utils.nodoubleclick.AntiShake
import kotlinx.android.synthetic.main.activity_song_award.*
/**
* 猜歌页-任务奖励
*/
class SongAwardActivity : BaseActivity(), View.OnClickListener {
companion object {
const val ACTIVITY_REQUEST_CODE = 0x03243
const val SONG_REDPACKET = "SONG_REDPACKET" //红包
const val SONG_YUANBAO = "SONG_YUANBAO" //元宝
}
private var yuanbao = 0
private var redPacket = 0
override fun getContentViewLayoutID() = R.layout.activity_song_award
override fun isApplyKitKatTranslucency() = false
override fun toggleOverridePendingTransition() = true
override fun getOverridePendingTransitionMode() = TransitionMode.FADE
override fun getBundleExtras(extras: Bundle?) {
super.getBundleExtras(extras)
extras?.let {
yuanbao = it.getInt(SONG_YUANBAO, 0)
redPacket = it.getInt(SONG_REDPACKET, 0)
}
}
override fun initViewsAndEvents() {
tv_award_redpkg.text = "+" + redPacket
tv_award_yuanbao.text = "+" + yuanbao
initListener()
}
private fun initListener() {
}
override fun finish() {
super.finish()
hideLoading()
overridePendingTransition(0, R.anim.scale_out)
}
override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
return if (keyCode == KeyEvent.KEYCODE_BACK) {
true
} else super.onKeyDown(
keyCode,
event
)
}
override fun onClick(v: View) {
if (AntiShake.check(v.id)) return
val intent = Intent()
intent.putExtra(SONG_REDPACKET, redPacket)
intent.putExtra(SONG_YUANBAO, yuanbao)
when (v.id) {
R.id.iv_award_quit -> {
setResult(ACTIVITY_REQUEST_CODE, intent)
finish()
}
R.id.iv_song_award -> {
setResult(ACTIVITY_REQUEST_CODE, intent)
finish()
}
}
}
}
\ No newline at end of file
......@@ -2,8 +2,10 @@ package com.duben.dayplaylet.ui.fragment
import android.animation.Animator
import android.animation.ValueAnimator
import android.content.Intent
import android.graphics.Path
import android.graphics.PathMeasure
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.view.LayoutInflater
......@@ -35,11 +37,16 @@ import com.duben.dayplaylet.manager.DPHolder
import com.duben.dayplaylet.mvp.model.MusicBean
import com.duben.dayplaylet.mvp.presenters.MusicPresenter
import com.duben.dayplaylet.mvp.views.MusicView
import com.duben.dayplaylet.ui.activitys.SongAwardActivity
import com.duben.dayplaylet.ui.fragment.base.LazyLoadBaseFragment
import com.duben.dayplaylet.ui.widgets.countdowntimer.CountDownTimerSupport
import com.duben.dayplaylet.ui.widgets.countdowntimer.OnCountDownTimerListener
import com.duben.dayplaylet.utils.LogUtil
import com.duben.dayplaylet.utils.RxBus
import com.duben.dayplaylet.utils.RxBus.MsgEvent
import com.duben.dayplaylet.utils.SpanUtils
import io.reactivex.Observer
import io.reactivex.disposables.Disposable
import kotlinx.android.synthetic.main.fragment_music.*
import kotlinx.android.synthetic.main.layout_draw_header.*
......@@ -48,7 +55,11 @@ import kotlinx.android.synthetic.main.layout_draw_header.*
*/
class MusicFragment : LazyLoadBaseFragment(), MusicView {
private val TAG = "MusicFragment"
companion object {
private const val TAG = "MusicFragment"
}
private var mCarrierType = Constant.CARRIERTYPE_SONG_CLICK
private val musicPresenter by lazy { MusicPresenter() }
......@@ -121,7 +132,8 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
private fun initDrawWidget() {
mIDPWidget =
DPHolder.getInstance()
.buildDrawWidget(DPWidgetDrawParams.obtain().liveAdCodeId("947474066")
.buildDrawWidget(
DPWidgetDrawParams.obtain().liveAdCodeId("947474066")
.liveNativeAdCodeId("947474068")
.adOffset(0) //单位 dp,为 0 时可以不设置
.quizMode(1)
......@@ -139,6 +151,9 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
if (map == null) {
return
}
RxBus.getDefault().post(MsgEvent("BUS_CHANGE_PAGE"))
mPos = position
LogUtil.d(TAG, "onDPPageChange: $position, map = $map")
}
......@@ -170,13 +185,18 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
val quizLLPop = view.findViewById<LinearLayout>(R.id.quiz_ll_pop)
val quizTvPop = view.findViewById<TextView>(R.id.quiz_tv_pop)
val finger = view.findViewById<LottieAnimationView>(R.id.finger_view)
val finger =
view.findViewById<LottieAnimationView>(R.id.finger_view)
val rlOption0 = view.findViewById<RelativeLayout>(R.id.rl_option0)
val rlOption1 = view.findViewById<RelativeLayout>(R.id.rl_option1)
val quizIvRedbox0 = view.findViewById<ImageView>(R.id.quiz_iv_redbox0)
val quizIvRedbox1 = view.findViewById<ImageView>(R.id.quiz_iv_redbox1)
val quizIvOption0 = view.findViewById<ImageView>(R.id.quiz_iv_option0)
val quizIvOption1 = view.findViewById<ImageView>(R.id.quiz_iv_option1)
val quizIvRedbox0 =
view.findViewById<ImageView>(R.id.quiz_iv_redbox0)
val quizIvRedbox1 =
view.findViewById<ImageView>(R.id.quiz_iv_redbox1)
val quizIvOption0 =
view.findViewById<ImageView>(R.id.quiz_iv_option0)
val quizIvOption1 =
view.findViewById<ImageView>(R.id.quiz_iv_option1)
val quizIv = view.findViewById<ImageView>(R.id.quiz_iv)
val option0 = view.findViewById<TextView>(R.id.quiz_option0)
val option1 = view.findViewById<TextView>(R.id.quiz_option1)
......@@ -248,6 +268,7 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
} else {
quizIv.setBackgroundResource(R.drawable.icon_quiz_error_toast_bg)
}
button.setBackgroundResource(R.drawable.icon_quiz_button_bg)
if (i == 0) {
// 答案1
quizIvOption0.visibility = View.VISIBLE
......@@ -266,6 +287,7 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
if (it.nextIsAd) {
awardVideo(Constant.CARRIERTYPE_SONG_ALL)
} else {
mCarrierType = Constant.CARRIERTYPE_SONG_CLICK
musicPresenter.reportAddCoinMsg(Constant.CARRIERTYPE_SONG_CLICK)
quizTvPop.visibility = View.VISIBLE
......@@ -295,6 +317,38 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
button.setBackgroundResource(background)
}
}
RxBus.getDefault().toObservable(MsgEvent::class.java)
.subscribe(object : Observer<MsgEvent> {
override fun onSubscribe(d: Disposable) {
}
override fun onNext(t: MsgEvent) {
if (!quizIvRedbox0.isClickable) return
for (i in optionsList.indices) {
val right = answer == i
if (right) {
mMusicBean?.let {
if (it.nextIsAd) {
if (i == 0) {
quizIvRedbox0.visibility =
View.VISIBLE
} else {
quizIvRedbox1.visibility =
View.VISIBLE
}
}
}
}
}
}
override fun onError(e: Throwable) {
}
override fun onComplete() {
}
})
}
override fun onDPVideoPlay(map: Map<String, Any>) {
......@@ -314,11 +368,17 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
}
override fun onDPReportResult(isSucceed: Boolean) {
LogUtil.d(TAG, "onDPReportResult isSucceed = $isSucceed")
LogUtil.d(
TAG,
"onDPReportResult isSucceed = $isSucceed"
)
}
override fun onDPPageStateChanged(pageState: DPPageState) {
LogUtil.d(TAG, "onDPPageStateChanged pageState = $pageState")
LogUtil.d(
TAG,
"onDPPageStateChanged pageState = $pageState"
)
}
override fun onDPReportResult(
......@@ -340,7 +400,10 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
return
}
for (i in list.indices) {
LogUtil.d(TAG, "onDPRequestSuccess i=$i,map=${list[i]}")
LogUtil.d(
TAG,
"onDPRequestSuccess i=$i,map=${list[i]}"
)
}
}
......@@ -350,7 +413,10 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
@Nullable map: Map<String, Any>?
) {
if (map == null) {
LogUtil.d(TAG, "onDPRequestFail code = $code, msg = $msg")
LogUtil.d(
TAG,
"onDPRequestFail code = $code, msg = $msg"
)
return
}
LogUtil.d(
......@@ -371,8 +437,14 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
LogUtil.d(TAG, "onDPClickComment map = $map")
}
override fun onDPClickLike(isLike: Boolean, map: Map<String, Any>) {
LogUtil.d(TAG, "onDPClickLike isLike = $isLike, map = $map")
override fun onDPClickLike(
isLike: Boolean,
map: Map<String, Any>
) {
LogUtil.d(
TAG,
"onDPClickLike isLike = $isLike, map = $map"
)
}
override fun onDPVideoPause(map: Map<String, Any>) {
......@@ -386,7 +458,8 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
override fun onDPClickShare(map: Map<String, Any>) {
LogUtil.d(TAG, "onDPClickShare map = $map")
}
}).adListener(object : IDPAdListener() {
}).adListener(
object : IDPAdListener() {
override fun onDPAdRequest(map: Map<String, Any>) {
LogUtil.d(TAG, "onDPAdRequest map = $map")
}
......@@ -444,7 +517,11 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
if (it.openCash) {
rl_open_cash.visibility = View.VISIBLE
tv_open_cash_progress.text =
String.format("%2d/%2d", it.completeCount, it.turnNeedCount)
String.format(
"%2d/%2d",
it.completeCount,
it.turnNeedCount
)
pb_open_cash.max = it.turnNeedCount
pb_open_cash.progress = it.completeCount
if (it.completeCount >= it.turnNeedCount) {
......@@ -454,7 +531,12 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
tv_open_cash_info.text = SpanUtils()
.append("再答")
.append("" + (it.turnNeedCount - it.completeCount))
.setForegroundColor(ContextCompat.getColor(mContext, R.color.red))
.setForegroundColor(
ContextCompat.getColor(
mContext,
R.color.red
)
)
.append("题立即提现")
.create()
}
......@@ -522,7 +604,27 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
}, 1500)
}
override fun reportAddCoinMsgSuc() {
override fun reportAddCoinMsgSuc(coin: Int, di: Int) {
when (mCarrierType) {
Constant.CARRIERTYPE_SONG_CLICK -> {
showRewardAnim(coin, di)
}
Constant.CARRIERTYPE_SONG_MORE -> {
val bundle = Bundle()
bundle.putInt(SongAwardActivity.SONG_REDPACKET, coin)
bundle.putInt(SongAwardActivity.SONG_YUANBAO, di)
readyGoForResult(
SongAwardActivity::class.java,
SongAwardActivity.ACTIVITY_REQUEST_CODE,
bundle
)
// showRewardAnim(coin, di)
}
Constant.CARRIERTYPE_SONG_ALL -> {
showRewardAnim(coin, di)
}
else -> {}
}
musicPresenter.rdSongMsg()
}
......@@ -536,24 +638,36 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
override fun adFail() {
if (canFail) return
showLoading("正在获取视频", false)
NoPreAdManager.loadVideoAd(requireActivity(), carrierType,
object : AdStatusListener {
override fun adFail() {
hideLoading()
showToast("广告太火爆了,请稍候再试")
}
override fun adSuccess() {
hideLoading()
}
override fun adClose(vo: HashMap<String, Any>?) {
musicPresenter.reportAddCoinMsg(carrierType, AppConfig.gromoreId)
hideLoading()
mCarrierType = carrierType
musicPresenter.reportAddCoinMsg(
carrierType,
vo?.get("ecpmId") as String
)
}
})
}
override fun adClose(vo: HashMap<String, Any>?) {
musicPresenter.reportAddCoinMsg(carrierType, AppConfig.gromoreId)
mCarrierType = carrierType
musicPresenter.reportAddCoinMsg(
carrierType,
vo?.get("ecpmId") as String
)
}
})
}
......@@ -567,8 +681,6 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
finger.visibility = View.GONE
quizLLPop.setOnClickListener {
awardVideo(Constant.CARRIERTYPE_SONG_MORE)
quizLLPop.visibility = View.GONE
quizTvPop.visibility = View.GONE
mTimer?.stop()
......@@ -579,7 +691,10 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
mTimer = CountDownTimerSupport(8000, 1000)
mTimer?.setOnCountDownTimerListener(object : OnCountDownTimerListener {
override fun onTick(millisUntilFinished: Long) {
quizTvPop.text = String.format("%2ds后消失", (millisUntilFinished / 1000).toInt())
quizTvPop.text = String.format(
"%2ds后消失",
(millisUntilFinished / 1000).toInt()
)
}
override fun onFinish() {
......@@ -596,7 +711,8 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
mTimer?.start()
mainHandler.postDelayed({
rope = null
rope = YoYo.with(Techniques.Pulse).duration(1000).repeat(-1).playOn(quizLLPop)
rope = YoYo.with(Techniques.Pulse).duration(1000).repeat(-1)
.playOn(quizLLPop)
val ls = finger.layoutParams as RelativeLayout.LayoutParams
ls.addRule(RelativeLayout.ALIGN_TOP, R.id.quiz_ll_pop)
......@@ -669,7 +785,8 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
val toX =
endLoc[0] - parentLocation[0].toFloat()
// + targetView.width / 5.toFloat()
val toY = endLoc[1] - parentLocation[1].toFloat() + targetView.height / 5.toFloat()
val toY =
endLoc[1] - parentLocation[1].toFloat() + targetView.height / 5.toFloat()
//四、计算中间动画的插值坐标(贝塞尔曲线)(其实就是用贝塞尔曲线来完成起终点的过程)
//开始绘制贝塞尔曲线
......@@ -696,7 +813,11 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
// boolean getPosTan(float distance, float[] pos, float[] tan) :
// 传入一个距离distance(0<=distance<=getLength()),然后会计算当前距
// 离的坐标点和切线,pos会自动填充上坐标,这个方法很重要。
mPathMeasure.getPosTan(value, mCurrentPosition, null) //mCurrentPosition此时就是中间距离点的坐标值
mPathMeasure.getPosTan(
value,
mCurrentPosition,
null
) //mCurrentPosition此时就是中间距离点的坐标值
// 移动的商品图片(动画图片)的坐标设置为该中间点的坐标
goods.translationX = mCurrentPosition[0]
goods.translationY = mCurrentPosition[1]
......@@ -734,5 +855,11 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
})
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
val coin = data?.extras?.getInt(SongAwardActivity.SONG_REDPACKET, 0) ?: 0
val di = data?.extras?.getInt(SongAwardActivity.SONG_YUANBAO, 0) ?: 0
showRewardAnim(coin, di)
}
}
\ No newline at end of file
......@@ -29,7 +29,7 @@ public class CountDownView extends View {
private int mRetreatType;//圆弧绘制方式(增加和减少)
private float mPaintArcWidth;//最外层圆弧的宽度
private int mCircleRadius;//圆圈的半径
private int mPaintArcColor = Color.parseColor("#3C3F41");//初始值
private int mPaintArcColor = Color.parseColor("#fea54c");//初始值
private int mPaintBackGroundColor = Color.parseColor("#55B2E5");//初始值
private int mLoadingTime;//时间,单位秒
private String mLoadingTimeUnit = "";//时间单位
......
......@@ -46,12 +46,12 @@ class SignDialog(context: Context, listener: DialogListener, signMsg: SignInfoBe
tv_sign_title.text = SpanUtils()
.append("签到7天领")
.setForegroundColor(context.resources.getColor(R.color.apk_uninstalled))
.setForegroundColor(context.resources.getColor(R.color.color_fea54c))
.append(signMsg.sumCash.toString())
.setFontSize(BubbleUtils.sp2px(30))
.setForegroundColor(context.resources.getColor(R.color.red))
.append("元红包")
.setForegroundColor(context.resources.getColor(R.color.apk_uninstalled))
.setForegroundColor(context.resources.getColor(R.color.color_fea54c))
.create()
val cashList = signMsg.signWeekCashArr
......
......@@ -2,6 +2,7 @@ package com.duben.dayplaylet.ui.widgets
import android.app.Dialog
import android.content.Context
import android.text.SpannableStringBuilder
import android.view.Gravity
import android.view.KeyEvent
import android.view.WindowManager
......@@ -12,6 +13,7 @@ import android.widget.TextView
import com.duben.dayplaylet.R
import com.duben.dayplaylet.ad.express.ExpressAdCallback
import com.duben.dayplaylet.ad.express.ExpressManager
import com.duben.dayplaylet.ad.express.MyExpressManager
import com.duben.dayplaylet.utils.UIUtils
/**
......@@ -19,9 +21,7 @@ import com.duben.dayplaylet.utils.UIUtils
*/
class VideoLockDialog(
context: Context,
titleStr: String,
infoStr: String,
btnStr: String,
titleStr: SpannableStringBuilder,
listener: DialogListener
) :
Dialog(context, R.style.dialog) {
......@@ -31,7 +31,6 @@ class VideoLockDialog(
private val ibClose: ImageButton
private val flAd: FrameLayout
private val tvTitle: TextView
private val tvInfo: TextView
private val unlock: Button
init {
......@@ -55,12 +54,9 @@ class VideoLockDialog(
ibClose = findViewById(R.id.ib_close)
flAd = findViewById(R.id.fl_ad)
tvTitle = findViewById(R.id.tv_title)
tvInfo = findViewById(R.id.tv_info)
unlock = findViewById(R.id.unlock)
tvTitle.text = titleStr
tvInfo.text = infoStr
unlock.text = btnStr
ibClose.setOnClickListener { dismiss() }
unlock.setOnClickListener(listener)
......@@ -69,7 +65,7 @@ class VideoLockDialog(
}
private fun showAdView() {
ExpressManager.instance.getAdView(object : ExpressAdCallback {
MyExpressManager.instance.getAdView(object : ExpressAdCallback {
override fun loadSuccess(adView: FrameLayout?) {
adView?.let {
UIUtils.removeFromParent(it)
......
package com.duben.dayplaylet.ui.widgets
import android.app.Dialog
import android.content.Context
import android.view.Gravity
import android.view.KeyEvent
import android.view.View
import android.view.WindowManager
import android.widget.ImageButton
import android.widget.ProgressBar
import android.widget.TextView
import androidx.core.content.ContextCompat
import com.airbnb.lottie.LottieAnimationView
import com.airbnb.lottie.LottieComposition
import com.airbnb.lottie.LottieCompositionFactory
import com.airbnb.lottie.LottieDrawable
import com.duben.dayplaylet.R
import com.duben.dayplaylet.utils.SpanUtils
/**
* 二级页面激励视频
*/
class VideoRewardDialog(
context: Context,
currentCash: Float,
listener: DialogListener
) :
Dialog(context, R.style.dialog) {
private val lp: WindowManager.LayoutParams
private val ibClose: ImageButton
private val ll: View
private val tvInfo: TextView
private val tvStr: TextView
private val pb: ProgressBar
private val lav: LottieAnimationView
init {
setContentView(R.layout.dialog_video_reward)
lp = window!!.attributes
lp.gravity = Gravity.CENTER
lp.width = WindowManager.LayoutParams.MATCH_PARENT
lp.height = WindowManager.LayoutParams.WRAP_CONTENT
lp.windowAnimations = R.style.DialogAnimFade
window!!.attributes = lp
// 设置外部不可关闭
setCancelable(true)
setCanceledOnTouchOutside(true)
setOnKeyListener { _, i, _ ->
i == KeyEvent.KEYCODE_BACK
}
listener.setDialog(this)
ibClose = findViewById(R.id.ib_close)
ll = findViewById(R.id.ll)
tvInfo = findViewById(R.id.tv_progress_info)
tvStr = findViewById(R.id.tv_progress_str)
pb = findViewById(R.id.pb)
lav = findViewById(R.id.lav)
tvInfo.text = SpanUtils()
.append("还差")
.append("${currentCash}元")
.setForegroundColor(ContextCompat.getColor(context, R.color.red))
.append("即可提现")
.append("100元")
.setForegroundColor(ContextCompat.getColor(context, R.color.red))
.create()
pb.max = 100
pb.progress = currentCash.toInt()
tvStr.text = "${currentCash}/100"
ibClose.setOnClickListener { dismiss() }
ll.setOnClickListener(listener)
playFingerAnim(lav)
}
private fun playFingerAnim(view: LottieAnimationView) {
view.visibility = View.VISIBLE
val lottieDrawable = LottieDrawable()
LottieCompositionFactory.fromAsset(context, "home_shouzhi.json")
.addListener { result: LottieComposition? ->
lottieDrawable.setImagesAssetsFolder("home_shouzhi/")
lottieDrawable.composition = result
lottieDrawable.loop(true)
lottieDrawable.playAnimation()
}
view.setImageDrawable(lottieDrawable)
}
}
\ No newline at end of file
......@@ -74,7 +74,7 @@ public class PanelItemView extends FrameLayout implements ItemView {
iv_panel_item_pic.setImageResource(R.mipmap.ic_nine_mobile);
tv_panel_item_text.setTextColor(ContextCompat.getColor(
context,
R.color.apk_uninstalled
R.color.color_fea54c
));
tv_panel_item_text.setTypeface(null, Typeface.BOLD);
break;
......
......@@ -72,7 +72,7 @@ public class PanelItemView2 extends FrameLayout implements ItemView {
iv_panel_item_pic.setImageResource(R.mipmap.ic_nine_mobile);
tv_panel_item_text.setTextColor(ContextCompat.getColor(
context,
R.color.apk_uninstalled
R.color.color_fea54c
));
tv_panel_item_text.setTypeface(null, Typeface.BOLD);
break;
......
......@@ -30,17 +30,16 @@ public class RxBus {
}
return mDefaultInstance;
}
/*发送事件*/
/*发送事件*/
public void post(Object event) {
if (mBus == null) {
mDefaultInstance = new RxBus();
}
mBus.onNext(event);
}
/*订阅事件*/
/*订阅事件*/
public <T> Observable<T> toObservable(Class<T> eventType) {
return mBus.ofType(eventType);//ofType可以根据事件类型发送指定数据
}
......@@ -92,4 +91,20 @@ public class RxBus {
}
}
public static class MsgEvent {
private String msg;
public MsgEvent(String msg) {
this.msg = msg;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import android.app.Dialog
import android.os.Bundle
import android.util.Log
import android.view.View
import androidx.core.content.ContextCompat
import com.bytedance.sdk.dp.*
import com.google.gson.Gson
import com.duben.dayplaylet.R
......@@ -19,10 +20,8 @@ import com.duben.dayplaylet.mvp.presenters.VideoPresenter
import com.duben.dayplaylet.mvp.views.VideoView
import com.duben.dayplaylet.ui.activitys.base.BaseActivity
import com.duben.dayplaylet.ui.adapter.VideoEpisodeAdapter
import com.duben.dayplaylet.ui.widgets.CountDownVideoView
import com.duben.dayplaylet.ui.widgets.DialogListener
import com.duben.dayplaylet.ui.widgets.VideoEpisodeDialog
import com.duben.dayplaylet.ui.widgets.VideoLockDialog
import com.duben.dayplaylet.ui.widgets.*
import com.duben.dayplaylet.utils.SpanUtils
import com.duben.library.utils.nodoubleclick.AntiShake
import kotlinx.android.synthetic.main.drama_activity_api_detail.*
import kotlinx.android.synthetic.main.layout_draw_header.*
......@@ -61,6 +60,7 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
private var mHasUnlockIndexMap = mutableMapOf<Long, MutableList<Int>>()
private var mVideoLockDialog: VideoLockDialog? = null
private var mVideoRewardDialog: VideoRewardDialog? = null
private var lastIndex = 1
......@@ -200,6 +200,9 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
(map?.get("index") as? Int?)?.let {
lastIndex = it
}
if (cdvv.isPlaying) {
cdvv.resume()
}
}
override fun onDPVideoPause(map: MutableMap<String, Any>?) {
......@@ -396,17 +399,32 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
}
override fun rdVedioMsgSuc(surplusCount: Int, surplusSeconds: Int) {
// if (surplusCount > 0) {
// cl_red_box.visibility = View.VISIBLE
// cdvv.setTime(surplusSeconds)
// cdvv.setCountDownVideoListener(this)
// } else {
// cl_red_box.visibility = View.GONE
// }
if (surplusCount > 0) {
cl_red_box.visibility = View.VISIBLE
tv_tips.text = SpanUtils()
.append("点击领取 ")
.append("大额红包")
.setForegroundColor(ContextCompat.getColor(this, R.color.red))
.create()
tv_tips.visibility = View.GONE
triangle.visibility = View.GONE
cdvv.setTime(surplusSeconds)
cdvv.setCountDownVideoListener(this)
} else {
cl_red_box.visibility = View.GONE
}
}
override fun onLoadingFinish() {
override fun reportAddCoinMsgSuc(coin: Int, di: Int) {
}
override fun onLoadingFinish() {
cl_red_box.setOnClickListener {
showRedboxDialog()
}
tv_tips.visibility = View.VISIBLE
triangle.visibility = View.VISIBLE
}
override fun onClick(v: View?) {
......@@ -428,20 +446,41 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
private fun showLockDialog(drama: DPDrama, widget: IDPWidget) {
mVideoLockDialog = VideoLockDialog(
this,
String.format(
"解锁%s·第%d-%d集",
drama.title,
mInitUnlockIndex + 1,
mInitUnlockIndex + lockSet
),
String.format("看激励视频解锁%d集剧情\n请按照顺序解锁", lockSet),
"观看激励视频",
SpanUtils()
.append("解锁")
.append(" $lockSet ")
.setForegroundColor(ContextCompat.getColor(this, R.color.red))
.append("集剧情")
.create(),
object : DialogListener() {
override fun onClick(dialog: Dialog?, v: View?) {
super.onClick(dialog, v)
dialog?.dismiss()
showAd(Constant.CARRIERTYPE_VEDIO_UNLOCK, drama, widget)
}
}
)
mVideoLockDialog?.show()
}
private fun showRedboxDialog() {
mVideoRewardDialog = VideoRewardDialog(
this,
30f,
object : DialogListener() {
override fun onClick(dialog: Dialog?, v: View?) {
super.onClick(dialog, v)
dialog?.dismiss()
showAd(Constant.CARRIERTYPE_VEDIO)
}
}
)
val carrierType = Constant.CARRIERTYPE_CSJ_VEDIO
mVideoRewardDialog?.show()
}
private fun showAd(carrierType: String, drama: DPDrama? = null, widget: IDPWidget? = null) {
AdManager.instance.showAd(this@DramaApiDetailActivity, carrierType,
object : AdStatusListener {
var canFail = false
......@@ -451,49 +490,54 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
override fun adFail() {
if (canFail) return
showLoading("正在获取视频", false)
NoPreAdManager.loadVideoAd(
this@DramaApiDetailActivity,
carrierType, object : AdStatusListener {
override fun adFail() {
hideLoading()
showToast("广告太火爆了,请稍候再试")
}
override fun adSuccess() {
hideLoading()
}
override fun adClose(vo: HashMap<String, Any>?) {
vo?.let {
if (isThirdId) {
it["thirdId"] = "" + mVedioBean!!.thirdId
} else {
it["vedioId"] = "" + mVedioBean!!.vedioId
hideLoading()
when (carrierType) {
Constant.CARRIERTYPE_VEDIO_UNLOCK -> {
if (drama != null && widget != null) {
unlock(vo, drama, widget)
}
videoPresenter.unlock(it)
}
Constant.CARRIERTYPE_VEDIO -> {
// 更新解锁集数
for (i in 1 until lockSet) {
val hasUnlockList: MutableList<Int> =
mHasUnlockIndexMap[drama.id] ?: mutableListOf()
hasUnlockList.add(widget.currentDramaIndex + i)
mHasUnlockIndexMap[drama.id] = hasUnlockList
}
mInitUnlockIndex = mUnlockIndexMap[drama.id]!! + lockSet
mUnlockIndexMap[drama.id] =
mUnlockIndexMap[drama.id]!! + lockSet
mVedioBean!!.unlockIndex = mInitUnlockIndex
// 播放当前集
mVedioBean!!.seeIndex = mCurrentIndex
mVedioBean!!.orderTags = orderTagsList
LocalVedioManager.commitVedio(mVedioBean!!)
unlockCallback?.onDramaRewardArrived() // 解锁当前集
else -> {}
}
}
})
}
override fun adClose(vo: HashMap<String, Any>?) {
when (carrierType) {
Constant.CARRIERTYPE_VEDIO_UNLOCK -> {
if (drama != null && widget != null) {
unlock(vo, drama, widget)
}
}
Constant.CARRIERTYPE_VEDIO -> {
}
else -> {}
}
}
})
}
private fun unlock(vo: HashMap<String, Any>?, drama: DPDrama, widget: IDPWidget) {
vo?.let {
if (isThirdId) {
it["thirdId"] = "" + mVedioBean!!.thirdId
......@@ -511,7 +555,8 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
mHasUnlockIndexMap[drama.id] = hasUnlockList
}
mInitUnlockIndex = mUnlockIndexMap[drama.id]!! + lockSet
mUnlockIndexMap[drama.id] = mUnlockIndexMap[drama.id]!! + lockSet
mUnlockIndexMap[drama.id] =
mUnlockIndexMap[drama.id]!! + lockSet
mVedioBean!!.unlockIndex = mInitUnlockIndex
// 播放当前集
......@@ -520,11 +565,4 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
LocalVedioManager.commitVedio(mVedioBean!!)
unlockCallback?.onDramaRewardArrived() // 解锁当前集
}
})
}
}
)
mVideoLockDialog?.show()
}
}
\ No newline at end of file
......@@ -200,6 +200,10 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
}
override fun reportAddCoinMsgSuc(coin: Int, di: Int) {
}
override fun onEpisodeClick(position: Int) {
dialog?.dismiss()
val data = super_short_video_view.data
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- solid指定形状的填充色,只有android:color一个属性 -->
<solid android:color="@color/color_fea54c" />
<!-- padding设置内容区域离边界的间距 -->
<!-- corners设置圆角,只适用于rectangle -->
<corners android:radius="30dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- solid指定形状的填充色,只有android:color一个属性 -->
<solid android:color="#F13D3D" />
<!-- padding设置内容区域离边界的间距 -->
<!-- corners设置圆角,只适用于rectangle -->
<corners android:radius="30dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!--3个层的顺序即为显示时的叠加顺序-->
<!--背景色-->
<item android:id="@android:id/background">
<shape>
<corners android:radius="5dip" />
<corners android:radius="30dp" />
<solid android:color="#FFE9E9" />
</shape>
</item>
<!--一级进度条的颜色,也可以直接替换成图片-->
<item android:id="@android:id/secondaryProgress">
<scale android:scaleWidth="100%">
<shape>
<corners android:radius="30dp" />
<solid android:color="#F13D3D" />
</shape>
</scale>
</item>
<item android:id="@android:id/progress">
<!--
<clip>
<shape>
<corners android:radius="5dip" />
<solid android:color="#F13D3D" />
<corners android:topRightRadius="20dp"
android:bottomRightRadius="20dp"/>
<solid android:color="#FF009898"/>
</shape>
</clip>
-->
<scale
android:drawable="@drawable/progress_bar_ct2"
android:scaleWidth="100%" />
</item>
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
<shape>
<corners android:radius="30dp" />
<solid android:color="#FFE9E9" />
</shape>
</item>
<item android:id="@android:id/secondaryProgress">
<scale android:scaleWidth="100%">
<shape>
<corners android:radius="30dp" />
<solid android:color="@color/color_fea54c" />
</shape>
</scale>
</item>
<item android:id="@android:id/progress">
<!--
<clip>
<shape>
<corners android:topRightRadius="20dp"
android:bottomRightRadius="20dp"/>
<solid android:color="#FF009898"/>
</shape>
</clip>
-->
<scale
android:drawable="@drawable/progress_bar_ct"
android:scaleWidth="100%" />
</item>
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 正三角 -->
<item>
<rotate
android:fromDegrees="45"
android:pivotX="135%"
android:pivotY="15%">
<shape android:shape="rectangle">
<size
android:width="16dp"
android:height="16dp" />
<solid android:color="#FFF" />
</shape>
</rotate>
</item>
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<!-- 弧形的半径 -->
<corners android:radius="30dip" />
<stroke
android:width="1dp"
android:color="@color/white" />
<solid android:color="@color/color_fea54c" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#99000000"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@mipmap/bg_task"
android:orientation="vertical">
<ImageView
android:id="@+id/iv_award_quit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:src="@mipmap/ic_draw_quit" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="150dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="110dp"
android:layout_marginRight="20dp"
android:background="@drawable/shape_bg_task"
android:orientation="horizontal"
android:paddingLeft="20dp"
android:paddingRight="20dp">
<LinearLayout
android:id="@+id/ll_award_redpkg"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|center_vertical"
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="10dp"
android:paddingTop="16dp"
android:paddingRight="10dp"
android:paddingBottom="6dp">
<ImageView
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_gravity="center_horizontal"
android:src="@mipmap/ic_redpkg" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_award_redpkg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="18dp"
android:background="@drawable/shape_banner_write"
android:gravity="center"
android:paddingLeft="18dp"
android:paddingTop="3dp"
android:paddingRight="18dp"
android:paddingBottom="3dp"
android:text="+10"
android:textColor="@color/red"
android:textSize="18sp" />
</FrameLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_award_yuanbao"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|center_vertical"
android:layout_weight="1"
android:orientation="vertical"
android:paddingLeft="10dp"
android:paddingTop="16dp"
android:paddingRight="10dp"
android:paddingBottom="6dp">
<ImageView
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_gravity="center_horizontal"
android:src="@mipmap/ic_yuanbao" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_award_yuanbao"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="18dp"
android:background="@drawable/shape_banner_write"
android:gravity="center"
android:paddingLeft="18dp"
android:paddingTop="3dp"
android:paddingRight="18dp"
android:paddingBottom="3dp"
android:text="+10"
android:textColor="@color/red"
android:textSize="18sp" />
</FrameLayout>
</LinearLayout>
</LinearLayout>
<Button
android:id="@+id/iv_song_award"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="26dp"
android:background="@mipmap/img_reward_play_button_bg"
android:text="开心收下"
android:textSize="18sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/block_view"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageButton
android:id="@+id/ib_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@id/ll"
android:layout_alignParentEnd="true"
android:layout_marginEnd="30dp"
android:background="@mipmap/ic_close_circle" />
<LinearLayout
android:id="@+id/ll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="30dp"
android:layout_marginEnd="30dp"
android:background="@drawable/shape_bg_write"
android:gravity="center"
android:background="@mipmap/bg_unlock"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageButton
android:id="@+id/ib_close"
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginEnd="@dimen/dp_10"
android:background="@mipmap/ic_close" />
android:layout_marginTop="140dp"
android:layout_marginBottom="20dp"
android:textColor="@color/black"
android:textSize="20sp"
android:textStyle="bold" />
<com.duben.dayplaylet.ui.widgets.RoundRectLayout
android:id="@+id/fl_ad"
android:layout_width="match_parent"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_bg_write" />
android:layout_marginBottom="20dp">
<ImageView
android:id="@+id/iv_tips"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_withdraw_tip"
app:layout_constraintEnd_toEndOf="@id/tv_info2"
app:layout_constraintStart_toStartOf="@id/tv_info2"
app:layout_constraintTop_toBottomOf="@id/tv_info2"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_title"
android:id="@+id/tv_info1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:text="试看已结束"
android:textColor="@color/black"
android:textSize="16sp"
android:textStyle="bold" />
android:text="并领取最高"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="@+id/tv_info"
android:id="@+id/tv_info2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:gravity="center"
android:text="试看已结束" />
android:text=" 10 "
android:textColor="@color/red"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/tv_info3"
app:layout_constraintStart_toEndOf="@id/tv_info1"
app:layout_constraintTop_toBottomOf="@id/iv_tips" />
<TextView
android:id="@+id/tv_info3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="元红包"
android:textSize="18sp"
app:constraintSet="@id/tv_info2"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/tv_info2" />
</androidx.constraintlayout.widget.ConstraintLayout>
<Button
android:id="@+id/unlock"
android:layout_width="230dp"
android:layout_height="40dp"
android:layout_marginBottom="10dp"
android:background="@mipmap/bg_detail_top"
android:paddingStart="30dp"
android:text="看广告解锁1集"
android:layout_width="243dp"
android:layout_height="48dp"
android:background="@mipmap/ic_btn_unlock"
android:textColor="@color/white" />
</LinearLayout>
</FrameLayout>
<com.duben.dayplaylet.ui.widgets.RoundRectLayout
android:id="@+id/fl_ad"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/ll"
android:layout_marginStart="30dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="@dimen/font_size_30"
android:background="@drawable/shape_bg_write" />
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/block_view"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageButton
android:id="@+id/ib_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="@id/ll"
android:background="@mipmap/ic_close_circle" />
<RelativeLayout
android:id="@+id/ll"
android:layout_width="280dp"
android:layout_height="344dp"
android:layout_below="@id/ib_close"
android:layout_centerHorizontal="true"
android:background="@mipmap/bg_circle_red">
<ImageView
android:id="@+id/iv_logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp"
android:src="@mipmap/ic_launcher_main" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/iv_logo"
android:layout_centerHorizontal="true"
android:layout_marginBottom="20dp">
<TextView
android:id="@+id/tv_info1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="10"
android:textColor="@color/color_FFFC9F"
android:textSize="70sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="@+id/tv_info2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="18dp"
android:text="元"
android:textColor="@color/color_FFFC9F"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/tv_info1" />
<TextView
android:id="@+id/tv_info3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="18sp"
android:text="最高"
android:textColor="@color/btn_enabled"
android:textSize="16sp"
app:layout_constraintStart_toEndOf="@id/tv_info1"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@id/unlock"
android:layout_centerHorizontal="true"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_half_trans"
android:paddingStart="16dp"
android:paddingTop="2dp"
android:paddingEnd="16dp"
android:paddingBottom="2dp"
android:text="领取追剧奖励"
android:textColor="@color/color_FFFC9F" />
<Button
android:id="@+id/unlock"
android:layout_width="96dp"
android:layout_height="96dp"
android:layout_above="@id/tv_bottom"
android:layout_centerHorizontal="true"
android:layout_marginBottom="6dp"
android:background="@mipmap/btn_open_red" />
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/lav"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_alignEnd="@id/unlock"
android:layout_alignBottom="@id/unlock"
android:layout_marginEnd="-20dp"
android:layout_marginBottom="-20dp" />
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignBottom="@id/unlock"
android:layout_centerHorizontal="true"
android:layout_marginBottom="6dp"
android:src="@mipmap/ic_envelope_video" />
<TextView
android:id="@+id/tv_bottom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="15dp"
android:text="看的越多,赚的越多"
android:textColor="@color/color_FFFC9F" />
</RelativeLayout>
<RelativeLayout
android:layout_width="290dp"
android:layout_height="80dp"
android:layout_below="@id/ll"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:background="@drawable/shape_banner_write"
android:padding="@dimen/dp_10">
<TextView
android:id="@+id/tv_progress_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:textColor="@color/black"
android:textSize="16sp" />
<ProgressBar
android:id="@+id/pb"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="20dp"
android:layout_alignParentBottom="true"
android:layout_marginEnd="36dp"
android:layout_marginBottom="2dp"
android:max="100"
android:progress="50"
android:progressDrawable="@drawable/progressbar_versus_vedio_bg" />
<TextView
android:id="@+id/tv_progress_str"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="@id/pb"
android:layout_alignTop="@id/pb"
android:layout_alignEnd="@id/pb"
android:gravity="center"
android:text="10/100"
android:textColor="@color/white"
android:textSize="16sp" />
<ImageView
android:layout_width="51dp"
android:layout_height="60dp"
android:layout_alignParentEnd="true"
android:src="@mipmap/ic_redpkg" />
</RelativeLayout>
</RelativeLayout>
......@@ -52,7 +52,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="立即清理"
android:textColor="@color/apk_uninstalled"
android:textColor="@color/color_fea54c"
android:textSize="18sp" />
</LinearLayout>
......
......@@ -9,15 +9,29 @@
android:id="@+id/tv_tips"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/shape_tips"
android:elevation="2dp"
android:padding="5dp"
android:text="点击红包可以领取金币哦~"
android:textColor="@color/white"
android:textSize="14sp"
android:visibility="gone"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_bg_write"
android:gravity="center"
android:paddingStart="4dp"
android:paddingTop="2dp"
android:paddingEnd="4dp"
android:paddingBottom="2dp"
android:text="-"
android:textColor="@color/black"
android:textSize="12sp"
android:visibility="visible"
app:layout_constraintBottom_toTopOf="@+id/linearLayout"
app:layout_constraintEnd_toStartOf="@+id/linearLayout" />
app:layout_constraintStart_toStartOf="@+id/linearLayout" />
<View
android:id="@+id/triangle"
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_marginStart="16dp"
android:background="@drawable/shape_triangle"
android:visibility="gone"
app:layout_constraintStart_toStartOf="@id/tv_tips"
app:layout_constraintTop_toBottomOf="@id/tv_tips" />
<LinearLayout
android:id="@+id/linearLayout"
......@@ -39,6 +53,17 @@
android:id="@+id/cdvv"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_width="42dp"
android:layout_height="18dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="-6dp"
android:background="@drawable/shape_tv_video"
android:gravity="center"
android:text="+20元"
android:textColor="@color/white"
android:textSize="10sp" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -11,11 +11,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="4dp"
app:cd_animator_time="8"
app:cd_arc_color="@color/color_FF9837"
app:cd_arc_color="@color/color_fea54c"
app:cd_arc_width="3dp"
app:cd_bg_color="#20FF9837"
app:cd_bg_color="@color/white"
app:cd_circle_radius="25dp"
app:cd_location="top"
app:cd_retreat_type="forward"
......@@ -27,6 +26,6 @@
android:layout_width="28dp"
android:layout_height="32dp"
android:layout_gravity="center"
android:src="@mipmap/ic_launcher_main"
android:src="@mipmap/withdraw_wx"
tools:visibility="gone" />
</FrameLayout>
......@@ -24,10 +24,8 @@
<color name="color_F61F03">#FD563B</color>
<color name="apk_uninstalled">#fea54c</color>
<color name="color_fea54c">#fea54c</color>
<color name="color_FFFC9F">#FFFC9F</color>
<color name="color_8D8F90">#7F8182</color>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment