Compare commits
No commits in common. "b8d6c098ac7a3202a46e48def0f562e6dea86ea5" and "81661b327088d130d1d70c152ffd377364f70d68" have entirely different histories.
b8d6c098ac
...
81661b3270
2 changed files with 23 additions and 36 deletions
|
|
@ -10,7 +10,7 @@ import androidx.compose.runtime.mutableStateOf
|
|||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import de.lelehier.keeper.ui.theme.KeeperTheme
|
||||
import de.lelehier.keeper.screens.LoginScreen
|
||||
import de.lelehier.keeper.screens.HomeScreen
|
||||
|
||||
class MainActivity : ComponentActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
|
|
@ -21,7 +21,7 @@ class MainActivity : ComponentActivity() {
|
|||
var currentScreen by remember { mutableStateOf(0) }
|
||||
|
||||
Scaffold() { paddingValues ->
|
||||
LoginScreen(paddingValues)
|
||||
HomeScreen(paddingValues)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
|
|||
import androidx.compose.ui.tooling.preview.Preview
|
||||
|
||||
@Composable
|
||||
fun LoginScreen(paddingValues: PaddingValues) {
|
||||
fun HomeScreen(paddingValues: PaddingValues) {
|
||||
var currentScreen by rememberSaveable { mutableStateOf("serverDialog") }
|
||||
var serverURL by rememberSaveable { mutableStateOf("") }
|
||||
var username by rememberSaveable { mutableStateOf("") }
|
||||
|
|
@ -88,8 +88,7 @@ fun LoginScreen(paddingValues: PaddingValues) {
|
|||
|
||||
AnimatedVisibility(currentScreen == "passwordDialog" || currentScreen == "apiDialog") {
|
||||
Row(
|
||||
modifier = Modifier
|
||||
.padding(bottom = 12.dp)
|
||||
modifier = Modifier.padding(bottom = 12.dp)
|
||||
.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.SpaceBetween
|
||||
) {
|
||||
|
|
@ -125,16 +124,13 @@ fun LoginScreen(paddingValues: PaddingValues) {
|
|||
}
|
||||
}
|
||||
}
|
||||
AnimatedVisibility(currentScreen != "loadingDialog") {
|
||||
Button(
|
||||
onClick = {
|
||||
when (currentScreen) {
|
||||
onClick = {when(currentScreen) {
|
||||
"serverDialog" -> currentScreen = "passwordDialog"
|
||||
"passwordDialog" -> currentScreen = "loadingDialog"
|
||||
"apiDialog" -> currentScreen = "loadingDialog"
|
||||
"loadingDialog" -> currentScreen = "loadingDialog"
|
||||
}
|
||||
},
|
||||
}},
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.height(96.dp),
|
||||
|
|
@ -146,16 +142,7 @@ fun LoginScreen(paddingValues: PaddingValues) {
|
|||
},
|
||||
) {
|
||||
Row() {
|
||||
Text(
|
||||
text = when (currentScreen) {
|
||||
"serverDialog" -> "Next"
|
||||
"passwordDialog" -> "Login"
|
||||
"apiDialog" -> "Login"
|
||||
else -> ""
|
||||
|
||||
}
|
||||
)
|
||||
}
|
||||
Text(text = "Next")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue