|
@@ -21,6 +21,7 @@ import com.yingyangfly.baselib.utils.GsonUtil
|
|
|
import com.yingyangfly.baselib.utils.JumpUtil
|
|
|
import com.yingyangfly.baselib.utils.LiveEventBusUtil
|
|
|
import com.yingyangfly.baselib.utils.RxBusCodes
|
|
|
+import com.yingyangfly.baselib.utils.User
|
|
|
|
|
|
/**
|
|
|
* 直播列表
|
|
@@ -55,27 +56,25 @@ class LiveBroadcastListActivity :
|
|
|
rvLiveBroadcast.layoutManager = gridLayoutManager
|
|
|
rvLiveBroadcast.adapter = liveBroadcastAdapter
|
|
|
liveBroadcastAdapter.setData(liveBroadcastList)
|
|
|
- liveBroadcastAdapter.onLiveBroadcastImageClickListener =
|
|
|
- { url, method, title, id ->
|
|
|
- when (method) {
|
|
|
- "预约直播" -> {
|
|
|
- appointmentLive(id)
|
|
|
- }
|
|
|
- "直播中" -> {
|
|
|
- initPermission(url, id, title)
|
|
|
- }
|
|
|
- "直播回放" -> {
|
|
|
- ARouter.getInstance().build(RouterUrlCommon.videoPlayer)
|
|
|
- .withString("url", url)
|
|
|
- .withString("title", title)
|
|
|
- .withTransition(
|
|
|
- R.anim.leftin,
|
|
|
- R.anim.leftout
|
|
|
- ).navigation(mContext)
|
|
|
- }
|
|
|
+ liveBroadcastAdapter.onLiveBroadcastImageClickListener = { url, method, title, id ->
|
|
|
+ when (method) {
|
|
|
+ "预约直播" -> {
|
|
|
+ appointmentLive(id)
|
|
|
}
|
|
|
|
|
|
+ "直播中" -> {
|
|
|
+ initPermission(url, id, title)
|
|
|
+ }
|
|
|
+
|
|
|
+ "直播回放" -> {
|
|
|
+ ARouter.getInstance().build(RouterUrlCommon.videoPlayer)
|
|
|
+ .withString("url", url).withString("title", title).withTransition(
|
|
|
+ R.anim.leftin, R.anim.leftout
|
|
|
+ ).navigation(mContext)
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+ }
|
|
|
radioLive.setOnCheckedChangeListener { group, checkedId ->
|
|
|
liveBroadcastAdapter.clearData()
|
|
|
liveBroadcastAdapter.showEmptyView = false
|
|
@@ -85,11 +84,13 @@ class LiveBroadcastListActivity :
|
|
|
liveBroadcastAdapter.setType("预约直播")
|
|
|
loadData(isRefresh = true, showLoading = true)
|
|
|
}
|
|
|
+
|
|
|
R.id.rdb_live -> {
|
|
|
method = "2"
|
|
|
liveBroadcastAdapter.setType("直播中")
|
|
|
loadData(isRefresh = true, showLoading = true)
|
|
|
}
|
|
|
+
|
|
|
else -> {
|
|
|
method = "3"
|
|
|
liveBroadcastAdapter.setType("直播回放")
|
|
@@ -100,9 +101,7 @@ class LiveBroadcastListActivity :
|
|
|
}
|
|
|
liveBroadcastAdapter.jumpDetailsActivityClickListener = {
|
|
|
JumpUtil.jumpActivityWithUrl(
|
|
|
- RouterUrlCommon.liveDetails,
|
|
|
- GsonUtil.GsonString(it),
|
|
|
- mContext
|
|
|
+ RouterUrlCommon.liveDetails, GsonUtil.GsonString(it), mContext
|
|
|
)
|
|
|
}
|
|
|
}
|
|
@@ -207,6 +206,7 @@ class LiveBroadcastListActivity :
|
|
|
override fun onResume() {
|
|
|
super.onResume()
|
|
|
loadData(isRefresh = true, showLoading = true)
|
|
|
+ reportLog("进入直播列表")
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -226,6 +226,7 @@ class LiveBroadcastListActivity :
|
|
|
v.startAnimation(getScaleAnimation())
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
MotionEvent.ACTION_UP -> {
|
|
|
v.startAnimation(getEndAnimation())
|
|
|
if (v.id == R.id.layoutHome) {
|
|
@@ -233,6 +234,7 @@ class LiveBroadcastListActivity :
|
|
|
finish()
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
MotionEvent.ACTION_CANCEL -> {
|
|
|
if (v.id == R.id.layoutHome) {
|
|
|
v.startAnimation(getEndAnimation())
|
|
@@ -246,11 +248,23 @@ class LiveBroadcastListActivity :
|
|
|
* 跳转直播页面
|
|
|
*/
|
|
|
private fun getUserSign(url: String, id: String, title: String) {
|
|
|
- ARouter.getInstance().build(RouterUrlCommon.liveBroadcast)
|
|
|
- .withString("url", url)
|
|
|
- .withString("liveId", id)
|
|
|
- .withString("title", title)
|
|
|
- .withTransition(R.anim.leftin, R.anim.leftout)
|
|
|
- .navigation(mContext)
|
|
|
+ ARouter.getInstance().build(RouterUrlCommon.liveBroadcast).withString("url", url)
|
|
|
+ .withString("liveId", id).withString("title", title)
|
|
|
+ .withTransition(R.anim.leftin, R.anim.leftout).navigation(mContext)
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 阿里云日志上报
|
|
|
+ */
|
|
|
+ private fun reportLog(msg: String) {
|
|
|
+ runOnUiThread {
|
|
|
+ val log = com.aliyun.sls.android.producer.Log()
|
|
|
+ log.putContent(
|
|
|
+ "直播列表页面日志", msg
|
|
|
+ )
|
|
|
+ log.putContent("患者id", User.getUserId())
|
|
|
+ log.putContent("患者姓名", User.getName())
|
|
|
+ sendLog(log)
|
|
|
+ }
|
|
|
}
|
|
|
}
|