Compare commits
2 commits
1829fcdb74
...
1b6b97243b
| Author | SHA1 | Date | |
|---|---|---|---|
| 1b6b97243b | |||
| 4f5e93e182 |
4 changed files with 19 additions and 13 deletions
|
|
@ -15,6 +15,7 @@ import androidx.activity.compose.setContent
|
|||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.CompositionLocalProvider
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.staticCompositionLocalOf
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.core.app.ActivityCompat
|
||||
|
|
@ -91,6 +92,11 @@ class MainActivity : ComponentActivity() {
|
|||
}
|
||||
|
||||
setContent {
|
||||
val isFullScreenEnabled = sharedScreenModel.isFullScreen.value
|
||||
|
||||
LaunchedEffect(isFullScreenEnabled) {
|
||||
updateSystemBarsVisibility(isFullScreenEnabled)
|
||||
}
|
||||
KoinAndroidContext {
|
||||
CompositionLocalProvider(
|
||||
LocalFullscreenController provides { isFullScreen ->
|
||||
|
|
|
|||
|
|
@ -1622,7 +1622,7 @@ private fun TuoEditDialogWrapper(
|
|||
|
||||
fun fitLitanyLabel(
|
||||
stars: String,
|
||||
text: String,
|
||||
rawText: String,
|
||||
textMeasurer: TextMeasurer,
|
||||
style: TextStyle,
|
||||
maxWidthPx: Float
|
||||
|
|
@ -1630,6 +1630,7 @@ fun fitLitanyLabel(
|
|||
fun widthOf(s: String): Int =
|
||||
textMeasurer.measure(text = s, style = style, maxLines = 1, softWrap = false).size.width
|
||||
|
||||
val text = rawText.replace(Regex("[_/]"), "")
|
||||
val full = stars + text
|
||||
if (widthOf(full) <= maxWidthPx) return full
|
||||
var end = text.length
|
||||
|
|
|
|||
|
|
@ -128,14 +128,11 @@ fun MainScreenWithDrawer(
|
|||
|
||||
val isFullScreenEnabled by sharedScreenModel.isFullScreen.collectAsState()
|
||||
val fullscreenController = LocalFullscreenController.current
|
||||
|
||||
LaunchedEffect(isFullScreenEnabled, isSearchActive) {
|
||||
fullscreenController(isFullScreenEnabled)
|
||||
}
|
||||
val isImeVisible = WindowInsets.ime.asPaddingValues().calculateBottomPadding() > 0.dp
|
||||
LaunchedEffect(isImeVisible) {
|
||||
if (!isImeVisible && isFullScreenEnabled) {
|
||||
fullscreenController(true)
|
||||
|
||||
LaunchedEffect(isFullScreenEnabled, isSearchActive, isImeVisible) {
|
||||
if (!isImeVisible) {
|
||||
fullscreenController(isFullScreenEnabled)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -737,11 +737,13 @@ class SharedScreenModel(private val fileRepository: FileRepository) : ScreenMode
|
|||
_harmonyView.value = enabled
|
||||
}
|
||||
|
||||
private val _isFullScreen = MutableStateFlow(false)
|
||||
val isFullScreenV = prefs.getBoolean("isFullScreen", false)
|
||||
private val _isFullScreen = MutableStateFlow(isFullScreenV)
|
||||
val isFullScreen = _isFullScreen.asStateFlow()
|
||||
|
||||
fun toggleFullScreen(enabled: Boolean) {
|
||||
_isFullScreen.value = enabled
|
||||
prefs.putBoolean("isFullScreen", enabled)
|
||||
}
|
||||
val transpositionInterval = MutableStateFlow(0)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue