Skip to content

Commit 9caae34

Browse files
feat(android): add direct Settings gear button to BibleScreen top bar
1 parent bcc102e commit 9caae34

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

mobile/app/src/main/java/com/bytecats/metanoia/MainActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class MainActivity : ComponentActivity() {
5656
MetanoiaTheme {
5757
NavHost(navController = navController, startDestination = "menu") {
5858
composable("menu") { MainMenu(navController, viewModel) }
59-
composable("bible") { BibleScreen(viewModel) }
59+
composable("bible") { BibleScreen(viewModel) { navController.navigate("settings_main") } }
6060
composable("collection") { CollectionScreen(navController, viewModel) }
6161
composable("insights") {
6262
InsightsRepositoryScreen(navController, viewModel) { viewModel.speak(it) }

mobile/app/src/main/java/com/bytecats/metanoia/ui/screens/BibleScreen.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import kotlinx.coroutines.withContext
4343

4444
@OptIn(ExperimentalMaterial3Api::class, ExperimentalLayoutApi::class, ExperimentalFoundationApi::class)
4545
@Composable
46-
fun BibleScreen(viewModel: MainViewModel) {
46+
fun BibleScreen(viewModel: MainViewModel, onNavigateToSettings: () -> Unit = {}) {
4747
val bibleManager = viewModel.bibleManager
4848
val settings = viewModel.settingsManager
4949
val narration by viewModel.narrationState
@@ -111,6 +111,7 @@ fun BibleScreen(viewModel: MainViewModel) {
111111
navigationIcon = { if (step != "book") IconButton({ step = if (step == "read") "chapter" else "book"; isSearchVisible = (step == "book"); viewModel.stopNarration() }) { Icon(Icons.AutoMirrored.Filled.ArrowBack, null) } },
112112
actions = {
113113
IconButton({ isSearchVisible = !isSearchVisible }) { Icon(Icons.Default.Search, null) }
114+
IconButton({ onNavigateToSettings() }) { Icon(Icons.Default.Settings, null) }
114115
if (step == "read") {
115116
if (narration.isPlaying) IconButton({ viewModel.stopNarration() }) { Icon(Icons.Default.StopCircle, null, tint = Color.Red) }
116117
else IconButton({ viewModel.startChapterNarration(currentChapterContent.map { (num, txt) -> Verse(num, txt) }) }) { Icon(Icons.Default.PlayCircle, null) }

0 commit comments

Comments
 (0)