Commit ed40ff6f authored by mengcuiguang's avatar mengcuiguang

代码优化

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