Renaming duration parameter to precise the time unit

This commit is contained in:
Maxime NATUREL 2022-03-30 14:41:12 +02:00
parent d0a255819a
commit 4da11bbdc0
4 changed files with 6 additions and 6 deletions

View file

@ -23,5 +23,5 @@ sealed class LocationSharingAction : VectorViewModelAction {
data class PinnedLocationSharing(val locationData: LocationData?) : LocationSharingAction()
data class LocationTargetChange(val locationData: LocationData) : LocationSharingAction()
object ZoomToUserLocation : LocationSharingAction()
data class StartLiveLocationSharing(val duration: Long) : LocationSharingAction()
data class StartLiveLocationSharing(val durationMillis: Long) : LocationSharingAction()
}

View file

@ -182,7 +182,7 @@ class LocationSharingFragment @Inject constructor(
}
private fun handleStartLiveLocationService(event: LocationSharingViewEvents.StartLiveLocationService) {
val args = LocationSharingService.RoomArgs(event.sessionId, event.roomId, event.duration)
val args = LocationSharingService.RoomArgs(event.sessionId, event.roomId, event.durationMillis)
Intent(requireContext(), LocationSharingService::class.java)
.putExtra(LocationSharingService.EXTRA_ROOM_ARGS, args)

View file

@ -22,5 +22,5 @@ sealed class LocationSharingViewEvents : VectorViewEvents {
object Close : LocationSharingViewEvents()
object LocationNotAvailableError : LocationSharingViewEvents()
data class ZoomToUserLocation(val userLocation: LocationData) : LocationSharingViewEvents()
data class StartLiveLocationService(val sessionId: String, val roomId: String, val duration: Long) : LocationSharingViewEvents()
data class StartLiveLocationService(val sessionId: String, val roomId: String, val durationMillis: Long) : LocationSharingViewEvents()
}

View file

@ -120,7 +120,7 @@ class LocationSharingViewModel @AssistedInject constructor(
is LocationSharingAction.PinnedLocationSharing -> handlePinnedLocationSharingAction(action)
is LocationSharingAction.LocationTargetChange -> handleLocationTargetChangeAction(action)
LocationSharingAction.ZoomToUserLocation -> handleZoomToUserLocationAction()
is LocationSharingAction.StartLiveLocationSharing -> handleStartLiveLocationSharingAction(action.duration)
is LocationSharingAction.StartLiveLocationSharing -> handleStartLiveLocationSharingAction(action.durationMillis)
}
}
@ -158,11 +158,11 @@ class LocationSharingViewModel @AssistedInject constructor(
}
}
private fun handleStartLiveLocationSharingAction(duration: Long) {
private fun handleStartLiveLocationSharingAction(durationMillis: Long) {
_viewEvents.post(LocationSharingViewEvents.StartLiveLocationService(
sessionId = session.sessionId,
roomId = room.roomId,
duration = duration
durationMillis = durationMillis
))
}