Commit a2295980 authored by mengcuiguang's avatar mengcuiguang

代码优化

parents 6dc96409 10744905
......@@ -171,6 +171,7 @@
android:name=".ui.activitys.HintActivity"
android:launchMode="singleTask"
android:theme="@style/TransparentTheme" />
<service
android:name=".ui.service.UpdateService"
android:exported="true" />
......
......@@ -2,7 +2,6 @@ package com.duben.dayplaylet.ad.video;
import android.app.Activity;
import android.os.Bundle;
import android.text.TextUtils;
import com.bytedance.sdk.openadsdk.AdSlot;
import com.bytedance.sdk.openadsdk.TTAdConstant;
......@@ -16,13 +15,13 @@ import com.duben.dayplaylet.ad.AdStatusListener;
import com.duben.dayplaylet.common.AppConfig;
import com.duben.dayplaylet.common.Constant;
import com.duben.dayplaylet.manager.TrackManager;
import com.duben.dayplaylet.utils.AppPreferencesManager;
import com.duben.dayplaylet.utils.GromorePrintUtil;
import com.duben.dayplaylet.utils.LogUtil;
import com.duben.dayplaylet.utils.TimeRender;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* GroMore激励视频广告
......@@ -220,8 +219,7 @@ public class InMoneyVideo {
vo.put("list_id", AppConfig.taskListId);
}
if (!TextUtils.equals(Constant.CARRIERTYPE_VEDIO_UNLOCK, carrierType) ||
!TextUtils.equals(Constant.CARRIERTYPE_VEDIO, carrierType)) {
if (!isNoReportCarrier(carrierType)) {
TrackManager.getInstance().reportAddCoinMsg(vo);
}
......@@ -262,4 +260,13 @@ public class InMoneyVideo {
}
};
private boolean isNoReportCarrier(String carrierType) {
List<String> strings = new ArrayList<>();
strings.add(Constant.CARRIERTYPE_VEDIO);
strings.add(Constant.CARRIERTYPE_SONG_CLICK);
strings.add(Constant.CARRIERTYPE_SONG_MORE);
strings.add(Constant.CARRIERTYPE_SONG_ALL);
return strings.contains(carrierType);
}
}
......@@ -2,7 +2,6 @@ package com.duben.dayplaylet.ad.video;
import android.app.Activity;
import android.os.Bundle;
import android.text.TextUtils;
import com.bytedance.sdk.openadsdk.AdSlot;
import com.bytedance.sdk.openadsdk.TTAdConstant;
......@@ -16,12 +15,12 @@ import com.duben.dayplaylet.ad.AdStatusListener;
import com.duben.dayplaylet.common.AppConfig;
import com.duben.dayplaylet.common.Constant;
import com.duben.dayplaylet.manager.TrackManager;
import com.duben.dayplaylet.utils.AppPreferencesManager;
import com.duben.dayplaylet.utils.GromorePrintUtil;
import com.duben.dayplaylet.utils.LogUtil;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* **实时加载
......@@ -160,8 +159,7 @@ public class InMoneyVideoNoPre {
}
if (!TextUtils.equals(Constant.CARRIERTYPE_VEDIO_UNLOCK, carrierType) ||
!TextUtils.equals(Constant.CARRIERTYPE_VEDIO, carrierType)) {
if (!isNoReportCarrier(carrierType)) {
TrackManager.getInstance().reportAddCoinMsg(vo);
}
......@@ -201,5 +199,13 @@ public class InMoneyVideoNoPre {
}
};
private boolean isNoReportCarrier(String carrierType) {
List<String> strings = new ArrayList<>();
strings.add(Constant.CARRIERTYPE_VEDIO);
strings.add(Constant.CARRIERTYPE_SONG_CLICK);
strings.add(Constant.CARRIERTYPE_SONG_MORE);
strings.add(Constant.CARRIERTYPE_SONG_ALL);
return strings.contains(carrierType);
}
}
......@@ -7,7 +7,7 @@ import android.text.TextUtils
import com.bytedance.sdk.dp.DPDrama
import com.bytedance.sdk.dp.DPSdk
import com.bytedance.sdk.dp.IDPWidgetFactory
import com.duben.dayplaylet.ad.express.ExpressManager
import com.duben.dayplaylet.ad.express.MyExpressManager
import com.duben.library.utils.json.JsonUtil
import com.duben.dayplaylet.common.Constant
import com.duben.dayplaylet.mvp.model.VedioBean
......@@ -113,7 +113,7 @@ object LocalVedioManager {
}
}
ExpressManager.instance.preLoadAd()
MyExpressManager.instance.preLoadAd()
}
// 请求穿山甲数据
......
......@@ -10,16 +10,6 @@ public class IndexList implements Serializable {
private List<VedioEpisodeBean> list;
private ArrayList<String> tip;
private UserBean.UserMsgBean userMsg;
public UserBean.UserMsgBean getUserMsg() {
return userMsg;
}
public void setUserMsg(UserBean.UserMsgBean userMsg) {
this.userMsg = userMsg;
}
public ArrayList<String> getTip() {
return tip;
}
......
package com.duben.dayplaylet.mvp.model;
import java.io.Serializable;
public class RDVideoBean implements Serializable {
private int surplusCount;
private int surplusSeconds;
private UserBean.UserMsgBean userMsg;
public int getSurplusCount() {
return surplusCount;
}
public void setSurplusCount(int surplusCount) {
this.surplusCount = surplusCount;
}
public int getSurplusSeconds() {
return surplusSeconds;
}
public void setSurplusSeconds(int surplusSeconds) {
this.surplusSeconds = surplusSeconds;
}
public UserBean.UserMsgBean getUserMsg() {
return userMsg;
}
public void setUserMsg(UserBean.UserMsgBean userMsg) {
this.userMsg = userMsg;
}
}
......@@ -3,6 +3,7 @@ package com.duben.dayplaylet.mvp.presenters
import com.duben.dayplaylet.manager.AppHttpManager
import com.duben.dayplaylet.mvp.model.BaseResponse
import com.duben.dayplaylet.mvp.model.IndexList
import com.duben.dayplaylet.mvp.model.RDVideoBean
import com.duben.dayplaylet.mvp.views.VideoView
import com.duben.library.net.neterror.BaseSubscriber
import com.duben.library.net.neterror.Throwable
......@@ -93,13 +94,13 @@ class VideoPresenter : BasePresenter<VideoView>() {
fun rdVedioMsg() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.rdVedioMsg(),
object : BaseSubscriber<BaseResponse<JsonObject>>() {
object : BaseSubscriber<BaseResponse<RDVideoBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onNext(baseResponse: BaseResponse<JsonObject>) {
override fun onNext(baseResponse: BaseResponse<RDVideoBean>) {
if (isLinkView) return
view.hideLoading()
......@@ -110,16 +111,9 @@ class VideoPresenter : BasePresenter<VideoView>() {
200 -> {
val data = baseResponse.data
if (data != null) {
view.rdVedioMsgSuc(
data["surplusCount"].asInt,
data["surplusSeconds"].asInt
)
view.rdVedioMsgSuc(data)
}
}
else -> {
view.rdVedioMsgSuc(0, 0)
view.showToast(message)
}
}
}
......
package com.duben.dayplaylet.mvp.views
import com.duben.dayplaylet.mvp.model.IndexList
import com.duben.dayplaylet.mvp.model.NineShowBean
import com.duben.dayplaylet.mvp.model.RDVideoBean
interface VideoView : BaseView {
fun getIndexListSuc(indexList: IndexList)
......@@ -10,7 +10,7 @@ interface VideoView : BaseView {
fun unlockSuc(indexList: IndexList)
fun unlockFail()
fun rdVedioMsgSuc(surplusCount: Int, surplusSeconds: Int)
fun rdVedioMsgSuc(data: RDVideoBean)
fun reportAddCoinMsgSuc(coin: Int, di: Int)
......
......@@ -4,6 +4,7 @@ import android.content.Context;
import android.text.TextUtils;
import com.duben.dayplaylet.mvp.model.DrawInfoBean;
import com.duben.dayplaylet.mvp.model.RDVideoBean;
import com.duben.dayplaylet.mvp.model.RiskBean;
import com.duben.dayplaylet.mvp.model.SignInfoBean;
import com.duben.dayplaylet.mvp.model.MusicBean;
......@@ -238,7 +239,7 @@ public interface LoanService {
* @return
*/
@POST("api/reward/rdVedioMsg")
Observable<BaseResponse<JsonObject>> rdVedioMsg();
Observable<BaseResponse<RDVideoBean>> rdVedioMsg();
/**
* 任务列表
......
......@@ -7,7 +7,6 @@ import android.view.View
import android.widget.FrameLayout
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.ui.activitys.base.BaseActivity
import com.duben.dayplaylet.utils.UIUtils
......@@ -55,6 +54,8 @@ class SongAwardActivity : BaseActivity(), View.OnClickListener {
}
private fun initListener() {
iv_award_quit.setOnClickListener(this)
iv_song_award.setOnClickListener(this)
}
override fun finish() {
......@@ -108,12 +109,12 @@ class SongAwardActivity : BaseActivity(), View.OnClickListener {
fl_ad.addView(it)
}
ExpressManager.instance.preLoadAd()
MyExpressManager.instance.preLoadAd()
return false
}
override fun loadFail() {
ExpressManager.instance.preLoadAd()
MyExpressManager.instance.preLoadAd()
}
})
......
......@@ -6,13 +6,11 @@ import android.os.Looper
import android.view.KeyEvent
import android.view.View
import android.widget.FrameLayout
import com.duben.dayplaylet.MintsApplication
import com.duben.dayplaylet.R
import com.duben.dayplaylet.ad.AdManager
import com.duben.dayplaylet.ad.AdStatusListener
import com.duben.dayplaylet.ad.NoPreAdManager
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.common.AppConfig
import com.duben.dayplaylet.manager.TrackManager
......@@ -240,12 +238,12 @@ class TaskAwardActivity : BaseActivity(), View.OnClickListener {
fl_ad.addView(it)
}
ExpressManager.instance.preLoadAd()
MyExpressManager.instance.preLoadAd()
return false
}
override fun loadFail() {
ExpressManager.instance.preLoadAd()
MyExpressManager.instance.preLoadAd()
}
})
......
......@@ -31,6 +31,7 @@ import com.duben.dayplaylet.R
import com.duben.dayplaylet.ad.AdManager
import com.duben.dayplaylet.ad.AdStatusListener
import com.duben.dayplaylet.ad.NoPreAdManager
import com.duben.dayplaylet.ad.half.HalfScreenManager
import com.duben.dayplaylet.common.AppConfig
import com.duben.dayplaylet.common.Constant
import com.duben.dayplaylet.manager.DPHolder
......@@ -38,6 +39,7 @@ 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.NineActivity
import com.duben.dayplaylet.ui.activitys.MainActivity
import com.duben.dayplaylet.ui.activitys.SongAwardActivity
import com.duben.dayplaylet.ui.fragment.base.LazyLoadBaseFragment
import com.duben.dayplaylet.ui.widgets.countdowntimer.CountDownTimerSupport
......@@ -47,6 +49,7 @@ 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.library.utils.nodoubleclick.AntiShake
import io.reactivex.Observer
import io.reactivex.disposables.Disposable
import kotlinx.android.synthetic.main.fragment_music.*
......@@ -55,7 +58,7 @@ import kotlinx.android.synthetic.main.layout_draw_header.*
/**
* 猜歌
*/
class MusicFragment : LazyLoadBaseFragment(), MusicView {
class MusicFragment : LazyLoadBaseFragment(), MusicView, View.OnClickListener {
companion object {
private const val TAG = "MusicFragment"
......@@ -95,6 +98,8 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
}
}
btn_draw_gold.setOnClickListener(this)
btn_draw_cash.setOnClickListener(this)
}
override fun onFragmentFirstVisible() {
......@@ -631,7 +636,10 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
}, 100)
}
HalfScreenManager.getInstance().preLoadAd(requireActivity())
mainHandler.postDelayed({
HalfScreenManager.getInstance().showAd(requireActivity(), null)
cl_reward.visibility = View.GONE
}, 1500)
}
......@@ -660,6 +668,8 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
}
private fun awardVideo(carrierType: String) {
HalfScreenManager.getInstance().preLoadAd(requireActivity())
AdManager.instance.showAd(requireActivity(), carrierType,
object : AdStatusListener {
var canFail = false
......@@ -903,4 +913,17 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
showRewardAnim(coin, di)
}
override fun onClick(v: View?) {
if (AntiShake.check(v?.id)) return
when (v?.id) {
R.id.btn_draw_gold -> {
(requireActivity() as MainActivity).clickTab4Layout()
}
R.id.btn_draw_cash -> {
(requireActivity() as MainActivity).clickTab4Layout()
}
}
}
}
\ No newline at end of file
......@@ -13,7 +13,7 @@ import com.duben.dayplaylet.R
import com.duben.dayplaylet.ad.AdManager
import com.duben.dayplaylet.ad.AdStatusListener
import com.duben.dayplaylet.ad.NoPreAdManager
import com.duben.dayplaylet.ad.half.HalfScreenManagerNoPre
import com.duben.dayplaylet.ad.half.HalfScreenManager
import com.duben.dayplaylet.common.Constant
import com.duben.dayplaylet.mvp.model.MSGMultiItemEntity
import com.duben.dayplaylet.mvp.model.MsgBean
......@@ -190,6 +190,8 @@ class RedpkgFragment : LazyLoadBaseFragment(), View.OnClickListener, RedpkgView
}
private fun awardVideo(carrierType: String) {
HalfScreenManager.getInstance().preLoadAd(requireActivity())
AdManager.instance.showAd(requireActivity(), carrierType,
object : AdStatusListener {
var canFail = false
......@@ -268,6 +270,8 @@ class RedpkgFragment : LazyLoadBaseFragment(), View.OnClickListener, RedpkgView
}
private fun showRedPkgAwardDialog() {
HalfScreenManager.getInstance().preLoadAd(requireActivity())
mRedPkgAwardDialog =
RedPkgAwardDialog(requireContext(), 10, 132434, true, object : DialogListener() {
override fun onClick(dialog: Dialog?, v: View?) {
......@@ -278,7 +282,7 @@ class RedpkgFragment : LazyLoadBaseFragment(), View.OnClickListener, RedpkgView
}
R.id.ib_close -> {
HalfScreenManagerNoPre.getInstance().showAd(requireActivity(), null)
HalfScreenManager.getInstance().showAd(requireActivity(), null)
}
else -> {}
}
......@@ -289,6 +293,8 @@ class RedpkgFragment : LazyLoadBaseFragment(), View.OnClickListener, RedpkgView
}
private fun showWithdrawSucDialog() {
HalfScreenManager.getInstance().preLoadAd(requireActivity())
mWithDrawSucDialog =
WithDrawSucDialog(requireContext(), 10, object : DialogListener() {
override fun onClick(dialog: Dialog?, v: View?) {
......@@ -296,10 +302,10 @@ class RedpkgFragment : LazyLoadBaseFragment(), View.OnClickListener, RedpkgView
dialog?.dismiss()
when (v?.id) {
R.id.btn -> {
HalfScreenManagerNoPre.getInstance().showAd(requireActivity(), null)
HalfScreenManager.getInstance().showAd(requireActivity(), null)
}
R.id.ib_close -> {
HalfScreenManagerNoPre.getInstance().showAd(requireActivity(), null)
HalfScreenManager.getInstance().showAd(requireActivity(), null)
}
else -> {}
}
......
......@@ -27,7 +27,7 @@ class DrawAlipayDialog(private val context: Context, val cash: Double) :
lp = window!!.attributes
lp.gravity = Gravity.CENTER
lp.width = WindowManager.LayoutParams.MATCH_PARENT
lp.windowAnimations = R.style.DialogAnimFade
lp.windowAnimations = R.style.DialogAnimScale
window!!.attributes = lp
// 设置外部不可关闭
......
......@@ -36,7 +36,7 @@ class RedPkgAwardDialog(
lp = window!!.attributes
lp.width = WindowManager.LayoutParams.MATCH_PARENT
lp.height = WindowManager.LayoutParams.MATCH_PARENT
lp.windowAnimations = R.style.DialogAnimFade
lp.windowAnimations = R.style.DialogAnimScale
window!!.attributes = lp
// 设置外部不可关闭
......
......@@ -12,7 +12,6 @@ import android.widget.ImageButton
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
......@@ -39,7 +38,7 @@ class VideoLockDialog(
lp.gravity = Gravity.CENTER
lp.width = WindowManager.LayoutParams.MATCH_PARENT
lp.height = WindowManager.LayoutParams.WRAP_CONTENT
lp.windowAnimations = R.style.DialogAnimFade
lp.windowAnimations = R.style.DialogAnimScale
window!!.attributes = lp
// 设置外部不可关闭
......@@ -81,12 +80,12 @@ class VideoLockDialog(
flAd.addView(it)
}
ExpressManager.instance.preLoadAd()
MyExpressManager.instance.preLoadAd()
return false
}
override fun loadFail() {
ExpressManager.instance.preLoadAd()
MyExpressManager.instance.preLoadAd()
}
})
......
......@@ -15,6 +15,7 @@ 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.FormatUtil
import com.duben.dayplaylet.utils.SpanUtils
/**
......@@ -41,7 +42,7 @@ class VideoRewardDialog(
lp.gravity = Gravity.CENTER
lp.width = WindowManager.LayoutParams.MATCH_PARENT
lp.height = WindowManager.LayoutParams.WRAP_CONTENT
lp.windowAnimations = R.style.DialogAnimFade
lp.windowAnimations = R.style.DialogAnimScale
window!!.attributes = lp
// 设置外部不可关闭
......@@ -62,7 +63,7 @@ class VideoRewardDialog(
tvInfo.text = SpanUtils()
.append("还差")
.append("${(100f - currentCash)}元")
.append("${FormatUtil.format(100f - currentCash)}元")
.setForegroundColor(ContextCompat.getColor(context, R.color.red))
.append("即可提现")
.append("100元")
......
......@@ -32,7 +32,7 @@ class VipCountDialog(val activity: Activity, vedioBean: VedioBean, tipList: Arra
lp = window!!.attributes
lp.gravity = Gravity.CENTER
lp.width = WindowManager.LayoutParams.MATCH_PARENT
lp.windowAnimations = R.style.DialogAnimFade
lp.windowAnimations = R.style.DialogAnimScale
window!!.attributes = lp
// 设置外部不可关闭
......
......@@ -11,7 +11,6 @@ import android.widget.ImageButton
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
......@@ -40,7 +39,7 @@ class WithDrawSucDialog(
lp.gravity = Gravity.CENTER
lp.width = WindowManager.LayoutParams.MATCH_PARENT
lp.height = WindowManager.LayoutParams.WRAP_CONTENT
lp.windowAnimations = R.style.DialogAnimFade
lp.windowAnimations = R.style.DialogAnimScale
window!!.attributes = lp
// 设置外部不可关闭
......@@ -85,12 +84,12 @@ class WithDrawSucDialog(
flAd.addView(it)
}
ExpressManager.instance.preLoadAd()
MyExpressManager.instance.preLoadAd()
return false
}
override fun loadFail() {
ExpressManager.instance.preLoadAd()
MyExpressManager.instance.preLoadAd()
}
})
......
......@@ -11,7 +11,7 @@ import com.duben.dayplaylet.common.AppConfig;
import com.duben.dayplaylet.manager.ActivityPageManager;
import com.duben.dayplaylet.manager.TrackManager;
import com.duben.dayplaylet.mvp.presenters.VersionUpdatePresenter;
import com.duben.dayplaylet.ui.activitys.SplashForeAdActivity;
import com.duben.dayplaylet.ui.activitys.MainActivity;
import java.lang.ref.WeakReference;
......@@ -26,6 +26,7 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
//获取当前最上层的activity
private static WeakReference<Activity> app_activity;
private static WeakReference<Activity> main_activity;
private VersionUpdatePresenter vup;
public static ForegroundOrBackground init(Application application) {
......@@ -40,6 +41,10 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
return app_activity.get();
}
public static MainActivity getMainActivity() {
return (MainActivity) main_activity.get();
}
@Override
public void onActivityResumed(Activity activity) {
if (activity == null)
......@@ -63,6 +68,9 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
@Override
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
if (TextUtils.equals(activity.getClass().getSimpleName(), "MainActivity")) {
main_activity = new WeakReference<>(activity);
}
app_activity = new WeakReference<>(activity);
ActivityPageManager.getInstance().addActivity(activity);
}
......
package com.duben.dayplaylet.utils
import java.math.BigDecimal
import java.text.DecimalFormat
object FormatUtil {
......@@ -22,4 +23,10 @@ object FormatUtil {
// val temp= bd1.subtract(bd2)
// return temp.setScale(2, BigDecimal.ROUND_HALF_UP).toDouble()
}
fun format(data: Float): String {
//#.00 表示两位小数
val df = DecimalFormat("#0.00")
return df.format(data)
}
}
\ No newline at end of file
......@@ -20,16 +20,19 @@ import com.duben.dayplaylet.R
import com.duben.dayplaylet.ad.AdManager
import com.duben.dayplaylet.ad.AdStatusListener
import com.duben.dayplaylet.ad.NoPreAdManager
import com.duben.dayplaylet.ad.express.ExpressManager
import com.duben.dayplaylet.ad.express.MyExpressManager
import com.duben.dayplaylet.ad.half.HalfScreenManager
import com.duben.dayplaylet.common.Constant
import com.duben.dayplaylet.manager.LocalVedioManager
import com.duben.dayplaylet.mvp.model.IndexList
import com.duben.dayplaylet.mvp.model.RDVideoBean
import com.duben.dayplaylet.mvp.model.VedioBean
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.*
import com.duben.dayplaylet.utils.ForegroundOrBackground
import com.duben.dayplaylet.utils.FormatUtil
import com.duben.dayplaylet.utils.SpanUtils
import com.duben.library.utils.nodoubleclick.AntiShake
......@@ -108,12 +111,14 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
videoPresenter.attachView(this)
mVedioBean?.let { videoPresenter.getIndexList(it.thirdId, true) }
ExpressManager.instance.preLoadAd()
MyExpressManager.instance.preLoadAd()
leave.visibility = View.VISIBLE
fm_bottom.setOnClickListener(this)
leave.setOnClickListener(this)
iv_pause.setOnClickListener(this)
btn_draw_gold.setOnClickListener(this)
btn_draw_cash.setOnClickListener(this)
drama = outerDrama
drama?.let {
......@@ -179,7 +184,7 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
override fun onDestroy() {
dpWidget?.destroy()
ExpressManager.instance.destroy()
MyExpressManager.instance.destroy()
cdvv.destroy()
cdvv.setCountDownVideoListener(null)
......@@ -393,11 +398,6 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
override fun getIndexListSuc(indexList: IndexList) {
tipList = indexList.tip
mCash = indexList.userMsg.coin
mGold = indexList.userMsg.diamonds
tv_cash.text = "${FormatUtil.getCashFormaet(mCash)}元"
tv_gold.text = "${mGold}个"
}
override fun getIndexListFail() {
......@@ -412,8 +412,14 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
}
override fun rdVedioMsgSuc(surplusCount: Int, surplusSeconds: Int) {
if (surplusCount > 0) {
override fun rdVedioMsgSuc(data: RDVideoBean) {
mCash = data.userMsg.coin
mGold = data.userMsg.diamonds
tv_cash.text = "${FormatUtil.getCashFormaet(mCash)}元"
tv_gold.text = "${mGold}个"
if (data.surplusCount > 0) {
cl_red_box.visibility = View.VISIBLE
tv_tips.text = SpanUtils()
.append("点击领取 ")
......@@ -422,11 +428,13 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
.create()
tv_tips.visibility = View.GONE
triangle.visibility = View.GONE
cdvv.setTime(surplusSeconds)
cdvv.setTime(data.surplusSeconds)
cdvv.start()
cdvv.setCountDownVideoListener(this)
cl_red_box.isClickable = false
cl_red_box.setOnClickListener {
if (cdvv.isPlaying) return@setOnClickListener
dpWidget?.fragment?.onPause()
showRedboxDialog()
}
......@@ -458,6 +466,18 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
R.id.fm_bottom -> {
showEpisodeDialog()
}
R.id.btn_draw_gold -> {
finish()
if (ForegroundOrBackground.getMainActivity() != null) {
ForegroundOrBackground.getMainActivity().clickTab4Layout()
}
}
R.id.btn_draw_cash -> {
finish()
if (ForegroundOrBackground.getMainActivity() != null) {
ForegroundOrBackground.getMainActivity().clickTab4Layout()
}
}
else -> {}
}
}
......@@ -502,6 +522,8 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
}
private fun showAd(carrierType: String, drama: DPDrama? = null, widget: IDPWidget? = null) {
HalfScreenManager.getInstance().preLoadAd(this)
AdManager.instance.showAd(this@DramaApiDetailActivity, carrierType,
object : AdStatusListener {
var canFail = false
......@@ -642,8 +664,11 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
}, 100)
}
HalfScreenManager.getInstance().preLoadAd(this)
mainHandler.postDelayed({
cl_reward.visibility = View.GONE
// 展示插屏
HalfScreenManager.getInstance().showAd(this, null)
}, 1500)
}
......
......@@ -196,8 +196,7 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
override fun unlockFail() {
}
override fun rdVedioMsgSuc(surplusCount: Int, surplusSeconds: Int) {
override fun rdVedioMsgSuc(data: RDVideoBean) {
}
override fun reportAddCoinMsgSuc(coin: Int, di: Int) {
......
......@@ -27,7 +27,7 @@
android:id="@+id/triangle"
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_marginStart="16dp"
android:layout_marginStart="30dp"
android:background="@drawable/shape_triangle"
android:visibility="gone"
app:layout_constraintStart_toStartOf="@id/tv_tips"
......@@ -51,9 +51,9 @@
<com.duben.dayplaylet.ui.widgets.CountDownVideoView
android:id="@+id/cdvv"
android:layout_gravity="center_horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" />
<TextView
android:layout_width="82dp"
......
......@@ -26,6 +26,7 @@
android:layout_width="45dp"
android:layout_height="52dp"
android:layout_gravity="center"
android:padding="5dp"
android:src="@mipmap/withdraw_wx"
tools:visibility="gone" />
</FrameLayout>
......@@ -62,6 +62,12 @@
<item name="android:windowExitAnimation">@anim/fade_out</item>
</style>
<style name="DialogAnimScale" parent="@android:style/Animation">
<item name="android:windowEnterAnimation">@anim/scale_in</item>
<item name="android:windowExitAnimation">@anim/scale_out</item>
</style>
<style name="CustomCheckboxTheme" parent="@android:style/Widget.CompoundButton.CheckBox">
<item name="android:button">@drawable/checkbox_style</item>
</style>
......
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