neiam
/fieri-forever
the flavortown lunch engine
public · Issues · Pulls · Labels · Forks · Compare · Actions success · Badges · Packages
⭐
Log in to mark this repository.
Android: named "Fieri, Eternal"; Fieri splash at launch
b4bf16d · Gabriel Morell · 2026-10-29 01:13
Files changed
modified
android/app/src/main/java/org/neiam/fieri/app/MainActivity.kt
+11
−0
@@ -5,10 +5,14 @@ import android.os.Bundle
| 5 | 5 | import androidx.activity.ComponentActivity |
| 6 | 6 | import androidx.activity.compose.setContent |
| 7 | 7 | import androidx.activity.enableEdgeToEdge |
| 8 | +import androidx.compose.animation.AnimatedVisibility | |
| 9 | +import androidx.compose.animation.EnterTransition | |
| 10 | +import androidx.compose.animation.fadeOut | |
| 8 | 11 | import androidx.compose.foundation.layout.fillMaxSize |
| 9 | 12 | import androidx.compose.material3.MaterialTheme |
| 10 | 13 | import androidx.compose.material3.Surface |
| 11 | 14 | import androidx.compose.runtime.* |
| 15 | +import androidx.compose.runtime.saveable.rememberSaveable | |
| 12 | 16 | import androidx.compose.ui.Modifier |
| 13 | 17 | import androidx.navigation.NavType |
| 14 | 18 | import androidx.navigation.compose.NavHost |
@@ -25,6 +29,7 @@ import org.neiam.fieri.app.ui.AreasScreen
| 25 | 29 | import org.neiam.fieri.app.ui.OutingScreen |
| 26 | 30 | import org.neiam.fieri.app.ui.RestaurantScreen |
| 27 | 31 | import org.neiam.fieri.app.ui.SignInScreen |
| 32 | +import org.neiam.fieri.app.ui.Splash | |
| 28 | 33 | import org.neiam.fieri.app.ui.theme.FieriTheme |
| 29 | 34 | import org.neiam.fieri.app.ui.theme.SYSTEM_THEME_KEY |
| 30 | 35 | import org.neiam.fieri.app.ui.theme.appThemeForKey |
@@ -39,9 +44,12 @@ class MainActivity : ComponentActivity() {
| 39 | 44 | val tokens = TokenStore(this) |
| 40 | 45 | val themes = ThemeStore(this) |
| 41 | 46 | incomingPair.value = pairFrom(intent) |
| 47 | + // Cold starts only: not on rotation or other recreations. | |
| 48 | + val coldStart = savedInstanceState == null | |
| 42 | 49 | |
| 43 | 50 | setContent { |
| 44 | 51 | var themeKey by remember { mutableStateOf(themes.themeKey ?: SYSTEM_THEME_KEY) } |
| 52 | + var splash by rememberSaveable { mutableStateOf(coldStart) } | |
| 45 | 53 | FieriTheme(theme = appThemeForKey(themeKey)) { |
| 46 | 54 | Surface(Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.background) { |
| 47 | 55 | FieriApp( |
@@ -50,6 +58,9 @@ class MainActivity : ComponentActivity() {
| 50 | 58 | themeKey = themeKey, |
| 51 | 59 | onPickTheme = { themeKey = it; themes.themeKey = it }, |
| 52 | 60 | ) |
| 61 | + AnimatedVisibility(splash, enter = EnterTransition.None, exit = fadeOut()) { | |
| 62 | + Splash(onDone = { splash = false }) | |
| 63 | + } | |
| 53 | 64 | } |
| 54 | 65 | } |
| 55 | 66 | } |
modified
android/app/src/main/java/org/neiam/fieri/app/ui/AreasScreen.kt
+3
−1
@@ -13,8 +13,10 @@ import androidx.compose.material3.*
| 13 | 13 | import androidx.compose.material3.pulltorefresh.PullToRefreshBox |
| 14 | 14 | import androidx.compose.runtime.* |
| 15 | 15 | import androidx.compose.ui.Modifier |
| 16 | +import androidx.compose.ui.res.stringResource | |
| 16 | 17 | import androidx.compose.ui.unit.dp |
| 17 | 18 | import kotlinx.coroutines.launch |
| 19 | +import org.neiam.fieri.app.R | |
| 18 | 20 | import org.neiam.fieri.app.data.AreasResponse |
| 19 | 21 | import org.neiam.fieri.app.data.FieriApi |
| 20 | 22 | import org.neiam.fieri.app.ui.theme.ALL_THEMES |
@@ -41,7 +43,7 @@ fun AreasScreen(
| 41 | 43 | Scaffold( |
| 42 | 44 | topBar = { |
| 43 | 45 | TopAppBar( |
| 44 | − title = { Text(if (username != null) "Hi, $username" else "Fieri") }, | |
| 46 | + title = { Text(if (username != null) "Hi, $username" else stringResource(R.string.app_name)) }, | |
| 45 | 47 | actions = { AreasMenu(themeKey, onPickTheme, onSignOut) }, |
| 46 | 48 | ) |
| 47 | 49 | }, |
modified
android/app/src/main/java/org/neiam/fieri/app/ui/SignInScreen.kt
+3
−1
@@ -14,6 +14,7 @@ import androidx.compose.material3.*
| 14 | 14 | import androidx.compose.runtime.* |
| 15 | 15 | import androidx.compose.runtime.saveable.rememberSaveable |
| 16 | 16 | import androidx.compose.ui.Modifier |
| 17 | +import androidx.compose.ui.res.stringResource | |
| 17 | 18 | import androidx.compose.ui.text.input.ImeAction |
| 18 | 19 | import androidx.compose.ui.text.input.KeyboardType |
| 19 | 20 | import androidx.compose.ui.text.input.PasswordVisualTransformation |
@@ -22,6 +23,7 @@ import com.journeyapps.barcodescanner.CaptureActivity
| 22 | 23 | import com.journeyapps.barcodescanner.ScanContract |
| 23 | 24 | import com.journeyapps.barcodescanner.ScanOptions |
| 24 | 25 | import kotlinx.coroutines.launch |
| 26 | +import org.neiam.fieri.app.R | |
| 25 | 27 | import org.neiam.fieri.app.data.FieriClient |
| 26 | 28 | import org.neiam.fieri.app.data.LoginBody |
| 27 | 29 | import org.neiam.fieri.app.data.PairPayload |
@@ -48,7 +50,7 @@ fun SignInScreen(
| 48 | 50 | onSignedIn: (TokenStore.Credentials) -> Unit, |
| 49 | 51 | ) { |
| 50 | 52 | var tab by rememberSaveable { mutableIntStateOf(if (prefilled != null) 1 else 0) } |
| 51 | − Scaffold(topBar = { TopAppBar(title = { Text("Fieri") }) }) { padding -> | |
| 53 | + Scaffold(topBar = { TopAppBar(title = { Text(stringResource(R.string.app_name)) }) }) { padding -> | |
| 52 | 54 | Column(Modifier.fillMaxSize().padding(padding)) { |
| 53 | 55 | TabRow(selectedTabIndex = tab) { |
| 54 | 56 | Tab(selected = tab == 0, onClick = { tab = 0 }, text = { Text("Sign in") }, icon = { Icon(Icons.AutoMirrored.Filled.Login, null) }) |
added
android/app/src/main/java/org/neiam/fieri/app/ui/Splash.kt
+59
−0
@@ -0,0 +1,59 @@
| 1 | +package org.neiam.fieri.app.ui | |
| 2 | + | |
| 3 | +import androidx.compose.foundation.Image | |
| 4 | +import androidx.compose.foundation.background | |
| 5 | +import androidx.compose.foundation.clickable | |
| 6 | +import androidx.compose.foundation.interaction.MutableInteractionSource | |
| 7 | +import androidx.compose.foundation.layout.* | |
| 8 | +import androidx.compose.material3.MaterialTheme | |
| 9 | +import androidx.compose.material3.Text | |
| 10 | +import androidx.compose.runtime.Composable | |
| 11 | +import androidx.compose.runtime.LaunchedEffect | |
| 12 | +import androidx.compose.runtime.remember | |
| 13 | +import androidx.compose.ui.Alignment | |
| 14 | +import androidx.compose.ui.Modifier | |
| 15 | +import androidx.compose.ui.draw.clip | |
| 16 | +import androidx.compose.ui.layout.ContentScale | |
| 17 | +import androidx.compose.ui.res.painterResource | |
| 18 | +import androidx.compose.ui.res.stringResource | |
| 19 | +import androidx.compose.ui.text.font.FontWeight | |
| 20 | +import androidx.compose.ui.unit.dp | |
| 21 | +import kotlinx.coroutines.delay | |
| 22 | +import org.neiam.fieri.app.R | |
| 23 | + | |
| 24 | +/** How long the splash stays up unless tapped away. */ | |
| 25 | +private const val SPLASH_MILLIS = 1800L | |
| 26 | + | |
| 27 | +/** The web landing page's Fieri, full screen at launch. Tap to skip. */ | |
| 28 | +@Composable | |
| 29 | +fun Splash(onDone: () -> Unit) { | |
| 30 | + LaunchedEffect(Unit) { | |
| 31 | + delay(SPLASH_MILLIS) | |
| 32 | + onDone() | |
| 33 | + } | |
| 34 | + Column( | |
| 35 | + Modifier | |
| 36 | + .fillMaxSize() | |
| 37 | + .background(MaterialTheme.colorScheme.background) | |
| 38 | + .clickable(interactionSource = remember { MutableInteractionSource() }, indication = null, onClick = onDone) | |
| 39 | + .systemBarsPadding() | |
| 40 | + .padding(24.dp), | |
| 41 | + verticalArrangement = Arrangement.Center, | |
| 42 | + horizontalAlignment = Alignment.CenterHorizontally, | |
| 43 | + ) { | |
| 44 | + Image( | |
| 45 | + painter = painterResource(R.drawable.fieri), | |
| 46 | + contentDescription = "Anime-style Guy Fieri in sunglasses and a stars-and-stripes jacket, saying: " + | |
| 47 | + "You thought I would let you escape Flavortown so easily?", | |
| 48 | + contentScale = ContentScale.Fit, | |
| 49 | + modifier = Modifier.fillMaxWidth().clip(MaterialTheme.shapes.large), | |
| 50 | + ) | |
| 51 | + Spacer(Modifier.height(24.dp)) | |
| 52 | + Text( | |
| 53 | + stringResource(R.string.app_name), | |
| 54 | + style = MaterialTheme.typography.headlineMedium, | |
| 55 | + fontWeight = FontWeight.Bold, | |
| 56 | + color = MaterialTheme.colorScheme.primary, | |
| 57 | + ) | |
| 58 | + } | |
| 59 | +} |
modified
?
+0
−0
Binary file — not rendered.
modified
android/app/src/main/res/values/strings.xml
+1
−1
@@ -1,4 +1,4 @@
| 1 | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | 2 | <resources> |
| 3 | − <string name="app_name">Fieri</string> | |
| 3 | + <string name="app_name">Fieri, Eternal</string> | |
| 4 | 4 | </resources> |
Parents: fbe85ec