|
|
@@ -130,10 +130,7 @@ class LiveBroadcastActivity :
|
|
|
}
|
|
|
|
|
|
override fun onWarning(
|
|
|
- player: V2TXLivePlayer?,
|
|
|
- code: Int,
|
|
|
- msg: String?,
|
|
|
- extraInfo: Bundle?
|
|
|
+ player: V2TXLivePlayer?, code: Int, msg: String?, extraInfo: Bundle?
|
|
|
) {
|
|
|
super.onWarning(player, code, msg, extraInfo)
|
|
|
when (code) {
|
|
|
@@ -155,9 +152,7 @@ class LiveBroadcastActivity :
|
|
|
}
|
|
|
|
|
|
override fun onVideoPlaying(
|
|
|
- player: V2TXLivePlayer?,
|
|
|
- firstPlay: Boolean,
|
|
|
- extraInfo: Bundle?
|
|
|
+ player: V2TXLivePlayer?, firstPlay: Boolean, extraInfo: Bundle?
|
|
|
) {
|
|
|
super.onVideoPlaying(player, firstPlay, extraInfo)
|
|
|
}
|
|
|
@@ -171,20 +166,24 @@ class LiveBroadcastActivity :
|
|
|
v.startAnimation(getScaleAnimation())
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
MotionEvent.ACTION_UP -> {
|
|
|
v.startAnimation(getEndAnimation())
|
|
|
when (v.id) {
|
|
|
R.id.backLayout -> {
|
|
|
finish()
|
|
|
}
|
|
|
+
|
|
|
R.id.btnYes -> {
|
|
|
- liveYesorno("0")
|
|
|
+ liveYesOrNo("0")
|
|
|
}
|
|
|
+
|
|
|
R.id.btnNo -> {
|
|
|
- liveYesorno("1")
|
|
|
+ liveYesOrNo("1")
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
MotionEvent.ACTION_CANCEL -> {
|
|
|
if (v.id == R.id.backLayout || v.id == R.id.btnYes || v.id == R.id.btnNo) {
|
|
|
v.startAnimation(getEndAnimation())
|
|
|
@@ -214,9 +213,7 @@ class LiveBroadcastActivity :
|
|
|
//直播间心跳上回传报错
|
|
|
CrashReport.postCatchedException(
|
|
|
Throwable(
|
|
|
- User.getName() +
|
|
|
- "直播间心跳上回传报错,直播间信息:" + liveId + " ,用户信息:" + User.getUserId() + " \n" +
|
|
|
- User.getName() + " ,错误信息:" + it
|
|
|
+ User.getName() + "直播间心跳上回传报错,直播间信息:" + liveId + " ,用户信息:" + User.getUserId() + " \n" + User.getName() + " ,错误信息:" + it
|
|
|
)
|
|
|
)
|
|
|
}, success = {
|
|
|
@@ -227,8 +224,8 @@ class LiveBroadcastActivity :
|
|
|
/**
|
|
|
* 直播统计是和否
|
|
|
*/
|
|
|
- private fun liveYesorno(status: String) {
|
|
|
- viewModel.liveYesorno(liveId, status, fail = {
|
|
|
+ private fun liveYesOrNo(status: String) {
|
|
|
+ viewModel.liveYesOrNo(liveId, status, fail = {
|
|
|
it.toast()
|
|
|
}, success = {
|
|
|
binding {
|
|
|
@@ -246,36 +243,31 @@ class LiveBroadcastActivity :
|
|
|
runOnUiThread {
|
|
|
if (msg != null) {
|
|
|
Log.e("wpp", "6-------------------------------" + GsonUtil.GsonString(msg))
|
|
|
- if (msg.isRead.not()) {
|
|
|
- makeMessageAsRead(msg)
|
|
|
- if (msg.elemType == V2TIMMessage.V2TIM_ELEM_TYPE_CUSTOM) {
|
|
|
- val customElem = msg.customElem
|
|
|
- if (customElem != null && customElem.data != null) {
|
|
|
- val data = String(customElem.data)
|
|
|
- val description = customElem.description
|
|
|
- if (TextUtils.isEmpty(data).not()) {
|
|
|
- val messageBean =
|
|
|
- GsonUtil.GsonToBean(data, MessageBean::class.java)
|
|
|
- if (messageBean != null) {
|
|
|
- if (TextUtils.isEmpty(description).not()) {
|
|
|
- messageBean.description = description
|
|
|
+ makeMessageAsRead(msg)
|
|
|
+ if (msg.elemType == V2TIMMessage.V2TIM_ELEM_TYPE_CUSTOM) {
|
|
|
+ val customElem = msg.customElem
|
|
|
+ if (customElem != null && customElem.data != null) {
|
|
|
+ val data = String(customElem.data)
|
|
|
+ val description = customElem.description
|
|
|
+ if (TextUtils.isEmpty(data).not()) {
|
|
|
+ val messageBean = GsonUtil.GsonToBean(data, MessageBean::class.java)
|
|
|
+ if (messageBean != null) {
|
|
|
+ if (TextUtils.isEmpty(description).not()) {
|
|
|
+ messageBean.description = description
|
|
|
+ }
|
|
|
+ when (messageBean.businessID) {
|
|
|
+ "live" -> {
|
|
|
+ binding.statusLayout.visibility = View.VISIBLE
|
|
|
}
|
|
|
- when (messageBean.businessID) {
|
|
|
- "live" -> {
|
|
|
- binding.statusLayout.visibility = View.VISIBLE
|
|
|
- }
|
|
|
|
|
|
- "gameDetails" -> {
|
|
|
- if (TextUtils.isEmpty(messageBean.description)
|
|
|
- .not()
|
|
|
- ) {
|
|
|
- showGameTasksDialog(messageBean.description)
|
|
|
- }
|
|
|
+ "gameDetails" -> {
|
|
|
+ if (TextUtils.isEmpty(messageBean.description).not()) {
|
|
|
+ showGameTasksDialog(messageBean.description)
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- "endLive" -> {
|
|
|
- endLive()
|
|
|
- }
|
|
|
+ "endLive" -> {
|
|
|
+ endLive()
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -291,17 +283,19 @@ class LiveBroadcastActivity :
|
|
|
* 消息改成已读
|
|
|
*/
|
|
|
private fun makeMessageAsRead(msg: V2TIMMessage) {
|
|
|
- V2TIMManager.getConversationManager().cleanConversationUnreadMessageCount(
|
|
|
- String.format("c2c_%s", msg.sender),
|
|
|
- 0,
|
|
|
- 0,
|
|
|
- object : V2TIMCallback {
|
|
|
- override fun onSuccess() {
|
|
|
- }
|
|
|
+ runOnUiThread {
|
|
|
+ V2TIMManager.getConversationManager()
|
|
|
+ .cleanConversationUnreadMessageCount(String.format("c2c_%s", msg.sender),
|
|
|
+ 0,
|
|
|
+ 0,
|
|
|
+ object : V2TIMCallback {
|
|
|
+ override fun onSuccess() {
|
|
|
+ }
|
|
|
|
|
|
- override fun onError(p0: Int, p1: String?) {
|
|
|
- }
|
|
|
- })
|
|
|
+ override fun onError(p0: Int, p1: String?) {
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -323,10 +317,8 @@ class LiveBroadcastActivity :
|
|
|
private fun gotoGameView(gameTasksBean: GameTasksBean) {
|
|
|
runOnUiThread {
|
|
|
ARouter.getInstance().build(RouterUrlCommon.playGame)
|
|
|
- .withString("gameCode", gameTasksBean.gameCode)
|
|
|
- .withString("playClass", "D")
|
|
|
- .withString("gameName", gameTasksBean.gameName)
|
|
|
- .withString("url", gameTasksBean.url)
|
|
|
+ .withString("gameCode", gameTasksBean.gameCode).withString("playClass", "D")
|
|
|
+ .withString("gameName", gameTasksBean.gameName).withString("url", gameTasksBean.url)
|
|
|
.withString("gameType", gameTasksBean.gameType)
|
|
|
.withString("gameTotalScore", gameTasksBean.gameTotalScore)
|
|
|
.withString("gameInbetweenImage", gameTasksBean.gameInbetweenImage)
|
|
|
@@ -334,8 +326,7 @@ class LiveBroadcastActivity :
|
|
|
.withString("gameShortDesn", gameTasksBean.gameShortDesn)
|
|
|
.withString("fullFlag", gameTasksBean.fullFlag)
|
|
|
.withString("frameImg", gameTasksBean.frameImg)
|
|
|
- .withTransition(R.anim.leftin, R.anim.leftout)
|
|
|
- .navigation(mContext)
|
|
|
+ .withTransition(R.anim.leftin, R.anim.leftout).navigation(mContext)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -361,8 +352,7 @@ class LiveBroadcastActivity :
|
|
|
finish()
|
|
|
}
|
|
|
messageDialog.show(
|
|
|
- supportFragmentManager,
|
|
|
- "taskFragment"
|
|
|
+ supportFragmentManager, "taskFragment"
|
|
|
)
|
|
|
}
|
|
|
}
|
|
|
@@ -388,17 +378,10 @@ class LiveBroadcastActivity :
|
|
|
*/
|
|
|
private fun tipsDialog(content: String) {
|
|
|
runOnUiThread {
|
|
|
- TipsDialog.TipDialogBuilder()
|
|
|
- .title("提示")
|
|
|
- .content(content)
|
|
|
- .leftBtnText("取消")
|
|
|
- .rightBtnText("确认")
|
|
|
- .leftClick({
|
|
|
- }, true)
|
|
|
- .rightClick({
|
|
|
+ TipsDialog.TipDialogBuilder().title("提示").content(content).leftBtnText("取消")
|
|
|
+ .rightBtnText("确认").leftClick({}, true).rightClick({
|
|
|
finish()
|
|
|
- }, true)
|
|
|
- .show(supportFragmentManager)
|
|
|
+ }, true).show(supportFragmentManager)
|
|
|
}
|
|
|
}
|
|
|
}
|