Adding view state class

This commit is contained in:
Maxime NATUREL 2022-05-02 09:13:05 +02:00
parent 0561fe5b08
commit d89d6bc162

View File

@ -25,8 +25,8 @@ import im.vector.app.features.home.room.detail.timeline.item.LiveLocationShareSu
import im.vector.app.features.home.room.detail.timeline.item.MessageLiveLocationStartItem
import im.vector.app.features.home.room.detail.timeline.item.MessageLiveLocationStartItem_
import org.matrix.android.sdk.api.extensions.orFalse
import org.matrix.android.sdk.api.extensions.orTrue
import org.matrix.android.sdk.api.session.room.model.message.MessageBeaconInfoContent
import org.matrix.android.sdk.api.session.room.model.message.LocationInfo
import java.time.LocalDateTime
import javax.inject.Inject
class LiveLocationMessageItemFactory @Inject constructor(
@ -68,4 +68,11 @@ class LiveLocationMessageItemFactory @Inject constructor(
.highlighted(highlight)
.leftGuideline(avatarSizeProvider.leftGuideline)
}
private sealed class LiveLocationShareViewState {
object Loading : LiveLocationShareViewState()
data class Running(val locationInfo: LocationInfo, val endOfLiveDateTime: LocalDateTime?) : LiveLocationShareViewState()
object Inactive : LiveLocationShareViewState()
object Unkwown : LiveLocationShareViewState()
}
}