Commit 0490b409 by 洪国微

merge

parents a869a115 5e882a13
...@@ -44,7 +44,7 @@ ext { ...@@ -44,7 +44,7 @@ ext {
//第三步 若干 //第三步 若干
"m-confide" : "0.0.18", "m-confide" : "0.0.18",
"m-consultant" : "0.0.27", "m-consultant" : "0.0.27",
"m-course" : "0.0.17", "m-course" : "0.0.21",
"m-fm" : "0.0.15", "m-fm" : "0.0.15",
"m-muse" : "0.0.11", "m-muse" : "0.0.11",
"m-tests" : "0.0.9", "m-tests" : "0.0.9",
......
...@@ -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 {
...@@ -187,13 +188,12 @@ class CoursePlayItemViewVideo : RelativeLayout, PlayViewInterface { ...@@ -187,13 +188,12 @@ class CoursePlayItemViewVideo : RelativeLayout, PlayViewInterface {
|| what == PlayStateParams.MEDIA_INFO_AUDIO_RENDERING_START || what == PlayStateParams.MEDIA_INFO_AUDIO_RENDERING_START
|| what == PlayStateParams.MEDIA_INFO_VIDEO_RENDERING_START || what == PlayStateParams.MEDIA_INFO_VIDEO_RENDERING_START
|| what == PlayStateParams.STATE_PLAYING || what == PlayStateParams.STATE_PLAYING
|| what == IMediaPlayer.MEDIA_INFO_VIDEO_SEEK_RENDERING_START
) { ) {
activity?.isVideoPlay = true activity?.isVideoPlay = true
this@CoursePlayItemViewVideo.findViewById<View>(R.id.ll_bg).visibility = View.GONE this@CoursePlayItemViewVideo.findViewById<View>(R.id.ll_bg).visibility = View.GONE
} else { this@CoursePlayItemViewVideo.findViewById<View>(R.id.ll_loading).visibility = View.GONE
mHandler.postDelayed({ this@CoursePlayItemViewVideo.findViewById<View>(R.id.app_video_loading).visibility = View.GONE
this@CoursePlayItemViewVideo.findViewById<View>(R.id.ll_bg).visibility = View.VISIBLE
}, 550)
} }
if (what == PlayStateParams.STATE_COMPLETED) { if (what == PlayStateParams.STATE_COMPLETED) {
......
...@@ -97,23 +97,27 @@ class CourseSearchActivity : BaseActivity(), CourseSearchAdapter.OnItemClick, IC ...@@ -97,23 +97,27 @@ 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)
}
})
RxKeyboardTool.showSoftInput(this,activity_course_search_search_bar_view.getEditText()) })
activity_course_search_search_bar_view.postDelayed({
RxKeyboardTool.showSoftInput(this, activity_course_search_search_bar_view.getEditText())
},500)
} }
/** /**
...@@ -130,23 +134,29 @@ class CourseSearchActivity : BaseActivity(), CourseSearchAdapter.OnItemClick, IC ...@@ -130,23 +134,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 +169,12 @@ class CourseSearchActivity : BaseActivity(), CourseSearchAdapter.OnItemClick, IC ...@@ -159,7 +169,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 +218,36 @@ class CourseSearchActivity : BaseActivity(), CourseSearchAdapter.OnItemClick, IC ...@@ -203,36 +218,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)
}
})
} }
/** /**
......
...@@ -85,30 +85,38 @@ ...@@ -85,30 +85,38 @@
<!--加载中--> <!--加载中-->
<LinearLayout <LinearLayout
android:id="@+id/app_video_loading" android:id="@+id/ll_loading"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center" android:visibility="visible">
android:orientation="vertical"
android:visibility="gone">
<ProgressBar
android:layout_width="50dp"
android:layout_height="50dp"
android:indeterminateBehavior="repeat"
android:indeterminateOnly="true" />
<TextView <LinearLayout
android:id="@+id/app_video_speed" android:id="@+id/app_video_loading"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_marginTop="4dp"
android:gravity="center" android:gravity="center"
android:text="188Kb/s" android:orientation="vertical"
android:textColor="@android:color/white" android:visibility="gone">
android:visibility="gone" />
<ProgressBar
android:layout_width="50dp"
android:layout_height="50dp"
android:indeterminateBehavior="repeat"
android:indeterminateOnly="true" />
<TextView
android:id="@+id/app_video_speed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:gravity="center"
android:text="188Kb/s"
android:textColor="@android:color/white"
android:visibility="gone" />
</LinearLayout>
</LinearLayout> </LinearLayout>
<!-- 中间触摸提示--> <!-- 中间触摸提示-->
<include <include
layout="@layout/simple_player_touch_gestures" layout="@layout/simple_player_touch_gestures"
......
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