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 @@ ...@@ -163,6 +163,11 @@
android:hardwareAccelerated="true" android:hardwareAccelerated="true"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<activity
android:name=".ui.activitys.SongAwardActivity"
android:exported="false"
android:screenOrientation="portrait" />
<service <service
android:name=".ui.service.UpdateService" android:name=".ui.service.UpdateService"
android:exported="true" /> android:exported="true" />
......
...@@ -20,7 +20,6 @@ object Constant { ...@@ -20,7 +20,6 @@ object Constant {
const val ACTION_EXIT_APP = "package.exit" const val ACTION_EXIT_APP = "package.exit"
const val CARRIERTYPE_CSJ_VEDIO = "VEDIO_UNLOCK"
const val CARRIERTYPE_TX_VEDIO = "VEDIO_UNLOCK" const val CARRIERTYPE_TX_VEDIO = "VEDIO_UNLOCK"
const val CARRIERTYPE_REWARD_FIRST = "REWARD_FIRST" //新人红包视频 const val CARRIERTYPE_REWARD_FIRST = "REWARD_FIRST" //新人红包视频
const val CARRIERTYPE_SIGN = "FORCASH_SIGN" //签到 const val CARRIERTYPE_SIGN = "FORCASH_SIGN" //签到
...@@ -33,6 +32,8 @@ object Constant { ...@@ -33,6 +32,8 @@ object Constant {
const val CARRIERTYPE_SONG_MORE = "REWARD_GUESS_SONG_MORE" //翻倍 的入参 const val CARRIERTYPE_SONG_MORE = "REWARD_GUESS_SONG_MORE" //翻倍 的入参
const val CARRIERTYPE_SONG_ALL = "REWARD_GUESS_SONG_ALL" //画着红包直接看视频的入参 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_ONE = 0
const val FRAGMENT_CLICK_TWO = 1 const val FRAGMENT_CLICK_TWO = 1
......
...@@ -69,7 +69,10 @@ class MusicPresenter : BasePresenter<MusicView>() { ...@@ -69,7 +69,10 @@ class MusicPresenter : BasePresenter<MusicView>() {
when (code) { when (code) {
200 -> { 200 -> {
view.reportAddCoinMsgSuc() val data = baseResponse.data
if (data != null) {
view.reportAddCoinMsgSuc(data["coin"].asInt, data["di"].asInt)
}
} }
else -> { else -> {
view.showToast(message) view.showToast(message)
......
...@@ -132,4 +132,42 @@ class VideoPresenter : BasePresenter<VideoView>() { ...@@ -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 ...@@ -5,5 +5,5 @@ import com.duben.dayplaylet.mvp.model.MusicBean
interface MusicView : BaseView { interface MusicView : BaseView {
fun rdSongMsgSuc(data: MusicBean) fun rdSongMsgSuc(data: MusicBean)
fun rdSongMsgFail() 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 ...@@ -3,7 +3,6 @@ package com.duben.dayplaylet.mvp.views
import com.duben.dayplaylet.mvp.model.IndexList import com.duben.dayplaylet.mvp.model.IndexList
import com.duben.dayplaylet.mvp.model.NineShowBean import com.duben.dayplaylet.mvp.model.NineShowBean
interface VideoView : BaseView { interface VideoView : BaseView {
fun getIndexListSuc(indexList: IndexList) fun getIndexListSuc(indexList: IndexList)
fun getIndexListFail() fun getIndexListFail()
...@@ -13,4 +12,6 @@ interface VideoView : BaseView { ...@@ -13,4 +12,6 @@ interface VideoView : BaseView {
fun rdVedioMsgSuc(surplusCount: Int, surplusSeconds: Int) 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 ...@@ -2,8 +2,10 @@ package com.duben.dayplaylet.ui.fragment
import android.animation.Animator import android.animation.Animator
import android.animation.ValueAnimator import android.animation.ValueAnimator
import android.content.Intent
import android.graphics.Path import android.graphics.Path
import android.graphics.PathMeasure import android.graphics.PathMeasure
import android.os.Bundle
import android.os.Handler import android.os.Handler
import android.os.Looper import android.os.Looper
import android.view.LayoutInflater import android.view.LayoutInflater
...@@ -35,11 +37,16 @@ import com.duben.dayplaylet.manager.DPHolder ...@@ -35,11 +37,16 @@ import com.duben.dayplaylet.manager.DPHolder
import com.duben.dayplaylet.mvp.model.MusicBean import com.duben.dayplaylet.mvp.model.MusicBean
import com.duben.dayplaylet.mvp.presenters.MusicPresenter import com.duben.dayplaylet.mvp.presenters.MusicPresenter
import com.duben.dayplaylet.mvp.views.MusicView 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.fragment.base.LazyLoadBaseFragment
import com.duben.dayplaylet.ui.widgets.countdowntimer.CountDownTimerSupport import com.duben.dayplaylet.ui.widgets.countdowntimer.CountDownTimerSupport
import com.duben.dayplaylet.ui.widgets.countdowntimer.OnCountDownTimerListener import com.duben.dayplaylet.ui.widgets.countdowntimer.OnCountDownTimerListener
import com.duben.dayplaylet.utils.LogUtil 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 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.fragment_music.*
import kotlinx.android.synthetic.main.layout_draw_header.* import kotlinx.android.synthetic.main.layout_draw_header.*
...@@ -48,7 +55,11 @@ import kotlinx.android.synthetic.main.layout_draw_header.* ...@@ -48,7 +55,11 @@ import kotlinx.android.synthetic.main.layout_draw_header.*
*/ */
class MusicFragment : LazyLoadBaseFragment(), MusicView { 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() } private val musicPresenter by lazy { MusicPresenter() }
...@@ -121,316 +132,378 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView { ...@@ -121,316 +132,378 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
private fun initDrawWidget() { private fun initDrawWidget() {
mIDPWidget = mIDPWidget =
DPHolder.getInstance() DPHolder.getInstance()
.buildDrawWidget(DPWidgetDrawParams.obtain().liveAdCodeId("947474066") .buildDrawWidget(
.liveNativeAdCodeId("947474068") DPWidgetDrawParams.obtain().liveAdCodeId("947474066")
.adOffset(0) //单位 dp,为 0 时可以不设置 .liveNativeAdCodeId("947474068")
.quizMode(1) .adOffset(0) //单位 dp,为 0 时可以不设置
.hideClose(true, null) .quizMode(1)
.listener(object : IDPDrawListener() { .hideClose(true, null)
override fun onDPRefreshFinish() { .listener(object : IDPDrawListener() {
LogUtil.d(TAG, "onDPRefreshFinish") override fun onDPRefreshFinish() {
} LogUtil.d(TAG, "onDPRefreshFinish")
override fun onDPPageChange(position: Int) {
LogUtil.d(TAG, "onDPPageChange: $position")
}
override fun onDPPageChange(position: Int, map: Map<String, Any>) {
if (map == null) {
return
} }
mPos = position
LogUtil.d(TAG, "onDPPageChange: $position, map = $map")
}
override fun onCreateQuizView(container: ViewGroup): View {
val quizView: View = LayoutInflater.from(container.context)
.inflate(R.layout.media_layout_quiz, container, false)
LogUtil.d(TAG, "onCreateQuizView")
return quizView
}
override fun onQuizBindData(
view: View,
options: List<String>,
answer: Int,
lastAnswer: Int,
quizHandler: IDPQuizHandler,
feedParamsForCallback: Map<String, Any>
) {
super.onQuizBindData(
view,
options,
answer,
lastAnswer,
quizHandler,
feedParamsForCallback
)
val quizLLPop = view.findViewById<LinearLayout>(R.id.quiz_ll_pop) override fun onDPPageChange(position: Int) {
val quizTvPop = view.findViewById<TextView>(R.id.quiz_tv_pop) LogUtil.d(TAG, "onDPPageChange: $position")
}
val finger = view.findViewById<LottieAnimationView>(R.id.finger_view)
val rlOption0 = view.findViewById<RelativeLayout>(R.id.rl_option0) override fun onDPPageChange(position: Int, map: Map<String, Any>) {
val rlOption1 = view.findViewById<RelativeLayout>(R.id.rl_option1) if (map == null) {
val quizIvRedbox0 = view.findViewById<ImageView>(R.id.quiz_iv_redbox0) return
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)
val optionsList: MutableList<RelativeLayout> = ArrayList()
optionsList.add(rlOption0)
optionsList.add(rlOption1)
quizIvOption0.visibility = View.GONE
quizIvOption1.visibility = View.GONE
quizIvRedbox0.visibility = View.GONE
quizIvRedbox1.visibility = View.GONE
quizLLPop.visibility = View.GONE
quizTvPop.visibility = View.GONE
finger.visibility = View.GONE
mainHandler.postDelayed({
// 点击过后不展示
if (!rlOption0.isClickable) return@postDelayed
val ls = finger.layoutParams as RelativeLayout.LayoutParams
val ls2 = quizLLPop.layoutParams as RelativeLayout.LayoutParams
if (answer == 0) {
ls.addRule(RelativeLayout.ALIGN_TOP, R.id.rl_option0)
ls2.addRule(RelativeLayout.ALIGN_TOP, R.id.rl_option0)
} else {
ls.addRule(RelativeLayout.ALIGN_TOP, R.id.rl_option1)
ls2.addRule(RelativeLayout.ALIGN_TOP, R.id.rl_option1)
}
playFingerAnim(finger)
}, 5000)
for (i in optionsList.indices) {
val right = answer == i
var background: Int
var background2: Int
if (right) {
mMusicBean?.let {
if (it.nextIsAd) {
if (i == 0) {
quizIvRedbox0.visibility = View.VISIBLE
} else {
quizIvRedbox1.visibility = View.VISIBLE
}
}
}
background = R.drawable.icon_quiz_button_right_bg
background2 = R.drawable.icon_quiz_right
} else {
background = R.drawable.icon_quiz_button_error_bg
background2 = R.drawable.icon_quiz_error
}
val button = optionsList[i]
if (i == 0) {
option0.text = options[i]
} else {
option1.text = options[i]
} }
button.setOnClickListener {
quizIvRedbox0.visibility = View.GONE
quizIvRedbox1.visibility = View.GONE
finger.visibility = View.GONE
rlOption0.isClickable = false
rlOption1.isClickable = false
if (lastAnswer != -1) return@setOnClickListener RxBus.getDefault().post(MsgEvent("BUS_CHANGE_PAGE"))
quizIv.visibility = View.VISIBLE mPos = position
LogUtil.d(TAG, "onDPPageChange: $position, map = $map")
}
override fun onCreateQuizView(container: ViewGroup): View {
val quizView: View = LayoutInflater.from(container.context)
.inflate(R.layout.media_layout_quiz, container, false)
LogUtil.d(TAG, "onCreateQuizView")
return quizView
}
override fun onQuizBindData(
view: View,
options: List<String>,
answer: Int,
lastAnswer: Int,
quizHandler: IDPQuizHandler,
feedParamsForCallback: Map<String, Any>
) {
super.onQuizBindData(
view,
options,
answer,
lastAnswer,
quizHandler,
feedParamsForCallback
)
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 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 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)
val optionsList: MutableList<RelativeLayout> = ArrayList()
optionsList.add(rlOption0)
optionsList.add(rlOption1)
quizIvOption0.visibility = View.GONE
quizIvOption1.visibility = View.GONE
quizIvRedbox0.visibility = View.GONE
quizIvRedbox1.visibility = View.GONE
quizLLPop.visibility = View.GONE
quizTvPop.visibility = View.GONE
finger.visibility = View.GONE
mainHandler.postDelayed({
// 点击过后不展示
if (!rlOption0.isClickable) return@postDelayed
val ls = finger.layoutParams as RelativeLayout.LayoutParams
val ls2 = quizLLPop.layoutParams as RelativeLayout.LayoutParams
if (answer == 0) {
ls.addRule(RelativeLayout.ALIGN_TOP, R.id.rl_option0)
ls2.addRule(RelativeLayout.ALIGN_TOP, R.id.rl_option0)
} else {
ls.addRule(RelativeLayout.ALIGN_TOP, R.id.rl_option1)
ls2.addRule(RelativeLayout.ALIGN_TOP, R.id.rl_option1)
}
playFingerAnim(finger)
}, 5000)
for (i in optionsList.indices) {
val right = answer == i
var background: Int
var background2: Int
if (right) { if (right) {
quizIv.setBackgroundResource(R.drawable.icon_quiz_right_toast_bg) mMusicBean?.let {
if (it.nextIsAd) {
if (i == 0) {
quizIvRedbox0.visibility = View.VISIBLE
} else {
quizIvRedbox1.visibility = View.VISIBLE
}
}
}
background = R.drawable.icon_quiz_button_right_bg
background2 = R.drawable.icon_quiz_right
} else { } else {
quizIv.setBackgroundResource(R.drawable.icon_quiz_error_toast_bg) background = R.drawable.icon_quiz_button_error_bg
background2 = R.drawable.icon_quiz_error
} }
val button = optionsList[i]
if (i == 0) { if (i == 0) {
// 答案1 option0.text = options[i]
quizIvOption0.visibility = View.VISIBLE
quizIvOption0.setBackgroundResource(background2)
} else { } else {
// 答案2 option1.text = options[i]
quizIvOption1.visibility = View.VISIBLE
quizIvOption1.setBackgroundResource(background2)
} }
button.setBackgroundResource(background) button.setOnClickListener {
quizIvRedbox0.visibility = View.GONE
quizIvRedbox1.visibility = View.GONE
finger.visibility = View.GONE
rlOption0.isClickable = false
rlOption1.isClickable = false
quizHandler.reportResult(i) if (lastAnswer != -1) return@setOnClickListener
mMusicBean?.let { quizIv.visibility = View.VISIBLE
if (right) { if (right) {
if (it.nextIsAd) { quizIv.setBackgroundResource(R.drawable.icon_quiz_right_toast_bg)
awardVideo(Constant.CARRIERTYPE_SONG_ALL) } else {
} else { quizIv.setBackgroundResource(R.drawable.icon_quiz_error_toast_bg)
musicPresenter.reportAddCoinMsg(Constant.CARRIERTYPE_SONG_CLICK) }
button.setBackgroundResource(R.drawable.icon_quiz_button_bg)
quizTvPop.visibility = View.VISIBLE if (i == 0) {
quizLLPop.visibility = View.VISIBLE // 答案1
showAdPop(quizLLPop, quizTvPop, finger) quizIvOption0.visibility = View.VISIBLE
quizIvOption0.setBackgroundResource(background2)
} else {
// 答案2
quizIvOption1.visibility = View.VISIBLE
quizIvOption1.setBackgroundResource(background2)
}
button.setBackgroundResource(background)
quizHandler.reportResult(i)
mMusicBean?.let {
if (right) {
if (it.nextIsAd) {
awardVideo(Constant.CARRIERTYPE_SONG_ALL)
} else {
mCarrierType = Constant.CARRIERTYPE_SONG_CLICK
musicPresenter.reportAddCoinMsg(Constant.CARRIERTYPE_SONG_CLICK)
quizTvPop.visibility = View.VISIBLE
quizLLPop.visibility = View.VISIBLE
showAdPop(quizLLPop, quizTvPop, finger)
}
} }
} }
mainHandler.postDelayed({
quizIv.visibility = View.GONE
}, 1000)
}
if (lastAnswer == i) {
rlOption0.isClickable = false
rlOption1.isClickable = false
if (lastAnswer == 0) {
quizIvOption0.visibility = View.VISIBLE
quizIvOption0.setBackgroundResource(background2)
} else {
quizIvOption1.visibility = View.VISIBLE
quizIvOption1.setBackgroundResource(background2)
}
quizIvRedbox0.visibility = View.GONE
quizIvRedbox1.visibility = View.GONE
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>) {
LogUtil.d(TAG, "onDPVideoPlay map = $map")
}
override fun onDPVideoOver(map: Map<String, Any>) {
LogUtil.d(TAG, "onDPVideoOver map = $map")
}
override fun onDPVideoCompletion(map: Map<String, Any>) {
LogUtil.d(TAG, "onDPVideoCompletion map = $map")
}
override fun onDPClose() {
LogUtil.d(TAG, "onDPClose")
}
override fun onDPReportResult(isSucceed: Boolean) {
LogUtil.d(
TAG,
"onDPReportResult isSucceed = $isSucceed"
)
}
mainHandler.postDelayed({ override fun onDPPageStateChanged(pageState: DPPageState) {
quizIv.visibility = View.GONE LogUtil.d(
}, 1000) TAG,
"onDPPageStateChanged pageState = $pageState"
)
}
override fun onDPReportResult(
isSucceed: Boolean,
map: Map<String, Any>
) {
LogUtil.d(
TAG,
"onDPReportResult isSucceed = $isSucceed, map = $map"
)
}
override fun onDPRequestStart(@Nullable map: Map<String, Any>?) {
LogUtil.d(TAG, "onDPRequestStart")
}
override fun onDPRequestSuccess(list: List<Map<String, Any>>) {
if (list == null) {
return
} }
if (lastAnswer == i) { for (i in list.indices) {
rlOption0.isClickable = false LogUtil.d(
rlOption1.isClickable = false TAG,
if (lastAnswer == 0) { "onDPRequestSuccess i=$i,map=${list[i]}"
quizIvOption0.visibility = View.VISIBLE )
quizIvOption0.setBackgroundResource(background2)
} else {
quizIvOption1.visibility = View.VISIBLE
quizIvOption1.setBackgroundResource(background2)
}
quizIvRedbox0.visibility = View.GONE
quizIvRedbox1.visibility = View.GONE
button.setBackgroundResource(background)
} }
} }
}
override fun onDPVideoPlay(map: Map<String, Any>) {
LogUtil.d(TAG, "onDPVideoPlay map = $map")
}
override fun onDPVideoOver(map: Map<String, Any>) {
LogUtil.d(TAG, "onDPVideoOver map = $map")
}
override fun onDPVideoCompletion(map: Map<String, Any>) {
LogUtil.d(TAG, "onDPVideoCompletion map = $map")
}
override fun onDPClose() {
LogUtil.d(TAG, "onDPClose")
}
override fun onDPReportResult(isSucceed: Boolean) {
LogUtil.d(TAG, "onDPReportResult isSucceed = $isSucceed")
}
override fun onDPPageStateChanged(pageState: DPPageState) {
LogUtil.d(TAG, "onDPPageStateChanged pageState = $pageState")
}
override fun onDPReportResult(
isSucceed: Boolean,
map: Map<String, Any>
) {
LogUtil.d(
TAG,
"onDPReportResult isSucceed = $isSucceed, map = $map"
)
}
override fun onDPRequestStart(@Nullable map: Map<String, Any>?) { override fun onDPRequestFail(
LogUtil.d(TAG, "onDPRequestStart") code: Int,
} msg: String,
@Nullable map: Map<String, Any>?
) {
if (map == null) {
LogUtil.d(
TAG,
"onDPRequestFail code = $code, msg = $msg"
)
return
}
LogUtil.d(
TAG,
"onDPRequestFail code = $code, msg = $msg, map = $map"
)
}
override fun onDPRequestSuccess(list: List<Map<String, Any>>) { override fun onDPClickAuthorName(map: Map<String, Any>) {
if (list == null) { LogUtil.d(TAG, "onDPClickAuthorName map = $map")
return
} }
for (i in list.indices) {
LogUtil.d(TAG, "onDPRequestSuccess i=$i,map=${list[i]}") override fun onDPClickAvatar(map: Map<String, Any>) {
LogUtil.d(TAG, "onDPClickAvatar map = $map")
} }
}
override fun onDPClickComment(map: Map<String, Any>) {
override fun onDPRequestFail( LogUtil.d(TAG, "onDPClickComment map = $map")
code: Int,
msg: String,
@Nullable map: Map<String, Any>?
) {
if (map == null) {
LogUtil.d(TAG, "onDPRequestFail code = $code, msg = $msg")
return
} }
LogUtil.d(
TAG, override fun onDPClickLike(
"onDPRequestFail code = $code, msg = $msg, map = $map" isLike: Boolean,
) map: Map<String, Any>
} ) {
LogUtil.d(
override fun onDPClickAuthorName(map: Map<String, Any>) { TAG,
LogUtil.d(TAG, "onDPClickAuthorName map = $map") "onDPClickLike isLike = $isLike, map = $map"
} )
}
override fun onDPClickAvatar(map: Map<String, Any>) {
LogUtil.d(TAG, "onDPClickAvatar map = $map") override fun onDPVideoPause(map: Map<String, Any>) {
} LogUtil.d(TAG, "onDPVideoPause map = $map")
}
override fun onDPClickComment(map: Map<String, Any>) {
LogUtil.d(TAG, "onDPClickComment map = $map") override fun onDPVideoContinue(map: Map<String, Any>) {
} LogUtil.d(TAG, "onDPVideoContinue map = $map")
}
override fun onDPClickLike(isLike: Boolean, map: Map<String, Any>) {
LogUtil.d(TAG, "onDPClickLike isLike = $isLike, map = $map") override fun onDPClickShare(map: Map<String, Any>) {
} LogUtil.d(TAG, "onDPClickShare map = $map")
}
override fun onDPVideoPause(map: Map<String, Any>) { }).adListener(
LogUtil.d(TAG, "onDPVideoPause map = $map") object : IDPAdListener() {
} override fun onDPAdRequest(map: Map<String, Any>) {
LogUtil.d(TAG, "onDPAdRequest map = $map")
override fun onDPVideoContinue(map: Map<String, Any>) { }
LogUtil.d(TAG, "onDPVideoContinue map = $map")
} override fun onDPAdRequestSuccess(map: Map<String, Any>) {
LogUtil.d(TAG, "onDPAdRequestSuccess map = $map")
override fun onDPClickShare(map: Map<String, Any>) { }
LogUtil.d(TAG, "onDPClickShare map = $map")
} override fun onDPAdRequestFail(
}).adListener(object : IDPAdListener() { code: Int,
override fun onDPAdRequest(map: Map<String, Any>) { msg: String,
LogUtil.d(TAG, "onDPAdRequest map = $map") map: Map<String, Any>
} ) {
LogUtil.d(TAG, "onDPAdRequestFail map = $map")
override fun onDPAdRequestSuccess(map: Map<String, Any>) { }
LogUtil.d(TAG, "onDPAdRequestSuccess map = $map")
} override fun onDPAdFillFail(map: Map<String, Any>) {
LogUtil.d(TAG, "onDPAdFillFail map = $map")
override fun onDPAdRequestFail( }
code: Int,
msg: String, override fun onDPAdShow(map: Map<String, Any>) {
map: Map<String, Any> LogUtil.d(TAG, "onDPAdShow map = $map")
) { }
LogUtil.d(TAG, "onDPAdRequestFail map = $map")
} override fun onDPAdPlayStart(map: Map<String, Any>) {
LogUtil.d(TAG, "onDPAdPlayStart map = $map")
override fun onDPAdFillFail(map: Map<String, Any>) { }
LogUtil.d(TAG, "onDPAdFillFail map = $map")
} override fun onDPAdPlayPause(map: Map<String, Any>) {
LogUtil.d(TAG, "onDPAdPlayPause map = $map")
override fun onDPAdShow(map: Map<String, Any>) { }
LogUtil.d(TAG, "onDPAdShow map = $map")
} override fun onDPAdPlayContinue(map: Map<String, Any>) {
LogUtil.d(TAG, "onDPAdPlayContinue map = $map")
override fun onDPAdPlayStart(map: Map<String, Any>) { }
LogUtil.d(TAG, "onDPAdPlayStart map = $map")
} override fun onDPAdPlayComplete(map: Map<String, Any>) {
LogUtil.d(TAG, "onDPAdPlayComplete map = $map")
override fun onDPAdPlayPause(map: Map<String, Any>) { }
LogUtil.d(TAG, "onDPAdPlayPause map = $map")
} override fun onDPAdClicked(map: Map<String, Any>) {
LogUtil.d(TAG, "onDPAdClicked map = $map")
override fun onDPAdPlayContinue(map: Map<String, Any>) { }
LogUtil.d(TAG, "onDPAdPlayContinue map = $map") })
}
override fun onDPAdPlayComplete(map: Map<String, Any>) {
LogUtil.d(TAG, "onDPAdPlayComplete map = $map")
}
override fun onDPAdClicked(map: Map<String, Any>) {
LogUtil.d(TAG, "onDPAdClicked map = $map")
}
})
) )
} }
...@@ -444,7 +517,11 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView { ...@@ -444,7 +517,11 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
if (it.openCash) { if (it.openCash) {
rl_open_cash.visibility = View.VISIBLE rl_open_cash.visibility = View.VISIBLE
tv_open_cash_progress.text = 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.max = it.turnNeedCount
pb_open_cash.progress = it.completeCount pb_open_cash.progress = it.completeCount
if (it.completeCount >= it.turnNeedCount) { if (it.completeCount >= it.turnNeedCount) {
...@@ -454,7 +531,12 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView { ...@@ -454,7 +531,12 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
tv_open_cash_info.text = SpanUtils() tv_open_cash_info.text = SpanUtils()
.append("再答") .append("再答")
.append("" + (it.turnNeedCount - it.completeCount)) .append("" + (it.turnNeedCount - it.completeCount))
.setForegroundColor(ContextCompat.getColor(mContext, R.color.red)) .setForegroundColor(
ContextCompat.getColor(
mContext,
R.color.red
)
)
.append("题立即提现") .append("题立即提现")
.create() .create()
} }
...@@ -522,7 +604,27 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView { ...@@ -522,7 +604,27 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
}, 1500) }, 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() musicPresenter.rdSongMsg()
} }
...@@ -536,24 +638,36 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView { ...@@ -536,24 +638,36 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
override fun adFail() { override fun adFail() {
if (canFail) return if (canFail) return
showLoading("正在获取视频", false)
NoPreAdManager.loadVideoAd(requireActivity(), carrierType, NoPreAdManager.loadVideoAd(requireActivity(), carrierType,
object : AdStatusListener { object : AdStatusListener {
override fun adFail() { override fun adFail() {
hideLoading()
showToast("广告太火爆了,请稍候再试") showToast("广告太火爆了,请稍候再试")
} }
override fun adSuccess() { override fun adSuccess() {
hideLoading()
} }
override fun adClose(vo: HashMap<String, Any>?) { 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>?) { 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 { ...@@ -567,8 +681,6 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
finger.visibility = View.GONE finger.visibility = View.GONE
quizLLPop.setOnClickListener { quizLLPop.setOnClickListener {
awardVideo(Constant.CARRIERTYPE_SONG_MORE)
quizLLPop.visibility = View.GONE quizLLPop.visibility = View.GONE
quizTvPop.visibility = View.GONE quizTvPop.visibility = View.GONE
mTimer?.stop() mTimer?.stop()
...@@ -579,7 +691,10 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView { ...@@ -579,7 +691,10 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
mTimer = CountDownTimerSupport(8000, 1000) mTimer = CountDownTimerSupport(8000, 1000)
mTimer?.setOnCountDownTimerListener(object : OnCountDownTimerListener { mTimer?.setOnCountDownTimerListener(object : OnCountDownTimerListener {
override fun onTick(millisUntilFinished: Long) { override fun onTick(millisUntilFinished: Long) {
quizTvPop.text = String.format("%2ds后消失", (millisUntilFinished / 1000).toInt()) quizTvPop.text = String.format(
"%2ds后消失",
(millisUntilFinished / 1000).toInt()
)
} }
override fun onFinish() { override fun onFinish() {
...@@ -596,7 +711,8 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView { ...@@ -596,7 +711,8 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
mTimer?.start() mTimer?.start()
mainHandler.postDelayed({ mainHandler.postDelayed({
rope = null 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 val ls = finger.layoutParams as RelativeLayout.LayoutParams
ls.addRule(RelativeLayout.ALIGN_TOP, R.id.quiz_ll_pop) ls.addRule(RelativeLayout.ALIGN_TOP, R.id.quiz_ll_pop)
...@@ -669,7 +785,8 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView { ...@@ -669,7 +785,8 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
val toX = val toX =
endLoc[0] - parentLocation[0].toFloat() endLoc[0] - parentLocation[0].toFloat()
// + targetView.width / 5.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 { ...@@ -696,7 +813,11 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
// boolean getPosTan(float distance, float[] pos, float[] tan) : // boolean getPosTan(float distance, float[] pos, float[] tan) :
// 传入一个距离distance(0<=distance<=getLength()),然后会计算当前距 // 传入一个距离distance(0<=distance<=getLength()),然后会计算当前距
// 离的坐标点和切线,pos会自动填充上坐标,这个方法很重要。 // 离的坐标点和切线,pos会自动填充上坐标,这个方法很重要。
mPathMeasure.getPosTan(value, mCurrentPosition, null) //mCurrentPosition此时就是中间距离点的坐标值 mPathMeasure.getPosTan(
value,
mCurrentPosition,
null
) //mCurrentPosition此时就是中间距离点的坐标值
// 移动的商品图片(动画图片)的坐标设置为该中间点的坐标 // 移动的商品图片(动画图片)的坐标设置为该中间点的坐标
goods.translationX = mCurrentPosition[0] goods.translationX = mCurrentPosition[0]
goods.translationY = mCurrentPosition[1] goods.translationY = mCurrentPosition[1]
...@@ -734,5 +855,11 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView { ...@@ -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 { ...@@ -29,7 +29,7 @@ public class CountDownView extends View {
private int mRetreatType;//圆弧绘制方式(增加和减少) private int mRetreatType;//圆弧绘制方式(增加和减少)
private float mPaintArcWidth;//最外层圆弧的宽度 private float mPaintArcWidth;//最外层圆弧的宽度
private int mCircleRadius;//圆圈的半径 private int mCircleRadius;//圆圈的半径
private int mPaintArcColor = Color.parseColor("#3C3F41");//初始值 private int mPaintArcColor = Color.parseColor("#fea54c");//初始值
private int mPaintBackGroundColor = Color.parseColor("#55B2E5");//初始值 private int mPaintBackGroundColor = Color.parseColor("#55B2E5");//初始值
private int mLoadingTime;//时间,单位秒 private int mLoadingTime;//时间,单位秒
private String mLoadingTimeUnit = "";//时间单位 private String mLoadingTimeUnit = "";//时间单位
......
...@@ -46,12 +46,12 @@ class SignDialog(context: Context, listener: DialogListener, signMsg: SignInfoBe ...@@ -46,12 +46,12 @@ class SignDialog(context: Context, listener: DialogListener, signMsg: SignInfoBe
tv_sign_title.text = SpanUtils() tv_sign_title.text = SpanUtils()
.append("签到7天领") .append("签到7天领")
.setForegroundColor(context.resources.getColor(R.color.apk_uninstalled)) .setForegroundColor(context.resources.getColor(R.color.color_fea54c))
.append(signMsg.sumCash.toString()) .append(signMsg.sumCash.toString())
.setFontSize(BubbleUtils.sp2px(30)) .setFontSize(BubbleUtils.sp2px(30))
.setForegroundColor(context.resources.getColor(R.color.red)) .setForegroundColor(context.resources.getColor(R.color.red))
.append("元红包") .append("元红包")
.setForegroundColor(context.resources.getColor(R.color.apk_uninstalled)) .setForegroundColor(context.resources.getColor(R.color.color_fea54c))
.create() .create()
val cashList = signMsg.signWeekCashArr val cashList = signMsg.signWeekCashArr
......
...@@ -2,6 +2,7 @@ package com.duben.dayplaylet.ui.widgets ...@@ -2,6 +2,7 @@ package com.duben.dayplaylet.ui.widgets
import android.app.Dialog import android.app.Dialog
import android.content.Context import android.content.Context
import android.text.SpannableStringBuilder
import android.view.Gravity import android.view.Gravity
import android.view.KeyEvent import android.view.KeyEvent
import android.view.WindowManager import android.view.WindowManager
...@@ -12,6 +13,7 @@ import android.widget.TextView ...@@ -12,6 +13,7 @@ import android.widget.TextView
import com.duben.dayplaylet.R import com.duben.dayplaylet.R
import com.duben.dayplaylet.ad.express.ExpressAdCallback import com.duben.dayplaylet.ad.express.ExpressAdCallback
import com.duben.dayplaylet.ad.express.ExpressManager import com.duben.dayplaylet.ad.express.ExpressManager
import com.duben.dayplaylet.ad.express.MyExpressManager
import com.duben.dayplaylet.utils.UIUtils import com.duben.dayplaylet.utils.UIUtils
/** /**
...@@ -19,9 +21,7 @@ import com.duben.dayplaylet.utils.UIUtils ...@@ -19,9 +21,7 @@ import com.duben.dayplaylet.utils.UIUtils
*/ */
class VideoLockDialog( class VideoLockDialog(
context: Context, context: Context,
titleStr: String, titleStr: SpannableStringBuilder,
infoStr: String,
btnStr: String,
listener: DialogListener listener: DialogListener
) : ) :
Dialog(context, R.style.dialog) { Dialog(context, R.style.dialog) {
...@@ -31,7 +31,6 @@ class VideoLockDialog( ...@@ -31,7 +31,6 @@ class VideoLockDialog(
private val ibClose: ImageButton private val ibClose: ImageButton
private val flAd: FrameLayout private val flAd: FrameLayout
private val tvTitle: TextView private val tvTitle: TextView
private val tvInfo: TextView
private val unlock: Button private val unlock: Button
init { init {
...@@ -55,12 +54,9 @@ class VideoLockDialog( ...@@ -55,12 +54,9 @@ class VideoLockDialog(
ibClose = findViewById(R.id.ib_close) ibClose = findViewById(R.id.ib_close)
flAd = findViewById(R.id.fl_ad) flAd = findViewById(R.id.fl_ad)
tvTitle = findViewById(R.id.tv_title) tvTitle = findViewById(R.id.tv_title)
tvInfo = findViewById(R.id.tv_info)
unlock = findViewById(R.id.unlock) unlock = findViewById(R.id.unlock)
tvTitle.text = titleStr tvTitle.text = titleStr
tvInfo.text = infoStr
unlock.text = btnStr
ibClose.setOnClickListener { dismiss() } ibClose.setOnClickListener { dismiss() }
unlock.setOnClickListener(listener) unlock.setOnClickListener(listener)
...@@ -69,7 +65,7 @@ class VideoLockDialog( ...@@ -69,7 +65,7 @@ class VideoLockDialog(
} }
private fun showAdView() { private fun showAdView() {
ExpressManager.instance.getAdView(object : ExpressAdCallback { MyExpressManager.instance.getAdView(object : ExpressAdCallback {
override fun loadSuccess(adView: FrameLayout?) { override fun loadSuccess(adView: FrameLayout?) {
adView?.let { adView?.let {
UIUtils.removeFromParent(it) 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 { ...@@ -74,7 +74,7 @@ public class PanelItemView extends FrameLayout implements ItemView {
iv_panel_item_pic.setImageResource(R.mipmap.ic_nine_mobile); iv_panel_item_pic.setImageResource(R.mipmap.ic_nine_mobile);
tv_panel_item_text.setTextColor(ContextCompat.getColor( tv_panel_item_text.setTextColor(ContextCompat.getColor(
context, context,
R.color.apk_uninstalled R.color.color_fea54c
)); ));
tv_panel_item_text.setTypeface(null, Typeface.BOLD); tv_panel_item_text.setTypeface(null, Typeface.BOLD);
break; break;
......
...@@ -72,7 +72,7 @@ public class PanelItemView2 extends FrameLayout implements ItemView { ...@@ -72,7 +72,7 @@ public class PanelItemView2 extends FrameLayout implements ItemView {
iv_panel_item_pic.setImageResource(R.mipmap.ic_nine_mobile); iv_panel_item_pic.setImageResource(R.mipmap.ic_nine_mobile);
tv_panel_item_text.setTextColor(ContextCompat.getColor( tv_panel_item_text.setTextColor(ContextCompat.getColor(
context, context,
R.color.apk_uninstalled R.color.color_fea54c
)); ));
tv_panel_item_text.setTypeface(null, Typeface.BOLD); tv_panel_item_text.setTypeface(null, Typeface.BOLD);
break; break;
......
...@@ -30,17 +30,16 @@ public class RxBus { ...@@ -30,17 +30,16 @@ public class RxBus {
} }
return mDefaultInstance; return mDefaultInstance;
} }
/*发送事件*/
/*发送事件*/
public void post(Object event) { public void post(Object event) {
if (mBus == null) { if (mBus == null) {
mDefaultInstance = new RxBus(); mDefaultInstance = new RxBus();
} }
mBus.onNext(event); mBus.onNext(event);
} }
/*订阅事件*/
/*订阅事件*/
public <T> Observable<T> toObservable(Class<T> eventType) { public <T> Observable<T> toObservable(Class<T> eventType) {
return mBus.ofType(eventType);//ofType可以根据事件类型发送指定数据 return mBus.ofType(eventType);//ofType可以根据事件类型发送指定数据
} }
...@@ -92,4 +91,20 @@ public class RxBus { ...@@ -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 ...@@ -4,6 +4,7 @@ import android.app.Dialog
import android.os.Bundle import android.os.Bundle
import android.util.Log import android.util.Log
import android.view.View import android.view.View
import androidx.core.content.ContextCompat
import com.bytedance.sdk.dp.* import com.bytedance.sdk.dp.*
import com.google.gson.Gson import com.google.gson.Gson
import com.duben.dayplaylet.R import com.duben.dayplaylet.R
...@@ -19,10 +20,8 @@ import com.duben.dayplaylet.mvp.presenters.VideoPresenter ...@@ -19,10 +20,8 @@ import com.duben.dayplaylet.mvp.presenters.VideoPresenter
import com.duben.dayplaylet.mvp.views.VideoView import com.duben.dayplaylet.mvp.views.VideoView
import com.duben.dayplaylet.ui.activitys.base.BaseActivity import com.duben.dayplaylet.ui.activitys.base.BaseActivity
import com.duben.dayplaylet.ui.adapter.VideoEpisodeAdapter import com.duben.dayplaylet.ui.adapter.VideoEpisodeAdapter
import com.duben.dayplaylet.ui.widgets.CountDownVideoView import com.duben.dayplaylet.ui.widgets.*
import com.duben.dayplaylet.ui.widgets.DialogListener import com.duben.dayplaylet.utils.SpanUtils
import com.duben.dayplaylet.ui.widgets.VideoEpisodeDialog
import com.duben.dayplaylet.ui.widgets.VideoLockDialog
import com.duben.library.utils.nodoubleclick.AntiShake import com.duben.library.utils.nodoubleclick.AntiShake
import kotlinx.android.synthetic.main.drama_activity_api_detail.* import kotlinx.android.synthetic.main.drama_activity_api_detail.*
import kotlinx.android.synthetic.main.layout_draw_header.* import kotlinx.android.synthetic.main.layout_draw_header.*
...@@ -61,6 +60,7 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic ...@@ -61,6 +60,7 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
private var mHasUnlockIndexMap = mutableMapOf<Long, MutableList<Int>>() private var mHasUnlockIndexMap = mutableMapOf<Long, MutableList<Int>>()
private var mVideoLockDialog: VideoLockDialog? = null private var mVideoLockDialog: VideoLockDialog? = null
private var mVideoRewardDialog: VideoRewardDialog? = null
private var lastIndex = 1 private var lastIndex = 1
...@@ -200,6 +200,9 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic ...@@ -200,6 +200,9 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
(map?.get("index") as? Int?)?.let { (map?.get("index") as? Int?)?.let {
lastIndex = it lastIndex = it
} }
if (cdvv.isPlaying) {
cdvv.resume()
}
} }
override fun onDPVideoPause(map: MutableMap<String, Any>?) { override fun onDPVideoPause(map: MutableMap<String, Any>?) {
...@@ -396,19 +399,34 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic ...@@ -396,19 +399,34 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
} }
override fun rdVedioMsgSuc(surplusCount: Int, surplusSeconds: Int) { override fun rdVedioMsgSuc(surplusCount: Int, surplusSeconds: Int) {
// if (surplusCount > 0) { if (surplusCount > 0) {
// cl_red_box.visibility = View.VISIBLE cl_red_box.visibility = View.VISIBLE
// cdvv.setTime(surplusSeconds) tv_tips.text = SpanUtils()
// cdvv.setCountDownVideoListener(this) .append("点击领取 ")
// } else { .append("大额红包")
// cl_red_box.visibility = View.GONE .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?) { override fun onClick(v: View?) {
if (AntiShake.check(v?.id)) return if (AntiShake.check(v?.id)) return
when (v?.id) { when (v?.id) {
...@@ -428,103 +446,123 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic ...@@ -428,103 +446,123 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
private fun showLockDialog(drama: DPDrama, widget: IDPWidget) { private fun showLockDialog(drama: DPDrama, widget: IDPWidget) {
mVideoLockDialog = VideoLockDialog( mVideoLockDialog = VideoLockDialog(
this, this,
String.format( SpanUtils()
"解锁%s·第%d-%d集", .append("解锁")
drama.title, .append(" $lockSet ")
mInitUnlockIndex + 1, .setForegroundColor(ContextCompat.getColor(this, R.color.red))
mInitUnlockIndex + lockSet .append("集剧情")
), .create(),
String.format("看激励视频解锁%d集剧情\n请按照顺序解锁", lockSet),
"观看激励视频",
object : DialogListener() { object : DialogListener() {
override fun onClick(dialog: Dialog?, v: View?) { override fun onClick(dialog: Dialog?, v: View?) {
super.onClick(dialog, v) super.onClick(dialog, v)
dialog?.dismiss() dialog?.dismiss()
showAd(Constant.CARRIERTYPE_VEDIO_UNLOCK, drama, widget)
}
}
)
val carrierType = Constant.CARRIERTYPE_CSJ_VEDIO mVideoLockDialog?.show()
AdManager.instance.showAd(this@DramaApiDetailActivity, carrierType, }
object : AdStatusListener {
var canFail = false
override fun adSuccess() {
canFail = true
}
override fun adFail() { private fun showRedboxDialog() {
if (canFail) return mVideoRewardDialog = VideoRewardDialog(
this,
30f,
object : DialogListener() {
override fun onClick(dialog: Dialog?, v: View?) {
super.onClick(dialog, v)
dialog?.dismiss()
showAd(Constant.CARRIERTYPE_VEDIO)
}
}
)
NoPreAdManager.loadVideoAd( mVideoRewardDialog?.show()
this@DramaApiDetailActivity, }
carrierType, object : AdStatusListener {
override fun adFail() {
showToast("广告太火爆了,请稍候再试")
}
override fun adSuccess() { private fun showAd(carrierType: String, drama: DPDrama? = null, widget: IDPWidget? = null) {
} AdManager.instance.showAd(this@DramaApiDetailActivity, carrierType,
object : AdStatusListener {
var canFail = false
override fun adSuccess() {
canFail = true
}
override fun adClose(vo: HashMap<String, Any>?) { override fun adFail() {
vo?.let { if (canFail) return
if (isThirdId) { showLoading("正在获取视频", false)
it["thirdId"] = "" + mVedioBean!!.thirdId
} else { NoPreAdManager.loadVideoAd(
it["vedioId"] = "" + mVedioBean!!.vedioId this@DramaApiDetailActivity,
} carrierType, object : AdStatusListener {
videoPresenter.unlock(it) override fun adFail() {
} hideLoading()
showToast("广告太火爆了,请稍候再试")
// 更新解锁集数 }
for (i in 1 until lockSet) {
val hasUnlockList: MutableList<Int> = override fun adSuccess() {
mHasUnlockIndexMap[drama.id] ?: mutableListOf() hideLoading()
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() // 解锁当前集
}
})
} }
override fun adClose(vo: HashMap<String, Any>?) { override fun adClose(vo: HashMap<String, Any>?) {
vo?.let { hideLoading()
if (isThirdId) { when (carrierType) {
it["thirdId"] = "" + mVedioBean!!.thirdId Constant.CARRIERTYPE_VEDIO_UNLOCK -> {
} else { if (drama != null && widget != null) {
it["vedioId"] = "" + mVedioBean!!.vedioId unlock(vo, drama, widget)
}
} }
videoPresenter.unlock(it) Constant.CARRIERTYPE_VEDIO -> {
}
// 更新解锁集数 }
for (i in 1 until lockSet) { else -> {}
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() // 解锁当前集
} }
}) })
} }
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
} else {
it["vedioId"] = "" + mVedioBean!!.vedioId
} }
) videoPresenter.unlock(it)
}
mVideoLockDialog?.show() // 更新解锁集数
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() // 解锁当前集
} }
} }
\ No newline at end of file
...@@ -200,6 +200,10 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView, ...@@ -200,6 +200,10 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
} }
override fun reportAddCoinMsgSuc(coin: Int, di: Int) {
}
override fun onEpisodeClick(position: Int) { override fun onEpisodeClick(position: Int) {
dialog?.dismiss() dialog?.dismiss()
val data = super_short_video_view.data 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"?> <?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!--3个层的顺序即为显示时的叠加顺序-->
<!--背景色-->
<item android:id="@android:id/background"> <item android:id="@android:id/background">
<shape> <shape>
<corners android:radius="5dip" /> <corners android:radius="30dp" />
<solid android:color="#FFE9E9" /> <solid android:color="#FFE9E9" />
</shape> </shape>
</item> </item>
<!--一级进度条的颜色,也可以直接替换成图片--> <item android:id="@android:id/secondaryProgress">
<item android:id="@android:id/progress"> <scale android:scaleWidth="100%">
<clip>
<shape> <shape>
<corners android:radius="5dip" /> <corners android:radius="30dp" />
<solid android:color="#F13D3D" /> <solid android:color="#F13D3D" />
</shape> </shape>
</scale>
</item>
<item android:id="@android:id/progress">
<!--
<clip>
<shape>
<corners android:topRightRadius="20dp"
android:bottomRightRadius="20dp"/>
<solid android:color="#FF009898"/>
</shape>
</clip> </clip>
-->
<scale
android:drawable="@drawable/progress_bar_ct2"
android:scaleWidth="100%" />
</item> </item>
</layer-list> </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"?> <?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:id="@+id/block_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="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 <LinearLayout
android:id="@+id/ll"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="30dp" android:layout_marginStart="30dp"
android:layout_marginEnd="30dp" android:layout_marginEnd="30dp"
android:background="@drawable/shape_bg_write" android:background="@mipmap/bg_unlock"
android:gravity="center" android:gravity="center_horizontal"
android:orientation="vertical"> android:orientation="vertical">
<ImageButton
android:id="@+id/ib_close"
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" />
<com.duben.dayplaylet.ui.widgets.RoundRectLayout
android:id="@+id/fl_ad"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_bg_write" />
<TextView <TextView
android:id="@+id/tv_title" android:id="@+id/tv_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp" android:layout_marginTop="140dp"
android:layout_marginBottom="10dp" android:layout_marginBottom="20dp"
android:text="试看已结束"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="16sp" android:textSize="20sp"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/tv_info"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="20dp" android:layout_marginBottom="20dp">
android:gravity="center"
android:text="试看已结束" /> <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_info1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="并领取最高"
android:textSize="18sp"
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: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 <Button
android:id="@+id/unlock" android:id="@+id/unlock"
android:layout_width="230dp" android:layout_width="243dp"
android:layout_height="40dp" android:layout_height="48dp"
android:layout_marginBottom="10dp" android:background="@mipmap/ic_btn_unlock"
android:background="@mipmap/bg_detail_top"
android:paddingStart="30dp"
android:text="看广告解锁1集"
android:textColor="@color/white" /> android:textColor="@color/white" />
</LinearLayout> </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 @@ ...@@ -52,7 +52,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="立即清理" android:text="立即清理"
android:textColor="@color/apk_uninstalled" android:textColor="@color/color_fea54c"
android:textSize="18sp" /> android:textSize="18sp" />
</LinearLayout> </LinearLayout>
......
...@@ -9,15 +9,29 @@ ...@@ -9,15 +9,29 @@
android:id="@+id/tv_tips" android:id="@+id/tv_tips"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/shape_tips" android:layout_marginBottom="10dp"
android:elevation="2dp" android:background="@drawable/shape_bg_write"
android:padding="5dp" android:gravity="center"
android:text="点击红包可以领取金币哦~" android:paddingStart="4dp"
android:textColor="@color/white" android:paddingTop="2dp"
android:textSize="14sp" android:paddingEnd="4dp"
android:visibility="gone" android:paddingBottom="2dp"
android:text="-"
android:textColor="@color/black"
android:textSize="12sp"
android:visibility="visible"
app:layout_constraintBottom_toTopOf="@+id/linearLayout" 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 <LinearLayout
android:id="@+id/linearLayout" android:id="@+id/linearLayout"
...@@ -39,6 +53,17 @@ ...@@ -39,6 +53,17 @@
android:id="@+id/cdvv" android:id="@+id/cdvv"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="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> </LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -11,11 +11,10 @@ ...@@ -11,11 +11,10 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_margin="4dp"
app:cd_animator_time="8" 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_arc_width="3dp"
app:cd_bg_color="#20FF9837" app:cd_bg_color="@color/white"
app:cd_circle_radius="25dp" app:cd_circle_radius="25dp"
app:cd_location="top" app:cd_location="top"
app:cd_retreat_type="forward" app:cd_retreat_type="forward"
...@@ -27,6 +26,6 @@ ...@@ -27,6 +26,6 @@
android:layout_width="28dp" android:layout_width="28dp"
android:layout_height="32dp" android:layout_height="32dp"
android:layout_gravity="center" android:layout_gravity="center"
android:src="@mipmap/ic_launcher_main" android:src="@mipmap/withdraw_wx"
tools:visibility="gone" /> tools:visibility="gone" />
</FrameLayout> </FrameLayout>
...@@ -24,10 +24,8 @@ ...@@ -24,10 +24,8 @@
<color name="color_F61F03">#FD563B</color> <color name="color_F61F03">#FD563B</color>
<color name="color_fea54c">#fea54c</color>
<color name="apk_uninstalled">#fea54c</color> <color name="color_FFFC9F">#FFFC9F</color>
<color name="color_8D8F90">#7F8182</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