Commit 9e15f83d authored by mengcuiguang's avatar mengcuiguang

推荐短剧弹窗

parent a18f8964
...@@ -5,9 +5,9 @@ object Constant { ...@@ -5,9 +5,9 @@ object Constant {
const val PAGE_SIZE = 12 const val PAGE_SIZE = 12
const val LOCAL_VEDIO = "LOCAL_VEDIO" const val LOCAL_VEDIO = "LOCAL_VEDIO"
const val VEDIO_BEAN = "VEDIO_BEAN" const val VEDIO_BEAN = "VEDIO_BEAN"
const val RECOMMEND_BEAN = "RECOMMEND_BEAN"
const val VEDIO_NEXT = "VEDIO_NEXT" const val VEDIO_NEXT = "VEDIO_NEXT"
const val VEDIO_THIRD = "VEDIO_THIRD" const val VEDIO_THIRD = "VEDIO_THIRD"
const val VEDIO_SPLASH = "VEDIO_SPLASH"
/** /**
* 首次弹出权限声明 * 首次弹出权限声明
......
...@@ -15,6 +15,7 @@ import com.mints.helivideo.ui.activitys.RecommendActivity ...@@ -15,6 +15,7 @@ import com.mints.helivideo.ui.activitys.RecommendActivity
import com.mints.helivideo.utils.AppPreferencesManager import com.mints.helivideo.utils.AppPreferencesManager
import com.mints.helivideo.utils.ToastUtil import com.mints.helivideo.utils.ToastUtil
import com.mints.helivideo.video.csj.DramaApiDetailActivity import com.mints.helivideo.video.csj.DramaApiDetailActivity
import com.mints.helivideo.video.tx.NewTxVideoActivity
import com.mints.helivideo.video.tx.TxVideoActivity import com.mints.helivideo.video.tx.TxVideoActivity
/** /**
...@@ -106,6 +107,11 @@ object LocalVedioManager { ...@@ -106,6 +107,11 @@ object LocalVedioManager {
bundle.putBoolean(Constant.VEDIO_NEXT, isPlayNext) bundle.putBoolean(Constant.VEDIO_NEXT, isPlayNext)
bundle.putBoolean(Constant.VEDIO_THIRD, isThirdId) bundle.putBoolean(Constant.VEDIO_THIRD, isThirdId)
readyGo(activity, TxVideoActivity::class.java, bundle) readyGo(activity, TxVideoActivity::class.java, bundle)
} else if (data?.createType == 3) {
//推荐短剧
val bundle = Bundle()
bundle.putString(Constant.VEDIO_BEAN, JsonUtil.toJson(data))
readyGo(activity, NewTxVideoActivity::class.java, bundle)
} else { } else {
requestDrama(activity, data) requestDrama(activity, data)
} }
......
...@@ -41,7 +41,7 @@ class RecommendActivity : BaseActivity(), View.OnClickListener { ...@@ -41,7 +41,7 @@ class RecommendActivity : BaseActivity(), View.OnClickListener {
override fun getBundleExtras(extras: Bundle?) { override fun getBundleExtras(extras: Bundle?) {
super.getBundleExtras(extras) super.getBundleExtras(extras)
extras?.let { extras?.let {
val json = extras.getString(Constant.VEDIO_BEAN) val json = extras.getString(Constant.RECOMMEND_BEAN)
recommendBean = Gson().fromJson(json, RecommendBean::class.java) recommendBean = Gson().fromJson(json, RecommendBean::class.java)
} }
} }
...@@ -74,11 +74,15 @@ class RecommendActivity : BaseActivity(), View.OnClickListener { ...@@ -74,11 +74,15 @@ class RecommendActivity : BaseActivity(), View.OnClickListener {
baseItemView.hideEmptyView() baseItemView.hideEmptyView()
baseItemView.setTXVodPlayer(txVodPlayerWrapper) baseItemView.setTXVodPlayer(txVodPlayerWrapper)
baseItemView.startPlay() baseItemView.startPlay()
tv_recommend_name.text = recommendBean?.vedioMsg?.title
tv_recommend_text.text =
"${recommendBean?.vedioMsg?.title}热播中共${recommendBean?.vedioMsg?.vedioTotal}集"
} }
private fun initListener() { private fun initListener() {
ic_recommend_quit.setOnClickListener(this) ic_recommend_quit.setOnClickListener(this)
fl_recommend_next.setOnClickListener(this) btn_recommend_next.setOnClickListener(this)
} }
override fun onResume() { override fun onResume() {
...@@ -112,7 +116,7 @@ class RecommendActivity : BaseActivity(), View.OnClickListener { ...@@ -112,7 +116,7 @@ class RecommendActivity : BaseActivity(), View.OnClickListener {
R.id.ic_recommend_quit -> { R.id.ic_recommend_quit -> {
finish() finish()
} }
R.id.fl_recommend_next -> { R.id.btn_recommend_next -> {
val bundle = Bundle() val bundle = Bundle()
bundle.putString(Constant.VEDIO_BEAN, JsonUtil.toJson(recommendBean?.vedioMsg)) bundle.putString(Constant.VEDIO_BEAN, JsonUtil.toJson(recommendBean?.vedioMsg))
readyGoThenKill(NewTxVideoActivity::class.java, bundle) readyGoThenKill(NewTxVideoActivity::class.java, bundle)
......
...@@ -378,7 +378,7 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR ...@@ -378,7 +378,7 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
* 展示推荐弹窗 * 展示推荐弹窗
*/ */
private fun showRecommendAct(data: RecoBean?) { private fun showRecommendAct(data: RecoBean?) {
if (data == null||data.vedio3==null) return if (data == null || data.vedio3 == null) return
if (AppConfig.enterVipAct) { if (AppConfig.enterVipAct) {
AppConfig.enterVipAct = false AppConfig.enterVipAct = false
...@@ -388,11 +388,12 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR ...@@ -388,11 +388,12 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
val mainFirstRecommend = val mainFirstRecommend =
AppPreferencesManager.get().getBoolean(Constant.MAIN_FIRST_RECOMMEND, false) AppPreferencesManager.get().getBoolean(Constant.MAIN_FIRST_RECOMMEND, false)
if (!mainFirstRecommend) { if (!mainFirstRecommend) {
// if (mainFirstRecommend) {
AppPreferencesManager.get().put(Constant.MAIN_FIRST_RECOMMEND, true) AppPreferencesManager.get().put(Constant.MAIN_FIRST_RECOMMEND, true)
Handler(Looper.getMainLooper()).postDelayed({ Handler(Looper.getMainLooper()).postDelayed({
val bundle = Bundle() val bundle = Bundle()
bundle.putString(Constant.VEDIO_BEAN, JsonUtil.toJson(data.vedio3)) bundle.putString(Constant.RECOMMEND_BEAN, JsonUtil.toJson(data.vedio3))
readyGo(RecommendActivity::class.java, bundle) readyGo(RecommendActivity::class.java, bundle)
}, 300) }, 300)
return return
...@@ -402,16 +403,14 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR ...@@ -402,16 +403,14 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
val mainTwoRecommend = val mainTwoRecommend =
AppPreferencesManager.get().getBoolean(Constant.MAIN_TWO_RECOMMEND, false) AppPreferencesManager.get().getBoolean(Constant.MAIN_TWO_RECOMMEND, false)
val adCount = AppPreferencesManager.get().getInt(Constant.VEDIO_AD_COUNT, 0) val adCount = AppPreferencesManager.get().getInt(Constant.VEDIO_AD_COUNT, 0)
if (!mainTwoRecommend && adCount > data!!.vedio3.adShowCount) { if (!mainTwoRecommend && adCount > data.vedio3.adShowCount) {
AppPreferencesManager.get().put(Constant.MAIN_TWO_RECOMMEND, true) AppPreferencesManager.get().put(Constant.MAIN_TWO_RECOMMEND, true)
Handler(Looper.getMainLooper()).postDelayed({ Handler(Looper.getMainLooper()).postDelayed({
val bundle = Bundle() val bundle = Bundle()
bundle.putString(Constant.VEDIO_BEAN, JsonUtil.toJson(data.vedio3)) bundle.putString(Constant.RECOMMEND_BEAN, JsonUtil.toJson(data.vedio3))
readyGo(RecommendActivity::class.java, bundle) readyGo(RecommendActivity::class.java, bundle)
}, 300) }, 300)
} }
// println("mcg -->>>>>: mainFirstRecommend=${mainFirstRecommend} , mainTwoRecommend=${mainTwoRecommend} , adCount=${adCount}")
} }
} }
} }
......
...@@ -12,11 +12,18 @@ ...@@ -12,11 +12,18 @@
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:orientation="vertical"> android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginBottom="8dp"
android:text="刚刚看的"
android:textColor="@color/white"
android:textSize="18sp" />
<RelativeLayout <RelativeLayout
android:layout_width="330dp" android:layout_width="310dp"
android:layout_height="420dp"> android:layout_height="440dp">
<androidx.cardview.widget.CardView <androidx.cardview.widget.CardView
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -29,12 +36,40 @@ ...@@ -29,12 +36,40 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent" />
<TextView
android:id="@+id/tv_recommend_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginLeft="14dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="65dp"
android:singleLine="true"
android:textColor="@color/white"
android:textSize="14sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_recommend_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginLeft="14dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="35dp"
android:drawableLeft="@mipmap/ic_recommend_vedio"
android:drawablePadding="2dp"
android:gravity="center_vertical"
android:singleLine="true"
android:textColor="@color/white"
android:textSize="12sp" />
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>
<ImageView <ImageView
android:id="@+id/ic_recommend_quit" android:id="@+id/ic_recommend_quit"
android:layout_width="60dp" android:layout_width="50dp"
android:layout_height="60dp" android:layout_height="50dp"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_gravity="end" android:layout_gravity="end"
android:layout_marginTop="2dp" android:layout_marginTop="2dp"
...@@ -42,10 +77,11 @@ ...@@ -42,10 +77,11 @@
android:padding="10dp" android:padding="10dp"
android:scaleType="centerCrop" android:scaleType="centerCrop"
android:src="@mipmap/ic_quit_yuan" /> android:src="@mipmap/ic_quit_yuan" />
</RelativeLayout> </RelativeLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/fl_recommend_next"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="100dp" android:layout_height="100dp"
android:layout_marginTop="10dp"> android:layout_marginTop="10dp">
...@@ -58,6 +94,7 @@ ...@@ -58,6 +94,7 @@
android:scaleType="centerCrop" /> android:scaleType="centerCrop" />
<Button <Button
android:id="@+id/btn_recommend_next"
android:layout_width="260dp" android:layout_width="260dp"
android:layout_height="50dp" android:layout_height="50dp"
android:layout_centerInParent="true" android:layout_centerInParent="true"
......
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