mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-10-31 16:22:49 +00:00
Add KDoc to the features/leaveroom API interfaces
Document LeaveRoomState, LeaveRoomEvent and LeaveRoomRenderer. The renderer doc records the two things a host screen needs to know, both taken from LeaveRoomPresenter and LeaveRoomView: it draws nothing until a leave event is sent, and onSelectNewOwners fires specifically when the user is the last owner of a room that still has other members. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
+3
@@ -10,6 +10,9 @@ package io.element.android.features.leaveroom.api
|
||||
|
||||
import io.element.android.libraries.matrix.api.core.RoomId
|
||||
|
||||
/**
|
||||
* Events sent to the leave room presenter through [LeaveRoomState.eventSink].
|
||||
*/
|
||||
interface LeaveRoomEvent {
|
||||
data class LeaveRoom(val roomId: RoomId, val needsConfirmation: Boolean) : LeaveRoomEvent
|
||||
}
|
||||
|
||||
+10
@@ -12,7 +12,17 @@ import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import io.element.android.libraries.matrix.api.core.RoomId
|
||||
|
||||
/**
|
||||
* Renders the confirmation dialogs of the leave room flow; it draws nothing until the host screen sends a leave event.
|
||||
*/
|
||||
fun interface LeaveRoomRenderer {
|
||||
/**
|
||||
* Draws whichever dialog the current state calls for.
|
||||
*
|
||||
* @param state the state produced by the leave room presenter.
|
||||
* @param onSelectNewOwners called when the user is the last owner of a room that still has other members, and must promote someone before leaving.
|
||||
* @param modifier layout modifier for the container.
|
||||
*/
|
||||
@Composable
|
||||
fun Render(
|
||||
state: LeaveRoomState,
|
||||
|
||||
+4
@@ -10,7 +10,11 @@ package io.element.android.features.leaveroom.api
|
||||
|
||||
import androidx.compose.runtime.Immutable
|
||||
|
||||
/**
|
||||
* State of the leave room flow, which is only the confirmation dialogs: the screen it is hosted in owns the rest of the UI.
|
||||
*/
|
||||
@Immutable
|
||||
interface LeaveRoomState {
|
||||
/** Where the host screen sends its events to start or confirm leaving a room. */
|
||||
val eventSink: (LeaveRoomEvent) -> Unit
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user