Commit 36c2dd67 by 严久程

课程\fm

parent 5892c62e
...@@ -12,6 +12,7 @@ import com.ydl.media.audio.utils.PlayProgressUtil ...@@ -12,6 +12,7 @@ import com.ydl.media.audio.utils.PlayProgressUtil
import com.ydl.media.view.PlayTypeEnum import com.ydl.media.view.PlayTypeEnum
import com.ydl.media.view.PlayerFloatHelper import com.ydl.media.view.PlayerFloatHelper
import com.ydl.ydl_image.module.GlideApp import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.view.dialog.CommonDialog import com.ydl.ydlcommon.view.dialog.CommonDialog
import com.yidianling.course.R import com.yidianling.course.R
import com.yidianling.course.bean.CourseExtraBean import com.yidianling.course.bean.CourseExtraBean
...@@ -173,7 +174,7 @@ class CoursePlayItemViewVideo : RelativeLayout, PlayViewInterface { ...@@ -173,7 +174,7 @@ class CoursePlayItemViewVideo : RelativeLayout, PlayViewInterface {
.forbidTouch(false) .forbidTouch(false)
.setOnInfoListener(object : IMediaPlayer.OnInfoListener { .setOnInfoListener(object : IMediaPlayer.OnInfoListener {
override fun onInfo(mp: IMediaPlayer, what: Int, extra: Int): Boolean { override fun onInfo(mp: IMediaPlayer, what: Int, extra: Int): Boolean {
LogUtil.e("课程播放--状态-$what")
if (what == PlayStateParams.STATE_PAUSED) { if (what == PlayStateParams.STATE_PAUSED) {
this@CoursePlayItemViewVideo.findViewById<View>(R.id.rl_play_pause_layout).visibility = View.VISIBLE this@CoursePlayItemViewVideo.findViewById<View>(R.id.rl_play_pause_layout).visibility = View.VISIBLE
} else { } else {
......
...@@ -97,23 +97,26 @@ class CourseSearchActivity : BaseActivity(), CourseSearchAdapter.OnItemClick, IC ...@@ -97,23 +97,26 @@ class CourseSearchActivity : BaseActivity(), CourseSearchAdapter.OnItemClick, IC
private fun initSearchBar() { private fun initSearchBar() {
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE) window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE)
activity_course_search_search_bar_view.initBarType(SearchBarView.ENABLE_INPUT, object : SearchBarView.SearchCallBack { activity_course_search_search_bar_view.initBarType(
override fun cloase() { SearchBarView.ENABLE_INPUT,
finish() object : SearchBarView.SearchCallBack {
} override fun cloase() {
finish()
}
override fun clickSearchBtn(str: String) { override fun clickSearchBtn(str: String) {
inputString = str inputString = str
if (TextUtils.isEmpty(str)) { if (TextUtils.isEmpty(str)) {
// showUnusualView("请输入要搜索的内容") // showUnusualView("请输入要搜索的内容")
ToastUtil.toastShort("请输入要搜索的内容") ToastUtil.toastShort("请输入要搜索的内容")
return return
}
loadCourseList(true)
} }
loadCourseList(true) })
} activity_course_search_search_bar_view.postDelayed({
}) RxKeyboardTool.showSoftInput(this, activity_course_search_search_bar_view.getEditText())
},500)
RxKeyboardTool.showSoftInput(this,)
} }
/** /**
...@@ -130,23 +133,29 @@ class CourseSearchActivity : BaseActivity(), CourseSearchAdapter.OnItemClick, IC ...@@ -130,23 +133,29 @@ class CourseSearchActivity : BaseActivity(), CourseSearchAdapter.OnItemClick, IC
*/ */
private fun initRecyclerView() { private fun initRecyclerView() {
if (null == courseSearchAdapterWrapper) { if (null == courseSearchAdapterWrapper) {
courseSearchAdapter = CourseSearchAdapter(this, CourseSearchActicity@ this, courseList!!) courseSearchAdapter =
CourseSearchAdapter(this, CourseSearchActicity@ this, courseList!!)
courseSearchAdapter!!.setOnItemClickListener(this) courseSearchAdapter!!.setOnItemClickListener(this)
activity_course_search_recycler.layoutManager = LinearLayoutManager(this) activity_course_search_recycler.layoutManager = LinearLayoutManager(this)
courseSearchAdapterWrapper = CourseSearchAdapterWrapper( courseSearchAdapterWrapper = CourseSearchAdapterWrapper(
this, this,
courseSearchAdapter!!, courseSearchAdapter!!,
20, 20,
activity_course_search_recycler) activity_course_search_recycler
.setOnLoadMoreListener(object : CourseSearchAdapterWrapper.OnLoadMoreListener { )
override fun onLoadMore() { .setOnLoadMoreListener(object : CourseSearchAdapterWrapper.OnLoadMoreListener {
loadCourseList(false) override fun onLoadMore() {
} loadCourseList(false)
}) }
})
activity_course_search_recycler.adapter = courseSearchAdapterWrapper activity_course_search_recycler.adapter = courseSearchAdapterWrapper
//滑动监听 图片是否加载 //滑动监听 图片是否加载
activity_course_search_recycler.addOnScrollListener(YDLImageRecyclerOnScrollListener(CourseSearchActicity@ this)) activity_course_search_recycler.addOnScrollListener(
YDLImageRecyclerOnScrollListener(
CourseSearchActicity@ this
)
)
loadCourseList(true) loadCourseList(true)
} }
} }
...@@ -159,7 +168,12 @@ class CourseSearchActivity : BaseActivity(), CourseSearchAdapter.OnItemClick, IC ...@@ -159,7 +168,12 @@ class CourseSearchActivity : BaseActivity(), CourseSearchAdapter.OnItemClick, IC
if (null != courseItem) { if (null != courseItem) {
val h5Params = H5Params(CourseConstants.COURSE_DETAIL_H5 + courseItem.id, "课程详情") val h5Params = H5Params(CourseConstants.COURSE_DETAIL_H5 + courseItem.id, "课程详情")
if (null != courseItem.share && !TextUtils.isEmpty(courseItem.share.share_url)) { if (null != courseItem.share && !TextUtils.isEmpty(courseItem.share.share_url)) {
val shareData = ShareData(courseItem.share.share_url, courseItem.share.title, courseItem.share.cover, courseItem.share.desc) val shareData = ShareData(
courseItem.share.share_url,
courseItem.share.title,
courseItem.share.cover,
courseItem.share.desc
)
h5Params.shareData = shareData h5Params.shareData = shareData
} }
...@@ -203,36 +217,36 @@ class CourseSearchActivity : BaseActivity(), CourseSearchAdapter.OnItemClick, IC ...@@ -203,36 +217,36 @@ class CourseSearchActivity : BaseActivity(), CourseSearchAdapter.OnItemClick, IC
} }
CourseSearchApiUtils.courseSearchList(nowPage, inputString) CourseSearchApiUtils.courseSearchList(nowPage, inputString)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer { .subscribe(Consumer {
if (it.data.list.isNotEmpty()) { if (it.data.list.isNotEmpty()) {
hideUnusualPage() hideUnusualPage()
if (type) { if (type) {
courseList.clear() courseList.clear()
courseList.addAll(it.data.list) courseList.addAll(it.data.list)
courseSearchAdapterWrapper!!.notifyDataSetChanged() courseSearchAdapterWrapper!!.notifyDataSetChanged()
} else {
courseList.addAll(it.data.list)
courseSearchAdapterWrapper!!.insertData()
}
} else { } else {
if (!type) { courseList.addAll(it.data.list)
courseSearchAdapterWrapper!!.noMoreData() courseSearchAdapterWrapper!!.insertData()
} else {
showUnusualView("没有搜到相关信息,换个关键词看看吧", true)
}
} }
} else {
if (!type) {
courseSearchAdapterWrapper!!.noMoreData()
} else {
showUnusualView("没有搜到相关信息,换个关键词看看吧", true)
}
}
activity_course_search_swipe_refresh_layout.isRefreshing = false
}, object : ThrowableConsumer() {
override fun accept(msg: String) {
Log.i("testtest", msg)
activity_course_search_swipe_refresh_layout.isRefreshing = false activity_course_search_swipe_refresh_layout.isRefreshing = false
}, object : ThrowableConsumer() { showUnusualView("请检查你的网络设置", false)
override fun accept(msg: String) { }
Log.i("testtest", msg) })
activity_course_search_swipe_refresh_layout.isRefreshing = false
showUnusualView("请检查你的网络设置", false)
}
})
} }
/** /**
......
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