Commit 0490b409 by 洪国微

merge

parents a869a115 5e882a13
......@@ -44,7 +44,7 @@ ext {
//第三步 若干
"m-confide" : "0.0.18",
"m-consultant" : "0.0.27",
"m-course" : "0.0.17",
"m-course" : "0.0.21",
"m-fm" : "0.0.15",
"m-muse" : "0.0.11",
"m-tests" : "0.0.9",
......
......@@ -12,6 +12,7 @@ import com.ydl.media.audio.utils.PlayProgressUtil
import com.ydl.media.view.PlayTypeEnum
import com.ydl.media.view.PlayerFloatHelper
import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.view.dialog.CommonDialog
import com.yidianling.course.R
import com.yidianling.course.bean.CourseExtraBean
......@@ -173,7 +174,7 @@ class CoursePlayItemViewVideo : RelativeLayout, PlayViewInterface {
.forbidTouch(false)
.setOnInfoListener(object : IMediaPlayer.OnInfoListener {
override fun onInfo(mp: IMediaPlayer, what: Int, extra: Int): Boolean {
LogUtil.e("课程播放--状态-$what")
if (what == PlayStateParams.STATE_PAUSED) {
this@CoursePlayItemViewVideo.findViewById<View>(R.id.rl_play_pause_layout).visibility = View.VISIBLE
} else {
......@@ -187,13 +188,12 @@ class CoursePlayItemViewVideo : RelativeLayout, PlayViewInterface {
|| what == PlayStateParams.MEDIA_INFO_AUDIO_RENDERING_START
|| what == PlayStateParams.MEDIA_INFO_VIDEO_RENDERING_START
|| what == PlayStateParams.STATE_PLAYING
|| what == IMediaPlayer.MEDIA_INFO_VIDEO_SEEK_RENDERING_START
) {
activity?.isVideoPlay = true
this@CoursePlayItemViewVideo.findViewById<View>(R.id.ll_bg).visibility = View.GONE
} else {
mHandler.postDelayed({
this@CoursePlayItemViewVideo.findViewById<View>(R.id.ll_bg).visibility = View.VISIBLE
}, 550)
this@CoursePlayItemViewVideo.findViewById<View>(R.id.ll_loading).visibility = View.GONE
this@CoursePlayItemViewVideo.findViewById<View>(R.id.app_video_loading).visibility = View.GONE
}
if (what == PlayStateParams.STATE_COMPLETED) {
......
......@@ -97,23 +97,27 @@ class CourseSearchActivity : BaseActivity(), CourseSearchAdapter.OnItemClick, IC
private fun initSearchBar() {
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE)
activity_course_search_search_bar_view.initBarType(SearchBarView.ENABLE_INPUT, object : SearchBarView.SearchCallBack {
override fun cloase() {
finish()
}
activity_course_search_search_bar_view.initBarType(
SearchBarView.ENABLE_INPUT,
object : SearchBarView.SearchCallBack {
override fun cloase() {
finish()
}
override fun clickSearchBtn(str: String) {
inputString = str
if (TextUtils.isEmpty(str)) {
override fun clickSearchBtn(str: String) {
inputString = str
if (TextUtils.isEmpty(str)) {
// showUnusualView("请输入要搜索的内容")
ToastUtil.toastShort("请输入要搜索的内容")
return
ToastUtil.toastShort("请输入要搜索的内容")
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
*/
private fun initRecyclerView() {
if (null == courseSearchAdapterWrapper) {
courseSearchAdapter = CourseSearchAdapter(this, CourseSearchActicity@ this, courseList!!)
courseSearchAdapter =
CourseSearchAdapter(this, CourseSearchActicity@ this, courseList!!)
courseSearchAdapter!!.setOnItemClickListener(this)
activity_course_search_recycler.layoutManager = LinearLayoutManager(this)
courseSearchAdapterWrapper = CourseSearchAdapterWrapper(
this,
courseSearchAdapter!!,
20,
activity_course_search_recycler)
.setOnLoadMoreListener(object : CourseSearchAdapterWrapper.OnLoadMoreListener {
override fun onLoadMore() {
loadCourseList(false)
}
})
this,
courseSearchAdapter!!,
20,
activity_course_search_recycler
)
.setOnLoadMoreListener(object : CourseSearchAdapterWrapper.OnLoadMoreListener {
override fun onLoadMore() {
loadCourseList(false)
}
})
activity_course_search_recycler.adapter = courseSearchAdapterWrapper
//滑动监听 图片是否加载
activity_course_search_recycler.addOnScrollListener(YDLImageRecyclerOnScrollListener(CourseSearchActicity@ this))
activity_course_search_recycler.addOnScrollListener(
YDLImageRecyclerOnScrollListener(
CourseSearchActicity@ this
)
)
loadCourseList(true)
}
}
......@@ -159,7 +169,12 @@ class CourseSearchActivity : BaseActivity(), CourseSearchAdapter.OnItemClick, IC
if (null != courseItem) {
val h5Params = H5Params(CourseConstants.COURSE_DETAIL_H5 + courseItem.id, "课程详情")
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
}
......@@ -203,36 +218,36 @@ class CourseSearchActivity : BaseActivity(), CourseSearchAdapter.OnItemClick, IC
}
CourseSearchApiUtils.courseSearchList(nowPage, inputString)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {
if (it.data.list.isNotEmpty()) {
hideUnusualPage()
if (type) {
courseList.clear()
courseList.addAll(it.data.list)
courseSearchAdapterWrapper!!.notifyDataSetChanged()
} else {
courseList.addAll(it.data.list)
courseSearchAdapterWrapper!!.insertData()
}
if (it.data.list.isNotEmpty()) {
hideUnusualPage()
if (type) {
courseList.clear()
courseList.addAll(it.data.list)
courseSearchAdapterWrapper!!.notifyDataSetChanged()
} else {
if (!type) {
courseSearchAdapterWrapper!!.noMoreData()
} else {
showUnusualView("没有搜到相关信息,换个关键词看看吧", true)
}
courseList.addAll(it.data.list)
courseSearchAdapterWrapper!!.insertData()
}
} 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
}, object : ThrowableConsumer() {
override fun accept(msg: String) {
Log.i("testtest", msg)
activity_course_search_swipe_refresh_layout.isRefreshing = false
showUnusualView("请检查你的网络设置", false)
}
})
showUnusualView("请检查你的网络设置", false)
}
})
}
/**
......
......@@ -85,30 +85,38 @@
<!--加载中-->
<LinearLayout
android:id="@+id/app_video_loading"
android:id="@+id/ll_loading"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone">
<ProgressBar
android:layout_width="50dp"
android:layout_height="50dp"
android:indeterminateBehavior="repeat"
android:indeterminateOnly="true" />
android:visibility="visible">
<TextView
android:id="@+id/app_video_speed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
<LinearLayout
android:id="@+id/app_video_loading"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="188Kb/s"
android:textColor="@android:color/white"
android:visibility="gone" />
android:orientation="vertical"
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>
<!-- 中间触摸提示-->
<include
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