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