merge feat/welcome-screen into screen #2

Merged
lele merged 19 commits from feat/welcome-screen into master 2025-06-19 16:28:14 +02:00
2 changed files with 12 additions and 2 deletions
Showing only changes of commit b7933fc5b0 - Show all commits

View file

@ -33,6 +33,7 @@ android {
} }
kotlinOptions { kotlinOptions {
jvmTarget = "11" jvmTarget = "11"
freeCompilerArgs += "-opt-in=androidx.compose.material3.ExperimentalMaterial3ExpressiveApi"
} }
buildFeatures { buildFeatures {
compose = true compose = true

View file

@ -25,6 +25,7 @@ import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.widthIn import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material3.Button import androidx.compose.material3.Button
import androidx.compose.material3.CircularWavyProgressIndicator
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedButton import androidx.compose.material3.OutlinedButton
import androidx.compose.material3.OutlinedTextField import androidx.compose.material3.OutlinedTextField
@ -47,6 +48,7 @@ import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.Preview
@Composable @Composable
@ -78,6 +80,7 @@ fun HomeScreen(paddingValues: PaddingValues) {
"serverDialog" -> ServerDialog(serverURL, {newServerURL -> serverURL = newServerURL }) "serverDialog" -> ServerDialog(serverURL, {newServerURL -> serverURL = newServerURL })
"passwordDialog" -> PasswordDialog(username, password, {newUsername -> username = newUsername}, {newPassword -> password = newPassword }) "passwordDialog" -> PasswordDialog(username, password, {newUsername -> username = newUsername}, {newPassword -> password = newPassword })
"apiDialog" -> ApiDialog(apiKey) {newApiKey -> apiKey = newApiKey} "apiDialog" -> ApiDialog(apiKey) {newApiKey -> apiKey = newApiKey}
"loadingDialog" -> LoadingDialog()
} }
} }
@ -112,8 +115,9 @@ fun HomeScreen(paddingValues: PaddingValues) {
Button( Button(
onClick = {when(currentScreen) { onClick = {when(currentScreen) {
"serverDialog" -> currentScreen = "passwordDialog" "serverDialog" -> currentScreen = "passwordDialog"
"passwordDialog" -> currentScreen = "LoadingDialog" "passwordDialog" -> currentScreen = "loadingDialog"
"apiDialog" -> currentScreen = "LoadingDialog" "apiDialog" -> currentScreen = "loadingDialog"
"loadingDialog" -> currentScreen = "loadingDialog"
}}, }},
modifier = Modifier.padding(top = 24.dp) modifier = Modifier.padding(top = 24.dp)
.fillMaxWidth() .fillMaxWidth()
@ -239,4 +243,9 @@ fun ApiDialog(apiKey: String, updateApiKey: (newApiKey: String) -> Unit) {
) )
} }
}
@Composable
fun LoadingDialog () {
CircularWavyProgressIndicator()
} }