~repos /only-bible-app
git clone https://pyrossh.dev/repos/only-bible-app.git
The only bible app you will ever need. No ads. No in-app purchases. No distractions.
336f9062
—
Peter John 1 year ago
fix bottomBar not closing
app/src/main/java/dev/pyrossh/onlyBible/AppViewModel.kt
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
package dev.pyrossh.onlyBible
|
|
2
2
|
|
|
3
3
|
import android.app.Application
|
|
4
|
-
import android.app.UiModeManager
|
|
5
4
|
import android.content.Context
|
|
6
5
|
import android.content.Intent
|
|
7
|
-
import android.content.res.Configuration
|
|
8
6
|
import androidx.compose.foundation.lazy.LazyListState
|
|
9
7
|
import androidx.compose.runtime.MutableState
|
|
10
8
|
import androidx.compose.runtime.getValue
|
|
@@ -76,7 +74,7 @@ class AppViewModel(application: Application) : AndroidViewModel(application) {
|
|
|
76
74
|
0,
|
|
77
75
|
0
|
|
78
76
|
)
|
|
79
|
-
var uiMode by mutableIntStateOf(
|
|
77
|
+
var uiMode by mutableIntStateOf(0)
|
|
80
78
|
var fontType by preferenceMutableState(
|
|
81
79
|
coroutineScope = viewModelScope,
|
|
82
80
|
context = context,
|
app/src/main/java/dev/pyrossh/onlyBible/ChapterScreen.kt
CHANGED
|
@@ -46,6 +46,7 @@ import androidx.compose.material3.TextButton
|
|
|
46
46
|
import androidx.compose.material3.TopAppBar
|
|
47
47
|
import androidx.compose.runtime.Composable
|
|
48
48
|
import androidx.compose.runtime.DisposableEffect
|
|
49
|
+
import androidx.compose.runtime.LaunchedEffect
|
|
49
50
|
import androidx.compose.runtime.MutableIntState
|
|
50
51
|
import androidx.compose.runtime.getValue
|
|
51
52
|
import androidx.compose.runtime.mutableIntStateOf
|
|
@@ -152,6 +153,8 @@ fun ChapterScreen(
|
|
|
152
153
|
val fontType = FontType.valueOf(model.fontType)
|
|
153
154
|
val fontSizeDelta = model.fontSizeDelta
|
|
154
155
|
val boldWeight = if (model.fontBoldEnabled) FontWeight.W700 else FontWeight.W400
|
|
156
|
+
val chapterVerses =
|
|
157
|
+
model.verses.filter { it.bookIndex == bookIndex && it.chapterIndex == chapterIndex }
|
|
155
158
|
val scope = rememberCoroutineScope()
|
|
156
159
|
var selectedVerses by rememberSaveable {
|
|
157
160
|
mutableStateOf(listOf<Verse>())
|
|
@@ -174,8 +177,9 @@ fun ChapterScreen(
|
|
|
174
177
|
model.speechService.SynthesisCompleted.removeEventListener(completed)
|
|
175
178
|
}
|
|
176
179
|
}
|
|
180
|
+
LaunchedEffect(key1 = chapterVerses) {
|
|
177
|
-
|
|
181
|
+
selectedVerses = listOf()
|
|
178
|
-
|
|
182
|
+
}
|
|
179
183
|
val headingColor = MaterialTheme.colorScheme.onSurface // MaterialTheme.colorScheme.primary,
|
|
180
184
|
val view = LocalView.current
|
|
181
185
|
val window = (view.context as Activity).window
|
app/src/main/res/values/themes.xml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="utf-8"?>
|
|
2
2
|
<resources>
|
|
3
3
|
<style name="Theme.BibleAppSplash" parent="Theme.SplashScreen">
|
|
4
|
-
<item name="windowSplashScreenAnimatedIcon">@drawable/
|
|
4
|
+
<item name="windowSplashScreenAnimatedIcon">@drawable/cross_2</item>
|
|
5
5
|
<item name="windowSplashScreenBackground">@color/splash_bg</item>
|
|
6
6
|
<item name="postSplashScreenTheme">@style/Theme.BibleApp</item>
|
|
7
7
|
</style>
|