Commit ed40ff6f authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 4aaa457d
...@@ -17,6 +17,7 @@ data class HotStyleTypesList( ...@@ -17,6 +17,7 @@ data class HotStyleTypesList(
@Parcelize @Parcelize
data class HotStyleTypesBean( data class HotStyleTypesBean(
var type: String = "", var type: String = "",
var typeId: Int = 0,
var torder: Int = 0 var torder: Int = 0
) : Parcelable ) : Parcelable
...@@ -12,13 +12,16 @@ public class VedioBean implements Serializable { ...@@ -12,13 +12,16 @@ public class VedioBean implements Serializable {
private String topTabsReamrk; private String topTabsReamrk;
private ArrayList<String> orderTags;//标签 private ArrayList<String> orderTags;//标签
private int vedioTotal;//同穿山甲 total private int vedioTotal;//同穿山甲 total
private int unlockIndex;//解锁剧集
private int seeIndex;//看到哪一集了
private int collect;//0未收藏,1收藏
private String vedioDesc; private String vedioDesc;
private String coverImage; private String coverImage;
private int completeStatus;//完结状态 同穿山接status 0-完结 private int completeStatus;//完结状态 同穿山接status 0-完结
private String scriptName; private String scriptName;
private String scriptAuthor; private String scriptAuthor;
private int vedioId;// 视频id,服务器标识 private int vedioId;// 视频id,服务器标识
private int hot;// 播放量
public String getThirdId() { public String getThirdId() {
return thirdId; return thirdId;
} }
...@@ -122,4 +125,36 @@ public class VedioBean implements Serializable { ...@@ -122,4 +125,36 @@ public class VedioBean implements Serializable {
public void setVedioId(int vedioId) { public void setVedioId(int vedioId) {
this.vedioId = vedioId; this.vedioId = vedioId;
} }
public int getUnlockIndex() {
return unlockIndex;
}
public void setUnlockIndex(int unlockIndex) {
this.unlockIndex = unlockIndex;
}
public int getSeeIndex() {
return seeIndex;
}
public void setSeeIndex(int seeIndex) {
this.seeIndex = seeIndex;
}
public int getCollect() {
return collect;
}
public void setCollect(int collect) {
this.collect = collect;
}
public int getHot() {
return hot;
}
public void setHot(int hot) {
this.hot = hot;
}
} }
...@@ -9,9 +9,9 @@ import com.mints.wisdomclean.mvp.model.BannerList ...@@ -9,9 +9,9 @@ import com.mints.wisdomclean.mvp.model.BannerList
class PicContentPresenter : BasePresenter<PicContentView>() { class PicContentPresenter : BasePresenter<PicContentView>() {
fun getHomePageImageList(type: String, page: Int, pageCount: Int) { fun getHomePageImageList(typeId: Int, page: Int, pageCount: Int) {
val vo = hashMapOf<String, Any>() val vo = hashMapOf<String, Any>()
vo["type"] = type vo["typeId"] = typeId
vo["page"] = page vo["page"] = page
vo["size"] = pageCount vo["size"] = pageCount
......
...@@ -23,7 +23,7 @@ class HomeVideoPageAdapter( ...@@ -23,7 +23,7 @@ class HomeVideoPageAdapter(
val fragment = fragments[position] val fragment = fragments[position]
if (fragment != null) return fragment if (fragment != null) return fragment
val newFragment = MovieFragment.newInstance(data[position].type,position) val newFragment = MovieFragment.newInstance(data[position].typeId,position)
fragments[position] = newFragment fragments[position] = newFragment
return newFragment return newFragment
} }
......
...@@ -39,6 +39,7 @@ class TopAdapter(val topList: MutableList<VedioBean>?) : ...@@ -39,6 +39,7 @@ class TopAdapter(val topList: MutableList<VedioBean>?) :
val topBean = topList?.get(position) val topBean = topList?.get(position)
if (topBean != null) { if (topBean != null) {
holder.tvTopItemLable.text = "${position + 1}" holder.tvTopItemLable.text = "${position + 1}"
holder.tvTopItemCount.text = "${topBean.playCount}万"
holder.tvTopItemTitle.text = "${topBean.title}" holder.tvTopItemTitle.text = "${topBean.title}"
if (topBean.orderTags != null && topBean.orderTags.size > 0) { if (topBean.orderTags != null && topBean.orderTags.size > 0) {
val sb = StringBuilder() val sb = StringBuilder()
...@@ -55,7 +56,6 @@ class TopAdapter(val topList: MutableList<VedioBean>?) : ...@@ -55,7 +56,6 @@ class TopAdapter(val topList: MutableList<VedioBean>?) :
) )
} }
when (position) { when (position) {
0 -> { 0 -> {
holder.tvTopItemLable.setBackgroundResource(R.mipmap.y43) holder.tvTopItemLable.setBackgroundResource(R.mipmap.y43)
......
...@@ -201,24 +201,28 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR ...@@ -201,24 +201,28 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
} }
fun setWatchingStatus() { fun setWatchingStatus() {
// if (LocalVedioManager.isCacheVedio()) { if (LocalVedioManager.isCacheVedio()) {
ll_main_watching_root.visibility = View.VISIBLE ll_main_watching_root.visibility = View.VISIBLE
val cacheVedio = LocalVedioManager.getCacheVedio() val cacheVedio = LocalVedioManager.getCacheVedio()
if (cacheVedio != null) { if (cacheVedio != null) {
GlideUtils.loadImageViewGifForFitCenter(
requireContext(),
cacheVedio.coverImage,
iv_main_watching_pic
)
tv_main_watching_name.text = cacheVedio.title
tv_main_watching_text1.text = "上次观看至第${cacheVedio.completeStatus}集"
if (cacheVedio.orderTags != null && cacheVedio.orderTags.size > 0) {
val sb = StringBuilder()
for (i in 0 until cacheVedio.orderTags.size) {
sb.append(cacheVedio.orderTags.get(i) + " ")
}
tv_main_watching_text2.text = "${sb}"
}
}
} else {
ll_main_watching_root.visibility = View.GONE
} }
GlideUtils.loadImageViewGifForFitCenter(
requireContext(),
"https://mints-pkg.oss-cn-beijing.aliyuncs.com/pkg-bcurd/img/bg_vip_top1.png",
iv_main_watching_pic
)
// tv_main_watching_name.text=""
// tv_main_watching_text1.text=""
// tv_main_watching_text2.text=""
// } else {
// ll_main_watching_root.visibility = View.GONE
// }
} }
override fun getHomeV1MsgSuc(data: HotStyleTypesList) { override fun getHomeV1MsgSuc(data: HotStyleTypesList) {
......
...@@ -20,16 +20,16 @@ import java.util.* ...@@ -20,16 +20,16 @@ import java.util.*
class MovieFragment : LazyLoadBaseFragment(), PicContentView, OnLoadMoreListener { class MovieFragment : LazyLoadBaseFragment(), PicContentView, OnLoadMoreListener {
private var mType = "" private var mType = 0
private var mPosition = 0 // 首页-第一个tab-第一个recyclerview Item private var mPosition = 0 // 首页-第一个tab-第一个recyclerview Item
companion object { companion object {
private const val VIDEO_TYPE = "VIDEO_TYPE" private const val VIDEO_TYPE = "VIDEO_TYPE"
private const val VIDEO_POSITION = "VIDEO_POSITION" private const val VIDEO_POSITION = "VIDEO_POSITION"
fun newInstance(type: String, position: Int): Fragment { fun newInstance(type: Int, position: Int): Fragment {
val args = Bundle() val args = Bundle()
args.putString(VIDEO_TYPE, type) args.putInt(VIDEO_TYPE, type)
args.putInt(VIDEO_POSITION, position) args.putInt(VIDEO_POSITION, position)
val fragment = MovieFragment() val fragment = MovieFragment()
fragment.arguments = args fragment.arguments = args
...@@ -48,7 +48,7 @@ class MovieFragment : LazyLoadBaseFragment(), PicContentView, OnLoadMoreListener ...@@ -48,7 +48,7 @@ class MovieFragment : LazyLoadBaseFragment(), PicContentView, OnLoadMoreListener
override fun initViewsAndEvents() { override fun initViewsAndEvents() {
arguments?.let { arguments?.let {
mType = it.getString(VIDEO_TYPE, mType) mType = it.getInt(VIDEO_TYPE, mType)
mPosition = it.getInt(VIDEO_POSITION, mPosition) mPosition = it.getInt(VIDEO_POSITION, mPosition)
} }
} }
......
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