Resolve Android warnings and improve stability
This commit is contained in:
parent
6e81547d83
commit
5ad97f4f21
3 changed files with 8 additions and 5 deletions
|
|
@ -10,6 +10,7 @@ import androidx.core.view.WindowCompat
|
||||||
import android.view.WindowManager
|
import android.view.WindowManager
|
||||||
import androidx.core.view.WindowInsetsCompat
|
import androidx.core.view.WindowInsetsCompat
|
||||||
import androidx.core.view.WindowInsetsControllerCompat
|
import androidx.core.view.WindowInsetsControllerCompat
|
||||||
|
import org.koin.androidx.compose.KoinAndroidContext
|
||||||
|
|
||||||
class MainActivity : ComponentActivity() {
|
class MainActivity : ComponentActivity() {
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
|
@ -21,9 +22,11 @@ class MainActivity : ComponentActivity() {
|
||||||
|
|
||||||
|
|
||||||
setContent {
|
setContent {
|
||||||
|
KoinAndroidContext {
|
||||||
App()
|
App()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
private fun hideSystemBar() {
|
private fun hideSystemBar() {
|
||||||
// Pour les versions d'Android plus récentes (API 30+)
|
// Pour les versions d'Android plus récentes (API 30+)
|
||||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.R) {
|
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.R) {
|
||||||
|
|
|
||||||
|
|
@ -496,7 +496,7 @@ actual class FMediaPlayer actual constructor(
|
||||||
while (isActive) {
|
while (isActive) {
|
||||||
if (isRunning && !isHolding) {
|
if (isRunning && !isHolding) {
|
||||||
val elapsedNano = System.nanoTime() - lastEventNano
|
val elapsedNano = System.nanoTime() - lastEventNano
|
||||||
val extraTicks = (elapsedNano / (usPerTick * 1000)).toLong()
|
val extraTicks = (elapsedNano / (usPerTick * 1000)).toLong().coerceAtLeast(0L)
|
||||||
val interpolated = (currentTickPos + extraTicks) / resolution
|
val interpolated = (currentTickPos + extraTicks) / resolution
|
||||||
val rawGrid = interpolated.toInt().coerceAtLeast(0)
|
val rawGrid = interpolated.toInt().coerceAtLeast(0)
|
||||||
sharedScreenModel.updateActiveIndexByIndex(rawGrid)
|
sharedScreenModel.updateActiveIndexByIndex(rawGrid)
|
||||||
|
|
|
||||||
|
|
@ -161,9 +161,9 @@ class Solfa(val sharedScreenModel: SharedScreenModel, private val fileRepository
|
||||||
initialDirectory = if (initialPath.isNotBlank()) initialPath else homedir,
|
initialDirectory = if (initialPath.isNotBlank()) initialPath else homedir,
|
||||||
onFileSelected = { path ->
|
onFileSelected = { path ->
|
||||||
if (path != null) {
|
if (path != null) {
|
||||||
|
screenModelScope.launch(Dispatchers.Default) {
|
||||||
sharedScreenModel.reset()
|
sharedScreenModel.reset()
|
||||||
parse(path)
|
parse(path)
|
||||||
screenModelScope.launch {
|
|
||||||
stateSettings.saveLastUsedDir(path)
|
stateSettings.saveLastUsedDir(path)
|
||||||
}
|
}
|
||||||
//loadSolfa()
|
//loadSolfa()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue