Commit fa964b8c authored by mengcuiguang's avatar mengcuiguang

添加匹配接口

parent fd0785a0
......@@ -105,8 +105,8 @@ object LocalVedioManager {
bundle.putString(Constant.VEDIO_BEAN, JsonUtil.toJson(data))
bundle.putBoolean(Constant.VEDIO_NEXT, isPlayNext)
bundle.putBoolean(Constant.VEDIO_THIRD, isThirdId)
// readyGo(activity, TxVideoActivity::class.java, bundle)
readyGo(activity, RecommendActivity::class.java, bundle)
readyGo(activity, TxVideoActivity::class.java, bundle)
// readyGo(activity, RecommendActivity::class.java, bundle)
} else {
requestDrama(activity, data)
}
......
package com.mints.helivideo.mvp.model;
import java.io.Serializable;
public class RecoBean implements Serializable {
private RecommendBean vedio3;
public RecommendBean getVedio3() {
return vedio3;
}
public void setVedio3(RecommendBean vedio3) {
this.vedio3 = vedio3;
}
}
package com.mints.helivideo.mvp.model;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
public class RecommendBean implements Serializable {
private VedioBean vedioMsg;
private String showVedioUrl;
public VedioBean getVedioMsg() {
return vedioMsg;
}
public void setVedioMsg(VedioBean vedioMsg) {
this.vedioMsg = vedioMsg;
}
public String getShowVedioUrl() {
return showVedioUrl;
}
public void setShowVedioUrl(String showVedioUrl) {
this.showVedioUrl = showVedioUrl;
}
}
......@@ -255,7 +255,7 @@ class HomePresenter : BasePresenter<HomeView>() {
fun getRecommendVedio() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.getRecommendVedio(),
object : BaseSubscriber<BaseResponse<IndexList>>() {
object : BaseSubscriber<BaseResponse<RecoBean>>() {
override fun onCompleted() {
if (isLinkView) return
}
......@@ -264,11 +264,10 @@ class HomePresenter : BasePresenter<HomeView>() {
if (isLinkView) return
}
override fun onNext(baseResponse: BaseResponse<IndexList>) {
override fun onNext(baseResponse: BaseResponse<RecoBean>) {
if (isLinkView) return
val code = baseResponse.status
val message = baseResponse.message
when (code) {
200 -> {
......
package com.mints.helivideo.mvp.views
import com.mints.helivideo.mvp.model.BannerList
import com.mints.helivideo.mvp.model.HotStyleTypesList
import com.mints.helivideo.mvp.model.IndexList
import com.mints.helivideo.mvp.model.NineShowBean
import com.mints.helivideo.mvp.model.*
interface HomeView : BaseView {
......@@ -11,7 +8,7 @@ interface HomeView : BaseView {
fun topTabsSuc(data: BannerList?)
fun ordersSuc(data: BannerList?)
fun getSoltVedioSuc(data: IndexList?)
fun getRecommendVedioSuc(data: IndexList?)
fun getRecommendVedioSuc(data: RecoBean?)
fun showTurnSuc(data: NineShowBean)
}
......@@ -13,6 +13,7 @@ import com.mints.helivideo.mvp.model.IndexList;
import com.mints.helivideo.mvp.model.NineListBean;
import com.mints.helivideo.mvp.model.NineShowBean;
import com.mints.helivideo.mvp.model.OrderRecordBean;
import com.mints.helivideo.mvp.model.RecoBean;
import com.mints.helivideo.mvp.model.UserBean;
import com.mints.helivideo.mvp.model.VedioBean;
import com.mints.helivideo.mvp.model.Version;
......@@ -280,8 +281,8 @@ public interface LoanService {
/**
* 匹配推荐
*/
@POST("api/vedio/firstVedio")
Observable<BaseResponse<IndexList>> getRecommendVedio();
@POST("api/vedio/vedio3Msg")
Observable<BaseResponse<RecoBean>> getRecommendVedio();
/**
* 9宫格信息
......
......@@ -6,9 +6,8 @@ import android.view.View
import com.google.gson.Gson
import com.mints.helivideo.R
import com.mints.helivideo.common.Constant
import com.mints.helivideo.mvp.model.VedioBean
import com.mints.helivideo.mvp.model.RecommendBean
import com.mints.helivideo.ui.activitys.base.BaseActivity
import com.mints.helivideo.utils.LogUtil
import com.mints.helivideo.video.tx.TXVodPlayerWrapper
import com.mints.helivideo.video.tx.VideoModel
import com.mints.library.utils.nodoubleclick.AntiShake
......@@ -20,7 +19,7 @@ import kotlinx.android.synthetic.main.activity_recommend.*
*/
class RecommendActivity : BaseActivity(), View.OnClickListener {
private var mVedioBean: VedioBean? = null
private var recommendBean: RecommendBean? = null
override fun getContentViewLayoutID() = R.layout.activity_recommend
......@@ -34,7 +33,7 @@ class RecommendActivity : BaseActivity(), View.OnClickListener {
super.getBundleExtras(extras)
extras?.let {
val json = extras.getString(Constant.VEDIO_BEAN)
mVedioBean = Gson().fromJson(json, VedioBean::class.java)
recommendBean = Gson().fromJson(json, RecommendBean::class.java)
}
}
......@@ -44,7 +43,7 @@ class RecommendActivity : BaseActivity(), View.OnClickListener {
}
private fun initView() {
val videoModel = VideoModel(mVedioBean!!.recommendUrl)
val videoModel = VideoModel(recommendBean?.showVedioUrl)
val txVodPlayerWrapper = TXVodPlayerWrapper(mContext)
txVodPlayerWrapper.preStartPlay(videoModel)
baseItemView.setTXVodPlayer(txVodPlayerWrapper)
......
......@@ -60,7 +60,7 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
private val topList = mutableListOf<VedioBean>()
private var vpAdapter: HomeVideoPageAdapter? = null
private var topAdapter: TopAdapter? = null
private var recommendVedioBean: VedioBean? = null
private var recommendVedioBean: RecoBean? = null
private val homePresenter by lazy { HomePresenter() }
......@@ -113,9 +113,10 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_ONE) {
if (AntiShake.check(banner?.id)) return
if (!UserManager.getInstance().vipFlag) {
BannerManager.loadAd(requireActivity(), fl_main_banner)
}
// if (!UserManager.getInstance().vipFlag) {
// BannerManager.loadAd(requireActivity(), fl_main_banner)
// }
BannerManager.loadAd(requireActivity(), fl_main_banner)
if (AppConfig.exitLoginMainRefresh) {
AppConfig.exitLoginMainRefresh = false
......@@ -332,8 +333,8 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
}
}
override fun getRecommendVedioSuc(data: IndexList?) {
this.recommendVedioBean = data?.vedioMsg
override fun getRecommendVedioSuc(data: RecoBean?) {
this.recommendVedioBean = data
}
......@@ -376,7 +377,7 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
/**
* 展示推荐弹窗
*/
private fun showRecommendAct(data: VedioBean?) {
private fun showRecommendAct(data: RecoBean?) {
if (data == null) return
if (AppConfig.enterVipAct) {
......@@ -391,7 +392,7 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
Handler(Looper.getMainLooper()).postDelayed({
val bundle = Bundle()
bundle.putString(Constant.VEDIO_BEAN, JsonUtil.toJson(data))
bundle.putString(Constant.VEDIO_BEAN, JsonUtil.toJson(data.vedio3))
readyGo(RecommendActivity::class.java, bundle)
}, 300)
return
......
......@@ -149,8 +149,6 @@ class MovieFragment : LazyLoadBaseFragment(), PicContentView, OnLoadMoreListener
}
private fun loadAd() {
if (UserManager.getInstance().vipFlag) return
MainExpressManager.instance.loadAd(object : ExpressAdCallback {
override fun loadSuccess(adView: FrameLayout?) {
......
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