Skip to content

Commit

Permalink
Fix lint app
Browse files Browse the repository at this point in the history
  • Loading branch information
linsang21 committed Sep 24, 2024
1 parent c9a8669 commit 347f481
Showing 1 changed file with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ class MeetingFragment : Fragment(),
buttonSendChat
)

buttons.forEach {
buttons.iterator().forEach {
if (!promoted) {
it.alpha = 0.2f
it.isClickable = false
Expand Down Expand Up @@ -491,7 +491,7 @@ class MeetingFragment : Fragment(),

private fun setupTab(view: View) {
tabLayout = view.findViewById(R.id.tabLayoutMeetingView)
SubTab.values().forEach {
SubTab.values().iterator().forEach {
tabLayout.addTab(
tabLayout.newTab().setText(it.name).setContentDescription("${it.name} Tab")
)
Expand All @@ -517,11 +517,11 @@ class MeetingFragment : Fragment(),

private fun setVideoSurfaceViewsVisibility(visibility: Int) {
meetingModel.localVideoTileState?.setRenderViewVisibility(visibility)
meetingModel.getRemoteVideoTileStates().forEach { it.setRenderViewVisibility(visibility) }
meetingModel.getRemoteVideoTileStates().iterator().forEach { it.setRenderViewVisibility(visibility) }
}

private fun setScreenSurfaceViewsVisibility(visibility: Int) {
meetingModel.currentScreenTiles.forEach { it.setRenderViewVisibility(visibility) }
meetingModel.currentScreenTiles.iterator().forEach { it.setRenderViewVisibility(visibility) }
}

private fun showViewAt(index: Int) {
Expand Down Expand Up @@ -778,7 +778,7 @@ class MeetingFragment : Fragment(),
override fun onVolumeChanged(volumeUpdates: Array<VolumeUpdate>) {
uiScope.launch {
mutex.withLock {
volumeUpdates.forEach { (attendeeInfo, volumeLevel) ->
volumeUpdates.iterator().forEach { (attendeeInfo, volumeLevel) ->
meetingModel.currentRoster[attendeeInfo.attendeeId]?.let {
meetingModel.currentRoster[attendeeInfo.attendeeId] =
RosterAttendee(
Expand All @@ -799,7 +799,7 @@ class MeetingFragment : Fragment(),
override fun onSignalStrengthChanged(signalUpdates: Array<SignalUpdate>) {
uiScope.launch {
mutex.withLock {
signalUpdates.forEach { (attendeeInfo, signalStrength) ->
signalUpdates.iterator().forEach { (attendeeInfo, signalStrength) ->
logWithFunctionName(
"onSignalStrengthChanged",
"${attendeeInfo.externalUserId} $signalStrength",
Expand Down Expand Up @@ -829,7 +829,7 @@ class MeetingFragment : Fragment(),
override fun onAttendeesLeft(attendeeInfo: Array<AttendeeInfo>) {
uiScope.launch {
mutex.withLock {
attendeeInfo.forEach { (attendeeId, _) ->
attendeeInfo.iterator().forEach { (attendeeId, _) ->
meetingModel.currentRoster.remove(
attendeeId
)
Expand All @@ -841,7 +841,7 @@ class MeetingFragment : Fragment(),
}

override fun onAttendeesDropped(attendeeInfo: Array<AttendeeInfo>) {
attendeeInfo.forEach { (_, externalUserId) ->
attendeeInfo.iterator().forEach { (_, externalUserId) ->
notifyHandler("$externalUserId dropped")
logWithFunctionName(
object {}.javaClass.enclosingMethod?.name,
Expand All @@ -851,7 +851,7 @@ class MeetingFragment : Fragment(),

uiScope.launch {
mutex.withLock {
attendeeInfo.forEach { (attendeeId, _) ->
attendeeInfo.iterator().forEach { (attendeeId, _) ->
meetingModel.currentRoster.remove(
attendeeId
)
Expand All @@ -863,7 +863,7 @@ class MeetingFragment : Fragment(),
}

override fun onAttendeesMuted(attendeeInfo: Array<AttendeeInfo>) {
attendeeInfo.forEach { (attendeeId, externalUserId) ->
attendeeInfo.iterator().forEach { (attendeeId, externalUserId) ->
logWithFunctionName(
object {}.javaClass.enclosingMethod?.name,
"Attendee with attendeeId $attendeeId and externalUserId $externalUserId muted"
Expand All @@ -872,7 +872,7 @@ class MeetingFragment : Fragment(),
}

override fun onAttendeesUnmuted(attendeeInfo: Array<AttendeeInfo>) {
attendeeInfo.forEach { (attendeeId, externalUserId) ->
attendeeInfo.iterator().forEach { (attendeeId, externalUserId) ->
logger.info(
TAG,
"Attendee with attendeeId $attendeeId and externalUserId $externalUserId unmuted"
Expand All @@ -885,7 +885,7 @@ class MeetingFragment : Fragment(),
mutex.withLock {
var needUpdate = false
val activeSpeakers = attendeeInfo.map { it.attendeeId }.toSet()
meetingModel.currentRoster.values.forEach { attendee ->
meetingModel.currentRoster.values.iterator().forEach { attendee ->
if (activeSpeakers.contains(attendee.attendeeId) != attendee.isActiveSpeaker) {
meetingModel.currentRoster[attendee.attendeeId] =
RosterAttendee(
Expand Down Expand Up @@ -926,7 +926,7 @@ class MeetingFragment : Fragment(),
) {
uiScope.launch {
mutex.withLock {
attendeeInfo.forEach { (attendeeId, externalUserId) ->
attendeeInfo.iterator().forEach { (attendeeId, externalUserId) ->
if (attendeeId.isContentShare() &&
!isSelfAttendee(attendeeId) &&
meetingModel.isSharingContent
Expand Down Expand Up @@ -1248,7 +1248,7 @@ class MeetingFragment : Fragment(),
}
is Transcript -> {
val entitySet = mutableSetOf<String>()
transcriptEvent.results.forEach { result ->
transcriptEvent.results.iterator().forEach { result ->
val alternative = result.alternatives.firstOrNull() ?: return
// for simplicity and demo purposes, assume each result only contains transcripts from
// the same speaker, which matches our observation with current transcription service behavior.
Expand All @@ -1274,7 +1274,7 @@ class MeetingFragment : Fragment(),
alternative.items
)
} else {
entities.forEach { entity ->
entities.iterator().forEach { entity ->
entitySet.addAll(entity.content.split(" "))
}
Caption(
Expand Down Expand Up @@ -1379,7 +1379,7 @@ class MeetingFragment : Fragment(),
private fun subscribeRemoteVideoByTileState(tileSate: VideoTileState) {
val updatedSources: MutableMap<RemoteVideoSource, VideoSubscriptionConfiguration> =
mutableMapOf()
meetingModel.getRemoteVideoSourceConfigurations().forEach {
meetingModel.getRemoteVideoSourceConfigurations().iterator().forEach {
if (it.key.attendeeId == tileSate.attendeeId) {
updatedSources[it.key] = it.value
}
Expand All @@ -1389,7 +1389,7 @@ class MeetingFragment : Fragment(),

private fun unsubscribeRemoteVideoByTileState(tileState: VideoTileState) {
val removedList: ArrayList<RemoteVideoSource> = arrayListOf()
meetingModel.getRemoteVideoSourceConfigurations().forEach {
meetingModel.getRemoteVideoSourceConfigurations().iterator().forEach {
if (it.key.attendeeId == tileState.attendeeId) {
removedList.add(it.key)
}
Expand All @@ -1399,7 +1399,7 @@ class MeetingFragment : Fragment(),

private fun unsubscribeAllRemoteVideos() {
val removedList: ArrayList<RemoteVideoSource> = arrayListOf()
meetingModel.getRemoteVideoTileStates().forEach {
meetingModel.getRemoteVideoTileStates().iterator().forEach {
for ((key) in meetingModel.getRemoteVideoSourceConfigurations()) {
if (key.attendeeId == it.videoTileState.attendeeId) {
removedList.add(key)
Expand All @@ -1410,7 +1410,7 @@ class MeetingFragment : Fragment(),
}

private fun pauseAllContentShares() {
meetingModel.currentScreenTiles.forEach {
meetingModel.currentScreenTiles.iterator().forEach {
unsubscribeRemoteVideoByTileState(it.videoTileState)
}
}
Expand Down Expand Up @@ -1547,7 +1547,7 @@ class MeetingFragment : Fragment(),
if (tileState.isContent) {
meetingModel.currentScreenTiles.add(videoCollectionTile)
screenTileAdapter.notifyDataSetChanged()
meetingModel.currentScreenTiles.forEach {
meetingModel.currentScreenTiles.iterator().forEach {
subscribeRemoteVideoByTileState(it.videoTileState)
audioVideo.resumeRemoteVideoTile(it.videoTileState.tileId)
}
Expand Down Expand Up @@ -1714,7 +1714,7 @@ class MeetingFragment : Fragment(),
// removed(by calling AudioVideo.updateVideoSourceSubscriptions()), as they will be
// automatically unsubscribed in SDK.
// The tracking sources still need to be removed in demo app
sources.forEach { meetingModel.removeVideoSource(it) }
sources.iterator().forEach { meetingModel.removeVideoSource(it) }
}

override fun onVideoTileAdded(tileState: VideoTileState) {
Expand Down Expand Up @@ -1801,7 +1801,7 @@ class MeetingFragment : Fragment(),
uiScope.launch {
mutex.withLock {
meetingModel.currentMetrics.clear()
metrics.forEach { (metricsName, metricsValue) ->
metrics.iterator().forEach { (metricsName, metricsValue) ->
meetingModel.currentMetrics[metricsName.name] =
MetricData(metricsName.name, metricsValue.toString())
}
Expand Down Expand Up @@ -1920,10 +1920,10 @@ class MeetingFragment : Fragment(),
if (meetingModel.localVideoTileState != null) {
audioVideo.unbindVideoView(meetingModel.localTileId)
}
meetingModel.getRemoteVideoTileStates().forEach {
meetingModel.getRemoteVideoTileStates().iterator().forEach {
audioVideo.unbindVideoView(it.videoTileState.tileId)
}
meetingModel.currentScreenTiles.forEach {
meetingModel.currentScreenTiles.iterator().forEach {
audioVideo.unbindVideoView(it.videoTileState.tileId)
}
audioVideo.stopLocalVideo()
Expand Down

0 comments on commit 347f481

Please sign in to comment.