Commit 82b81677 authored by jyx's avatar jyx

代码优化

parent d11f9277
...@@ -15,6 +15,7 @@ import com.mints.wisdomclean.BuildConfig; ...@@ -15,6 +15,7 @@ import com.mints.wisdomclean.BuildConfig;
import com.mints.wisdomclean.MintsApplication; import com.mints.wisdomclean.MintsApplication;
import com.mints.wisdomclean.common.Constant; import com.mints.wisdomclean.common.Constant;
import com.mints.wisdomclean.utils.DeviceUuidFactory; import com.mints.wisdomclean.utils.DeviceUuidFactory;
import com.mints.wisdomclean.video.DPHolderManager;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
...@@ -45,6 +46,9 @@ public class TTGroMoreAdManagerHolder { ...@@ -45,6 +46,9 @@ public class TTGroMoreAdManagerHolder {
if (!sInit) { if (!sInit) {
GMMediationAdSdk.initialize(context, buildV2Config(context)); GMMediationAdSdk.initialize(context, buildV2Config(context));
sInit = true; sInit = true;
// 初始化短剧SDK
DPHolderManager.INSTANCE.initDpSdk(context);
} }
} }
......
...@@ -4,7 +4,6 @@ import android.app.Activity ...@@ -4,7 +4,6 @@ import android.app.Activity
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.text.TextUtils import android.text.TextUtils
import com.bytedance.sdk.dp.utils.JSON
import com.mints.library.utils.json.JsonUtil import com.mints.library.utils.json.JsonUtil
import com.mints.wisdomclean.common.Constant import com.mints.wisdomclean.common.Constant
import com.mints.wisdomclean.mvp.model.VedioBean import com.mints.wisdomclean.mvp.model.VedioBean
......
package com.mints.wisdomclean.mvp.presenters package com.mints.wisdomclean.mvp.presenters
import com.google.gson.JsonObject
import com.mints.library.net.neterror.BaseSubscriber
import com.mints.library.net.neterror.Throwable
import com.mints.wisdomclean.manager.AppHttpManager
import com.mints.wisdomclean.mvp.model.BannerList
import com.mints.wisdomclean.mvp.model.BaseResponse
import com.mints.wisdomclean.mvp.views.FollowView import com.mints.wisdomclean.mvp.views.FollowView
import java.util.HashMap
class FollowPresenter : BasePresenter<FollowView>() { class FollowPresenter : BasePresenter<FollowView>() {
fun getCollectList(videoId: String) {
val vo = HashMap<String, Any>()
vo["videoId"] = videoId
AppHttpManager.getInstance(loanApplication)
.call(loanService.collectList(vo),
object : BaseSubscriber<BaseResponse<BannerList>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onNext(baseResponse: BaseResponse<BannerList>) {
if (isLinkView) return
view.hideLoading()
val code = baseResponse.status
val message = baseResponse.message
when (code) {
200 -> view.getCollectListSuc(baseResponse.data)
else -> {
view.getCollectListFail()
view.showToast(message)
}
}
}
override fun onError(e: Throwable?) {
if (isLinkView) return
view.hideLoading()
view.showToast(e?.message)
view.getCollectListFail()
}
})
}
fun cancelCollect(videoId: String) {
val vo = HashMap<String, Any>()
vo["videoId"] = videoId
AppHttpManager.getInstance(loanApplication)
.call(
loanService.cancelCollect(vo),
object : BaseSubscriber<BaseResponse<JsonObject>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onNext(baseResponse: BaseResponse<JsonObject>) {
if (isLinkView) return
view.hideLoading()
val code = baseResponse.status
val message = baseResponse.message
when (code) {
200 -> view.cancelCollectSuc()
else -> {
view.cancelCollectFail()
view.showToast(message)
}
}
}
override fun onError(e: Throwable?) {
if (isLinkView) return
view.hideLoading()
view.showToast(e?.message)
view.cancelCollectFail()
}
})
}
} }
\ No newline at end of file
package com.mints.wisdomclean.mvp.presenters package com.mints.wisdomclean.mvp.presenters
import com.google.gson.JsonObject
import com.mints.library.net.neterror.BaseSubscriber
import com.mints.library.net.neterror.Throwable
import com.mints.wisdomclean.manager.AppHttpManager
import com.mints.wisdomclean.mvp.model.BaseResponse
import com.mints.wisdomclean.mvp.views.RecommendView import com.mints.wisdomclean.mvp.views.RecommendView
import java.util.HashMap
class RecommendPresenter : BasePresenter<RecommendView>() { class RecommendPresenter : BasePresenter<RecommendView>() {
fun collect(videoId: String) {
val vo = HashMap<String, Any>()
vo["videoId"] = videoId
AppHttpManager.getInstance(loanApplication)
.call(loanService.collect(vo), object : BaseSubscriber<BaseResponse<JsonObject>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onNext(baseResponse: BaseResponse<JsonObject>) {
if (isLinkView) return
view.hideLoading()
val code = baseResponse.status
val message = baseResponse.message
when (code) {
200 -> view.collectSuc()
else -> {
view.collectFail()
view.showToast(message)
}
}
}
override fun onError(e: Throwable?) {
if (isLinkView) return
view.hideLoading()
view.showToast(e?.message)
view.collectFail()
}
})
}
fun cancelCollect(videoId: String) {
val vo = HashMap<String, Any>()
vo["videoId"] = videoId
AppHttpManager.getInstance(loanApplication)
.call(
loanService.cancelCollect(vo),
object : BaseSubscriber<BaseResponse<JsonObject>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onNext(baseResponse: BaseResponse<JsonObject>) {
if (isLinkView) return
view.hideLoading()
val code = baseResponse.status
val message = baseResponse.message
when (code) {
200 -> view.cancelCollectSuc()
else -> {
view.cancelCollectFail()
view.showToast(message)
}
}
}
override fun onError(e: Throwable?) {
if (isLinkView) return
view.hideLoading()
view.showToast(e?.message)
view.cancelCollectFail()
}
})
}
} }
\ No newline at end of file
package com.mints.wisdomclean.mvp.presenters
import com.mints.library.net.neterror.BaseSubscriber
import com.mints.library.net.neterror.Throwable
import com.mints.wisdomclean.manager.AppHttpManager
import com.mints.wisdomclean.mvp.model.BannerList
import com.mints.wisdomclean.mvp.model.BaseResponse
import com.mints.wisdomclean.mvp.views.VideoView
import java.util.HashMap
class VideoPresenter : BasePresenter<VideoView>() {
fun getIndexList(videoId: String) {
val vo = HashMap<String, Any>()
vo["videoId"] = videoId
AppHttpManager.getInstance(loanApplication)
.call(loanService.getIndexList(vo),
object : BaseSubscriber<BaseResponse<BannerList>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onNext(baseResponse: BaseResponse<BannerList>) {
if (isLinkView) return
view.hideLoading()
val code = baseResponse.status
val message = baseResponse.message
when (code) {
200 -> view.getIndexListSuc()
else -> {
view.getIndexListFail()
view.showToast(message)
}
}
}
override fun onError(e: Throwable?) {
if (isLinkView) return
view.hideLoading()
view.showToast(e?.message)
view.getIndexListFail()
}
})
}
}
\ No newline at end of file
package com.mints.wisdomclean.mvp.presenters package com.mints.wisdomclean.mvp.presenters
import com.google.gson.JsonObject
import com.mints.library.net.neterror.BaseSubscriber
import com.mints.library.net.neterror.Throwable
import com.mints.wisdomclean.manager.AppHttpManager
import com.mints.wisdomclean.mvp.model.BannerList
import com.mints.wisdomclean.mvp.model.BaseResponse
import com.mints.wisdomclean.mvp.views.WatchRecordView import com.mints.wisdomclean.mvp.views.WatchRecordView
import java.util.HashMap
class WatchRecordPresenter : BasePresenter<WatchRecordView>() { class WatchRecordPresenter : BasePresenter<WatchRecordView>() {
fun getHistory() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.history(), object : BaseSubscriber<BaseResponse<BannerList>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onNext(baseResponse: BaseResponse<BannerList>) {
if (isLinkView) return
view.hideLoading()
val code = baseResponse.status
val message = baseResponse.message
when (code) {
200 -> view.getHistorySuc(baseResponse.data)
else -> {
view.getHistoryFail()
view.showToast(message)
}
}
}
override fun onError(e: Throwable?) {
if (isLinkView) return
view.hideLoading()
view.showToast(e?.message)
view.getHistoryFail()
}
})
}
fun collect(videoId: String) {
val vo = HashMap<String, Any>()
vo["videoId"] = videoId
AppHttpManager.getInstance(loanApplication)
.call(loanService.collect(vo), object : BaseSubscriber<BaseResponse<JsonObject>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onNext(baseResponse: BaseResponse<JsonObject>) {
if (isLinkView) return
view.hideLoading()
val code = baseResponse.status
val message = baseResponse.message
when (code) {
200 -> view.collectSuc()
else -> {
view.collectFail()
view.showToast(message)
}
}
}
override fun onError(e: Throwable?) {
if (isLinkView) return
view.hideLoading()
view.showToast(e?.message)
view.collectFail()
}
})
}
fun cancelCollect(videoId: String) {
val vo = HashMap<String, Any>()
vo["videoId"] = videoId
AppHttpManager.getInstance(loanApplication)
.call(
loanService.cancelCollect(vo),
object : BaseSubscriber<BaseResponse<JsonObject>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onNext(baseResponse: BaseResponse<JsonObject>) {
if (isLinkView) return
view.hideLoading()
val code = baseResponse.status
val message = baseResponse.message
when (code) {
200 -> view.cancelCollectSuc()
else -> {
view.cancelCollectFail()
view.showToast(message)
}
}
}
override fun onError(e: Throwable?) {
if (isLinkView) return
view.hideLoading()
view.showToast(e?.message)
view.cancelCollectFail()
}
})
}
} }
\ No newline at end of file
package com.mints.wisdomclean.mvp.views package com.mints.wisdomclean.mvp.views
import com.mints.wisdomclean.mvp.model.BannerList
interface FollowView : BaseView { interface FollowView : BaseView {
fun getCollectListSuc(bannerList: BannerList)
fun getCollectListFail()
fun cancelCollectSuc()
fun cancelCollectFail()
} }
\ No newline at end of file
...@@ -3,4 +3,10 @@ package com.mints.wisdomclean.mvp.views ...@@ -3,4 +3,10 @@ package com.mints.wisdomclean.mvp.views
interface RecommendView : BaseView { interface RecommendView : BaseView {
fun collectSuc()
fun collectFail()
fun cancelCollectSuc()
fun cancelCollectFail()
} }
\ No newline at end of file
package com.mints.wisdomclean.mvp.views
interface VideoView : BaseView {
fun getIndexListSuc()
fun getIndexListFail()
}
\ No newline at end of file
package com.mints.wisdomclean.mvp.views package com.mints.wisdomclean.mvp.views
import com.mints.wisdomclean.mvp.model.BannerList
interface WatchRecordView : BaseView { interface WatchRecordView : BaseView {
fun getHistorySuc(historyBean: BannerList)
fun getHistoryFail()
fun collectSuc()
fun collectFail()
fun cancelCollectSuc()
fun cancelCollectFail()
} }
\ No newline at end of file
...@@ -192,6 +192,63 @@ public interface LoanService { ...@@ -192,6 +192,63 @@ public interface LoanService {
@POST("api/vedio/orders") @POST("api/vedio/orders")
Observable<BaseResponse<BannerList>> orders(); Observable<BaseResponse<BannerList>> orders();
/**
* 剧情列表
*
* @return
*/
@POST("api/vedio/getIndexList")
Observable<BaseResponse<Object>> getIndexList(@Body Map<String, Object> vo);
/**
* 播放链接
*
* @return
*/
@POST("api/vedio/getIndex")
Observable<BaseResponse<Object>> getIndex(@Body Map<String, Object> vo);
/**
* 收藏
*
* @return
*/
@POST("api/vedio/collect")
Observable<BaseResponse<Object>> collect(@Body Map<String, Object> vo);
/**
* 取消收藏
*
* @return
*/
@POST("api/vedio/cancelCollect")
Observable<BaseResponse<Object>> cancelCollect(@Body Map<String, Object> vo);
/**
* 收藏记录
*
* @return
*/
@POST("api/vedio/collectList")
Observable<BaseResponse<BannerList>> collectList(@Body Map<String, Object> vo);
/**
* 最新一条记录
*
* @return
*/
@POST("api/url/newestRecord")
Observable<BaseResponse<Object>> newestRecord();
/**
* 历史记录
*
* @return
*/
@POST("api/vedio/history")
Observable<BaseResponse<Object>> history();
/** /**
* 提交视频信息 * 提交视频信息
*/ */
......
...@@ -291,6 +291,12 @@ class MainActivity : BaseActivity(), View.OnClickListener { ...@@ -291,6 +291,12 @@ class MainActivity : BaseActivity(), View.OnClickListener {
} }
} }
fun changeRecommendTab(index: Int) {
recommendFragment?.apply {
(this as RecommendFragment).changeTab(index)
}
}
fun showEdit(isEdit: Boolean) { fun showEdit(isEdit: Boolean) {
if (isEdit) { if (isEdit) {
ll_edit.visibility = View.VISIBLE ll_edit.visibility = View.VISIBLE
......
...@@ -3,6 +3,7 @@ package com.mints.wisdomclean.ui.activitys ...@@ -3,6 +3,7 @@ package com.mints.wisdomclean.ui.activitys
import android.view.View import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.mints.wisdomclean.R import com.mints.wisdomclean.R
import com.mints.wisdomclean.mvp.model.BannerList
import com.mints.wisdomclean.mvp.model.WatchRecordBean import com.mints.wisdomclean.mvp.model.WatchRecordBean
import com.mints.wisdomclean.mvp.presenters.WatchRecordPresenter import com.mints.wisdomclean.mvp.presenters.WatchRecordPresenter
import com.mints.wisdomclean.mvp.views.WatchRecordView import com.mints.wisdomclean.mvp.views.WatchRecordView
...@@ -61,4 +62,28 @@ class WatchRecordActivity : BaseActivity(), WatchRecordView { ...@@ -61,4 +62,28 @@ class WatchRecordActivity : BaseActivity(), WatchRecordView {
watchRecordPresenter.detachView() watchRecordPresenter.detachView()
} }
override fun getHistorySuc(historyBean: BannerList) {
}
override fun getHistoryFail() {
}
override fun collectSuc() {
}
override fun collectFail() {
}
override fun cancelCollectSuc() {
}
override fun cancelCollectFail() {
}
} }
\ No newline at end of file
...@@ -2,9 +2,12 @@ package com.mints.wisdomclean.ui.adapter ...@@ -2,9 +2,12 @@ package com.mints.wisdomclean.ui.adapter
import android.app.Activity import android.app.Activity
import android.view.View import android.view.View
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.mints.library.utils.GlideUtils
import com.mints.wisdomclean.R import com.mints.wisdomclean.R
import com.mints.wisdomclean.mvp.model.VedioBean
/** /**
* @author Assen * @author Assen
...@@ -12,13 +15,17 @@ import com.mints.wisdomclean.R ...@@ -12,13 +15,17 @@ import com.mints.wisdomclean.R
* @desc * @desc
*/ */
class FollowAdapter(var activity: Activity) : class FollowAdapter(var activity: Activity) :
BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_follow) { BaseQuickAdapter<VedioBean, BaseViewHolder>(R.layout.item_follow) {
private var showEdit = false private var showEdit = false
override fun convert(holder: BaseViewHolder, item: String) { override fun convert(holder: BaseViewHolder, item: VedioBean) {
holder.getView<View>(R.id.fm_mask).visibility = if (showEdit) View.VISIBLE else View.GONE holder.getView<View>(R.id.fm_mask).visibility = if (showEdit) View.VISIBLE else View.GONE
holder.getView<TextView>(R.id.title_tv).text = item.title
holder.getView<TextView>(R.id.info_tv).text = item.scriptName
holder.getView<TextView>(R.id.complete_tv).text =
if (item.completeStatus == 0) "已完结" else "更新中"
GlideUtils.loadImageViewNoAnim(context, item.coverImage, holder.getView(R.id.image_iv))
} }
// 设置编辑状态 // 设置编辑状态
......
...@@ -6,8 +6,11 @@ import android.view.View ...@@ -6,8 +6,11 @@ import android.view.View
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.GridLayoutManager
import com.mints.wisdomclean.R import com.mints.wisdomclean.R
import com.mints.wisdomclean.mvp.model.BannerList
import com.mints.wisdomclean.mvp.model.VedioBean
import com.mints.wisdomclean.mvp.presenters.FollowPresenter import com.mints.wisdomclean.mvp.presenters.FollowPresenter
import com.mints.wisdomclean.mvp.views.FollowView import com.mints.wisdomclean.mvp.views.FollowView
import com.mints.wisdomclean.ui.activitys.MainActivity
import com.mints.wisdomclean.ui.adapter.FollowAdapter import com.mints.wisdomclean.ui.adapter.FollowAdapter
import com.mints.wisdomclean.ui.fragment.base.BaseFragment import com.mints.wisdomclean.ui.fragment.base.BaseFragment
import kotlinx.android.synthetic.main.fragment_follow_video.* import kotlinx.android.synthetic.main.fragment_follow_video.*
...@@ -21,7 +24,7 @@ class FollowVideoFragment : BaseFragment(), FollowView { ...@@ -21,7 +24,7 @@ class FollowVideoFragment : BaseFragment(), FollowView {
private val followPresenter by lazy { FollowPresenter() } private val followPresenter by lazy { FollowPresenter() }
private val datas = arrayListOf<String>() private val datas = arrayListOf<VedioBean>()
lateinit var followAdapter: FollowAdapter lateinit var followAdapter: FollowAdapter
companion object { companion object {
...@@ -33,6 +36,10 @@ class FollowVideoFragment : BaseFragment(), FollowView { ...@@ -33,6 +36,10 @@ class FollowVideoFragment : BaseFragment(), FollowView {
} }
} }
override fun onResume() {
super.onResume()
}
override fun initViewsAndEvents() { override fun initViewsAndEvents() {
followPresenter.attachView(this) followPresenter.attachView(this)
...@@ -42,13 +49,12 @@ class FollowVideoFragment : BaseFragment(), FollowView { ...@@ -42,13 +49,12 @@ class FollowVideoFragment : BaseFragment(), FollowView {
override fun getContentViewLayoutID() = R.layout.fragment_follow_video override fun getContentViewLayoutID() = R.layout.fragment_follow_video
private fun initRecy() { private fun initRecy() {
datas.add("")
datas.add("")
datas.add("")
val emptyView = val emptyView =
LayoutInflater.from(requireContext()).inflate(R.layout.item_follow_empty, null) LayoutInflater.from(requireContext()).inflate(R.layout.item_follow_empty, null)
emptyView.findViewById<View>(R.id.btn).setOnClickListener { showToast("去剧场") } emptyView.findViewById<View>(R.id.btn).setOnClickListener {
// 去剧场
(requireActivity() as MainActivity).changeRecommendTab(1)
}
rv_follow.layoutManager = GridLayoutManager(requireContext(), 3) rv_follow.layoutManager = GridLayoutManager(requireContext(), 3)
followAdapter = FollowAdapter(requireActivity()) followAdapter = FollowAdapter(requireActivity())
followAdapter.setEmptyView(emptyView) followAdapter.setEmptyView(emptyView)
...@@ -65,4 +71,23 @@ class FollowVideoFragment : BaseFragment(), FollowView { ...@@ -65,4 +71,23 @@ class FollowVideoFragment : BaseFragment(), FollowView {
followPresenter.detachView() followPresenter.detachView()
} }
override fun getCollectListSuc(bannerList: BannerList) {
if (bannerList.list.isNotEmpty()) {
datas.addAll(bannerList.list)
followAdapter.setNewInstance(datas)
}
}
override fun getCollectListFail() {
}
override fun cancelCollectSuc() {
}
override fun cancelCollectFail() {
}
} }
\ No newline at end of file
...@@ -42,8 +42,6 @@ class MyFragment : BaseFragment(), MyView, View.OnClickListener { ...@@ -42,8 +42,6 @@ class MyFragment : BaseFragment(), MyView, View.OnClickListener {
.create() .create()
initListener() initListener()
DPHolderManager.initDpSdk(requireContext())
} }
override fun onHiddenChanged(hidden: Boolean) { override fun onHiddenChanged(hidden: Boolean) {
......
...@@ -171,6 +171,10 @@ class RecommendFragment : BaseFragment(), View.OnClickListener { ...@@ -171,6 +171,10 @@ class RecommendFragment : BaseFragment(), View.OnClickListener {
(fragments[0] as FollowVideoFragment).getAdapter().fullChoice() (fragments[0] as FollowVideoFragment).getAdapter().fullChoice()
} }
fun changeTab(index: Int) {
tab_recommend.getTabAt(index)?.select()
}
fun delete() { fun delete() {
} }
......
...@@ -62,7 +62,10 @@ class WatchVideoFragment : BaseFragment(), RecommendView { ...@@ -62,7 +62,10 @@ class WatchVideoFragment : BaseFragment(), RecommendView {
} }
adapter.setOnVideoCompletion(object : JzvdStdTikTok.OnVideoCompletion { adapter.setOnVideoCompletion(object : JzvdStdTikTok.OnVideoCompletion {
override fun onVideoCompletion() { override fun onVideoCompletion() {
recy.smoothScrollToPosition(mCurrentPosition + 1) showToast("即将为您播放下一集")
val bundle = Bundle()
readyGo(VideoActivity::class.java, bundle)
// recy.smoothScrollToPosition(mCurrentPosition + 1)
} }
}) })
...@@ -262,5 +265,21 @@ class WatchVideoFragment : BaseFragment(), RecommendView { ...@@ -262,5 +265,21 @@ class WatchVideoFragment : BaseFragment(), RecommendView {
recommendPresenter.detachView() recommendPresenter.detachView()
} }
override fun collectSuc() {
}
override fun collectFail() {
}
override fun cancelCollectSuc() {
}
override fun cancelCollectFail() {
}
} }
\ No newline at end of file
...@@ -331,6 +331,7 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic ...@@ -331,6 +331,7 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
"", "",
object : AdStatusListener { object : AdStatusListener {
override fun adSuccess() { override fun adSuccess() {
<<<<<<< Updated upstream
} }
...@@ -347,6 +348,22 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic ...@@ -347,6 +348,22 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
callback?.onDramaRewardArrived() // 解锁当前集 callback?.onDramaRewardArrived() // 解锁当前集
} }
=======
}
override fun adFail() {
}
override fun adClose() {
val hasUnlockList: MutableList<Int> =
mHasUnlockIndexMap[drama.id] ?: mutableListOf()
hasUnlockList.add(widget.currentDramaIndex)
mHasUnlockIndexMap[drama.id] = hasUnlockList
blockView?.visibility = View.GONE
callback?.onDramaRewardArrived() // 解锁当前集
}
>>>>>>> Stashed changes
}) })
......
package com.mints.wisdomclean.video package com.mints.wisdomclean.video
import android.app.Dialog import android.app.Dialog
import android.os.Bundle
import android.view.View import android.view.View
import androidx.recyclerview.widget.OrientationHelper import androidx.recyclerview.widget.OrientationHelper
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import cn.jzvd.Jzvd import cn.jzvd.Jzvd
import com.google.gson.Gson
import com.mints.wisdomclean.R import com.mints.wisdomclean.R
import com.mints.wisdomclean.manager.LocalVedioManager import com.mints.wisdomclean.common.Constant
import com.mints.wisdomclean.mvp.model.VedioBean
import com.mints.wisdomclean.mvp.presenters.VideoPresenter
import com.mints.wisdomclean.mvp.views.VideoView
import com.mints.wisdomclean.ui.activitys.base.BaseActivity import com.mints.wisdomclean.ui.activitys.base.BaseActivity
import com.mints.wisdomclean.ui.widgets.DialogListener import com.mints.wisdomclean.ui.widgets.DialogListener
import com.mints.wisdomclean.ui.widgets.VideoEpisodeDialog import com.mints.wisdomclean.ui.widgets.VideoEpisodeDialog
import kotlinx.android.synthetic.main.activity_video.* import kotlinx.android.synthetic.main.activity_video.*
class VideoActivity : BaseActivity(), View.OnClickListener { class VideoActivity : BaseActivity(), View.OnClickListener, VideoView {
companion object {
const val VIDEO_ID = "VIDEO_ID"
}
lateinit var adapter: VideoAdapter lateinit var adapter: VideoAdapter
private var mCurrentPosition = -1 private var mCurrentPosition = -1
...@@ -24,13 +25,28 @@ class VideoActivity : BaseActivity(), View.OnClickListener { ...@@ -24,13 +25,28 @@ class VideoActivity : BaseActivity(), View.OnClickListener {
private var dialog: VideoEpisodeDialog? = null private var dialog: VideoEpisodeDialog? = null
private val videoPresenter by lazy { VideoPresenter() }
private var mVedioBean: VedioBean? = null
override fun getContentViewLayoutID() = R.layout.activity_video override fun getContentViewLayoutID() = R.layout.activity_video
override fun initViewsAndEvents() { override fun initViewsAndEvents() {
videoPresenter.attachView(this)
mVedioBean?.let { videoPresenter.getIndexList("" + it.vedioId) }
initData() initData()
initView() initView()
} }
override fun getBundleExtras(extras: Bundle?) {
val json = extras?.getString(Constant.VEDIO_BEAN)
mVedioBean = Gson().fromJson(json, VedioBean::class.java)
super.getBundleExtras(extras)
}
override fun isApplyKitKatTranslucency() = false override fun isApplyKitKatTranslucency() = false
override fun onResume() { override fun onResume() {
...@@ -46,6 +62,8 @@ class VideoActivity : BaseActivity(), View.OnClickListener { ...@@ -46,6 +62,8 @@ class VideoActivity : BaseActivity(), View.OnClickListener {
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
Jzvd.releaseAllVideos() Jzvd.releaseAllVideos()
videoPresenter.detachView()
} }
fun initView() { fun initView() {
...@@ -276,4 +294,12 @@ class VideoActivity : BaseActivity(), View.OnClickListener { ...@@ -276,4 +294,12 @@ class VideoActivity : BaseActivity(), View.OnClickListener {
dialog?.show() dialog?.show()
} }
} }
override fun getIndexListSuc() {
}
override fun getIndexListFail() {
}
} }
\ No newline at end of file
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
android:layout_marginLeft="40dp" android:layout_marginLeft="40dp"
android:layout_marginTop="30dp" android:layout_marginTop="30dp"
android:layout_marginRight="40dp" android:layout_marginRight="40dp"
android:background="@drawable/shape_main" android:background="@drawable/shape_red"
android:gravity="center" android:gravity="center"
android:text="提交" android:text="提交"
android:textColor="@color/white" android:textColor="@color/white"
......
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:gravity="center" android:gravity="center"
android:text="获取验证码" android:text="获取验证码"
android:textColor="#F47751" android:textColor="@color/color_FF9837"
android:textSize="12sp" /> android:textSize="12sp" />
</RelativeLayout> </RelativeLayout>
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
android:layout_marginLeft="40dp" android:layout_marginLeft="40dp"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:layout_marginRight="40dp" android:layout_marginRight="40dp"
android:background="@drawable/shape_btn_gold_left" android:background="@drawable/shape_red"
android:gravity="center" android:gravity="center"
android:text="立即登录" android:text="立即登录"
android:textColor="@color/white" android:textColor="@color/white"
...@@ -163,33 +163,34 @@ ...@@ -163,33 +163,34 @@
<CheckBox <CheckBox
android:id="@+id/mobileloginCheck" android:id="@+id/mobileloginCheck"
style="@style/CustomCheckboxTheme"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_marginLeft="20dp" android:layout_height="wrap_content"
android:gravity="center"
android:checked="false"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_height="wrap_content"></CheckBox> android:layout_marginStart="20dp"
android:checked="false"
android:gravity="center" />
<TextView <TextView
android:id="@+id/tvMobileAgreement" android:id="@+id/tvMobileAgreement"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginRight="30dp" android:layout_marginStart="6dp"
android:layout_marginLeft="2dp" android:layout_marginEnd="30dp"
tools:text="123123123123123123123123123123123123123123123123123123123123123123"
android:textColor="#707A8D" android:textColor="#707A8D"
android:textSize="12sp" /> android:textSize="12sp"
tools:text="123123123123123123123123123123123123123123123123123123123123123123" />
</LinearLayout> </LinearLayout>
<TextView <TextView
android:visibility="gone"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:text="你需要先用微信登录,在【个人中心】-【设置】中绑定手机号码,才能使用手机号登录" /> android:text="你需要先用微信登录,在【个人中心】-【设置】中绑定手机号码,才能使用手机号登录"
android:visibility="gone" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -40,9 +40,9 @@ ...@@ -40,9 +40,9 @@
android:paddingEnd="@dimen/dp_10"> android:paddingEnd="@dimen/dp_10">
<ImageView <ImageView
android:layout_width="26dp" android:layout_width="20dp"
android:layout_height="26dp" android:layout_height="20dp"
android:src="@mipmap/ic_call_wx" /> android:src="@mipmap/ic_video_epsiode" />
<TextView <TextView
android:id="@+id/episode_tv" android:id="@+id/episode_tv"
...@@ -54,10 +54,9 @@ ...@@ -54,10 +54,9 @@
android:textColor="@color/white" /> android:textColor="@color/white" />
<ImageView <ImageView
android:layout_width="26dp" android:layout_width="20dp"
android:layout_height="26dp" android:layout_height="20dp"
android:rotation="180" android:src="@mipmap/ic_arrow_top" />
android:src="@mipmap/ic_arrow_bottom" />
</LinearLayout> </LinearLayout>
......
...@@ -29,9 +29,9 @@ ...@@ -29,9 +29,9 @@
android:paddingEnd="@dimen/dp_10"> android:paddingEnd="@dimen/dp_10">
<ImageView <ImageView
android:layout_width="26dp" android:layout_width="20dp"
android:layout_height="26dp" android:layout_height="20dp"
android:src="@mipmap/ic_call_wx" /> android:src="@mipmap/ic_video_epsiode" />
<TextView <TextView
android:id="@+id/episode_tv" android:id="@+id/episode_tv"
...@@ -43,10 +43,9 @@ ...@@ -43,10 +43,9 @@
android:textColor="@color/white" /> android:textColor="@color/white" />
<ImageView <ImageView
android:layout_width="26dp" android:layout_width="20dp"
android:layout_height="26dp" android:layout_height="20dp"
android:rotation="180" android:src="@mipmap/ic_arrow_top" />
android:src="@mipmap/ic_arrow_bottom" />
</LinearLayout> </LinearLayout>
...@@ -111,7 +110,8 @@ ...@@ -111,7 +110,8 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="20dp" android:layout_marginTop="20dp"
android:src="@mipmap/ic_arrow_back" /> android:padding="10dp"
android:src="@mipmap/ic_arrow_white" />
</FrameLayout> </FrameLayout>
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
android:id="@+id/iv_left_icon" android:id="@+id/iv_left_icon"
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="50dp" android:layout_height="50dp"
android:padding="10dp"
android:visibility="gone" android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<TextView <TextView
android:id="@+id/complete_tv"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="6dp" android:layout_marginEnd="6dp"
......
...@@ -64,9 +64,9 @@ ...@@ -64,9 +64,9 @@
android:paddingEnd="15dp"> android:paddingEnd="15dp">
<ImageView <ImageView
android:layout_width="26dp" android:layout_width="20dp"
android:layout_height="26dp" android:layout_height="20dp"
android:src="@mipmap/ic_call_wx" /> android:src="@mipmap/ic_video_epsiode" />
<TextView <TextView
android:id="@+id/episode_tv" android:id="@+id/episode_tv"
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
android:layout_width="50dp" android:layout_width="50dp"
android:layout_height="50dp" android:layout_height="50dp"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:padding="6dp" android:padding="10dp"
android:src="@mipmap/ic_arrow_back" /> android:src="@mipmap/ic_arrow_back" />
<ImageView <ImageView
......
...@@ -82,10 +82,6 @@ ...@@ -82,10 +82,6 @@
<item name="android:button">@drawable/checkbox_style</item> <item name="android:button">@drawable/checkbox_style</item>
</style> </style>
<style name="FollowCheckboxTheme" parent="@android:style/Widget.CompoundButton.CheckBox">
<item name="android:button">@drawable/selector_cb</item>
</style>
<style name="BottomDialog" parent="@android:style/Theme.Dialog"> <style name="BottomDialog" parent="@android:style/Theme.Dialog">
<item name="android:windowTitleStyle">@null</item> <item name="android:windowTitleStyle">@null</item>
<item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowBackground">@android:color/transparent</item>
......
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