-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1226 from joreilly/speakers_compose
compose for desktop speakers UI
- Loading branch information
Showing
10 changed files
with
365 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,7 +65,6 @@ internal fun SpeakerDetailsRoute( | |
component::onCloseClicked, | ||
) | ||
} | ||
|
||
} | ||
|
||
@Composable | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import androidx.compose.material.Scaffold | ||
import androidx.compose.material3.CenterAlignedTopAppBar | ||
import androidx.compose.material3.ExperimentalMaterial3Api | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.getValue | ||
import com.arkivanov.decompose.extensions.compose.jetbrains.subscribeAsState | ||
import dev.johnoreilly.confetti.decompose.SpeakerDetailsComponent | ||
import dev.johnoreilly.confetti.decompose.SpeakerDetailsUiState | ||
import dev.johnoreilly.confetti.decompose.SpeakersComponent | ||
import dev.johnoreilly.confetti.decompose.SpeakersUiState | ||
import dev.johnoreilly.confetti.ui.ErrorView | ||
import dev.johnoreilly.confetti.ui.LoadingView | ||
import dev.johnoreilly.confetti.ui.SpeakerDetailsView | ||
|
||
@OptIn(ExperimentalMaterial3Api::class) | ||
@Composable | ||
fun SpeakersUI(component: SpeakersComponent) { | ||
val uiState by component.uiState.subscribeAsState() | ||
|
||
Scaffold( | ||
topBar = { | ||
CenterAlignedTopAppBar(title = { Text("Speakers")}) | ||
} | ||
) { | ||
when (val state = uiState) { | ||
is SpeakersUiState.Success -> { | ||
SpeakerGridView(state.speakers, component::onSpeakerClicked) | ||
} | ||
is SpeakersUiState.Loading -> LoadingView() | ||
is SpeakersUiState.Error -> ErrorView {} | ||
} | ||
} | ||
} | ||
|
||
@Composable | ||
fun SpeakerDetailsUI(component: SpeakerDetailsComponent) { | ||
val uiState by component.uiState.subscribeAsState() | ||
|
||
when (val state = uiState) { | ||
is SpeakerDetailsUiState.Loading -> LoadingView() | ||
is SpeakerDetailsUiState.Error -> ErrorView() | ||
is SpeakerDetailsUiState.Success -> SpeakerDetailsView( | ||
state.details, | ||
component::onSessionClicked, | ||
component::onCloseClicked, | ||
) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.