| 57c08243 Andy McCall ↶ |
1 |
package io.oxygenhub.android |
| 2 |
|
| 3 |
import android.os.Bundle |
| 4 |
import androidx.activity.ComponentActivity |
| 5 |
import androidx.activity.compose.setContent |
| 6 |
import androidx.activity.enableEdgeToEdge |
| 7 |
import androidx.compose.foundation.layout.fillMaxSize |
| 8 |
import androidx.compose.foundation.layout.padding |
| 9 |
import androidx.compose.material3.Scaffold |
| 10 |
import androidx.compose.material3.Text |
| 11 |
import androidx.compose.runtime.Composable |
| 12 |
import androidx.compose.ui.Modifier |
| 13 |
import androidx.compose.ui.tooling.preview.Preview |
| 14 |
import io.oxygenhub.android.ui.theme.OxygenHubTheme |
| 15 |
|
| 16 |
import uniffi.rust_core.oxygenGreeting |
| 17 |
|
| 18 |
import io.oxygenhub.android.ui.LoginScreen |
| 19 |
import io.oxygenhub.android.ui.MainScreen |
| 20 |
import androidx.compose.runtime.* |
| 21 |
|
| 22 |
class MainActivity : ComponentActivity() { |
| 23 |
override fun onCreate(savedInstanceState: Bundle?) { |
| 24 |
super.onCreate(savedInstanceState) |
| 25 |
enableEdgeToEdge() |
| 26 |
setContent { |
| 27 |
OxygenHubTheme { |
| 28 |
var isLoggedIn by remember { mutableStateOf(false) } |
| 29 |
|
| 30 |
if (isLoggedIn) { |
| 31 |
MainScreen() |
| 32 |
} else { |
| 33 |
LoginScreen( |
| 34 |
onLoginSuccess = { isLoggedIn = true } |
| 35 |
) |
| 36 |
} |
| 37 |
} |
| 38 |
} |
| 39 |
} |
| 40 |
} |
| 41 |
|
| 42 |
@Preview(showBackground = true) |
| 43 |
@Composable |
| 44 |
fun MainScreenPreview() { |
| 45 |
OxygenHubTheme { |
| 46 |
MainScreen() |
| 47 |
} |
| 48 |
} |