Skip to content

Commit

Permalink
fix huawei event.localState null
Browse files Browse the repository at this point in the history
  • Loading branch information
AderanFeng committed Nov 6, 2023
1 parent d08fc41 commit 08e0de3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ class RtcComponent(
logger.i("RtcComponent", "onDragListener ${event.action}")
when (event.action) {
DragEvent.ACTION_DRAG_STARTED -> {
val user = event.localState as RoomUser
val user = adapter.findUserByUuid(windowsDragManager.currentUUID()) ?: return@OnDragListener false
addNewUserWindow(
user, UserWindowUiState(
centerX = event.x,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,10 @@ class UserVideoAdapter(
return dataSet[position]
}

fun findUserByUuid(uuid: String) : RoomUser? {
return dataSet.find { it.userUUID == uuid }
}

fun updateVideoView(uid: Int) {
recyclerView?.findViewHolderForItemId(uid.toLong())?.also {
windowsDragManager.setupUserVideo((it as ViewHolder).binding.videoContainer, uid)
Expand Down

0 comments on commit 08e0de3

Please sign in to comment.