|
@@ -62,27 +62,27 @@ class LiveBroadcastListActivity :
|
|
|
rvLiveBroadcast.layoutManager = gridLayoutManager
|
|
|
rvLiveBroadcast.adapter = liveBroadcastAdapter
|
|
|
liveBroadcastAdapter.setData(liveBroadcastList)
|
|
|
- liveBroadcastAdapter.onLiveBroadcastImageClickListener = { url, method, title, id ->
|
|
|
- when (method) {
|
|
|
- "预约直播" -> {
|
|
|
- appointmentLive(id)
|
|
|
+ liveBroadcastAdapter.onLiveBroadcastImageClickListener =
|
|
|
+ { url, method, title, id, position ->
|
|
|
+ when (method) {
|
|
|
+ "预约直播" -> {
|
|
|
+ appointmentLive(id, position)
|
|
|
+ }
|
|
|
+ "直播中" -> {
|
|
|
+ initPermission(url)
|
|
|
+ }
|
|
|
+ "直播回放" -> {
|
|
|
+ ARouter.getInstance().build(RouterUrlCommon.videoPlayer)
|
|
|
+ .withString("url", url)
|
|
|
+ .withString("title", title)
|
|
|
+ .withTransition(
|
|
|
+ R.anim.leftin,
|
|
|
+ R.anim.leftout
|
|
|
+ ).navigation(mContext)
|
|
|
+ }
|
|
|
}
|
|
|
- "直播中" -> {
|
|
|
- initPermission(url)
|
|
|
- }
|
|
|
- "直播回放" -> {
|
|
|
- ARouter.getInstance().build(RouterUrlCommon.videoPlayer)
|
|
|
- .withString("url", url)
|
|
|
- .withString("title", title)
|
|
|
- .withTransition(
|
|
|
- com.yingyangfly.baselib.R.anim.leftin,
|
|
|
- com.yingyangfly.baselib.R.anim.leftout
|
|
|
- )
|
|
|
- .navigation(mContext)
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
radioLive.setOnCheckedChangeListener { group, checkedId ->
|
|
|
liveBroadcastAdapter.clearData()
|
|
|
liveBroadcastAdapter.showEmptyView = false
|
|
@@ -110,11 +110,14 @@ class LiveBroadcastListActivity :
|
|
|
/**
|
|
|
* 预约直播
|
|
|
*/
|
|
|
- private fun appointmentLive(method: String) {
|
|
|
+ private fun appointmentLive(method: String, position: Int) {
|
|
|
viewModel.reservationLive(method, fail = {
|
|
|
it.show()
|
|
|
}, success = {
|
|
|
- loadData(true, true)
|
|
|
+ if (liveBroadcastAdapter.data.isNullOrEmpty().not()) {
|
|
|
+ liveBroadcastAdapter.data[position].isReservation = "1"
|
|
|
+ liveBroadcastAdapter.notifyItemChanged(position)
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
|