Merge branch 'master' into fix/dropdown-colors
This commit is contained in:
commit
5deec061e2
5 changed files with 14 additions and 7 deletions
|
@ -3,6 +3,8 @@ package com.simplemobiletools.commons.activities
|
|||
import android.os.Bundle
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.compose.runtime.derivedStateOf
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.remember
|
||||
import com.simplemobiletools.commons.R
|
||||
import com.simplemobiletools.commons.compose.extensions.enableEdgeToEdgeSimple
|
||||
|
@ -19,7 +21,7 @@ class LicenseActivity : ComponentActivity() {
|
|||
enableEdgeToEdgeSimple()
|
||||
setContent {
|
||||
val licenseMask = remember { intent.getLongExtra(APP_LICENSES, 0) or LICENSE_KOTLIN }
|
||||
val thirdPartyLicenses = remember { initLicenses().filter { licenseMask and it.id != 0L }.toImmutableList() }
|
||||
val thirdPartyLicenses by remember { derivedStateOf { initLicenses().filter { licenseMask and it.id != 0L }.toImmutableList() } }
|
||||
AppThemeSurface {
|
||||
LicenseScreen(
|
||||
goBack = ::finish,
|
||||
|
|
|
@ -82,12 +82,12 @@ class ManageBlockedNumbersActivity : BaseSimpleActivity() {
|
|||
AddOrEditBlockedNumberAlertDialog(
|
||||
blockedNumber = clickedBlockedNumber,
|
||||
alertDialogState = addBlockedNumberDialogState,
|
||||
deleteBlockedNumber = {
|
||||
deleteBlockedNumber(it)
|
||||
deleteBlockedNumber = { blockedNumber ->
|
||||
deleteBlockedNumber(blockedNumber)
|
||||
updateBlockedNumbers()
|
||||
},
|
||||
addBlockedNumber = {
|
||||
addBlockedNumber(it)
|
||||
addBlockedNumber = { blockedNumber ->
|
||||
addBlockedNumber(blockedNumber)
|
||||
clickedBlockedNumber = null
|
||||
updateBlockedNumbers()
|
||||
}
|
||||
|
|
|
@ -254,7 +254,7 @@ fun SimpleLazyListScaffold(
|
|||
}
|
||||
|
||||
@Composable
|
||||
fun SimpleLazyListScaffold(
|
||||
fun SimpleScaffold(
|
||||
modifier: Modifier = Modifier,
|
||||
darkStatusBarIcons: Boolean = true,
|
||||
customTopBar: @Composable (scrolledColor: Color, navigationInteractionSource: MutableInteractionSource, scrollBehavior: TopAppBarScrollBehavior, statusBarColor: Int, colorTransitionFraction: Float, contrastColor: Color) -> Unit,
|
||||
|
|
|
@ -66,6 +66,7 @@ private const val RESET_IMMEDIATELY = 1L
|
|||
private const val RESET_IDLE = -1L
|
||||
private const val BETWEEN_CLICKS_TIME = 200 //time between a click which is slightly lower than the reset time
|
||||
private const val ON_LONG_CLICK_LABEL = "select"
|
||||
|
||||
@Composable
|
||||
internal fun ManageBlockedNumbersScreen(
|
||||
goBack: () -> Unit,
|
||||
|
@ -96,7 +97,7 @@ internal fun ManageBlockedNumbersScreen(
|
|||
clearSelection()
|
||||
}
|
||||
|
||||
SimpleLazyListScaffold(
|
||||
SimpleScaffold(
|
||||
darkStatusBarIcons = !isInActionMode,
|
||||
customTopBar = { scrolledColor: Color,
|
||||
navigationInteractionSource: MutableInteractionSource,
|
||||
|
|
|
@ -218,10 +218,14 @@ open class BaseConfig(val context: Context) {
|
|||
prefs.edit().putBoolean(USE_ENGLISH, useEnglish).commit()
|
||||
}
|
||||
|
||||
val useEnglishFlow = ::useEnglish.asFlowNonNull()
|
||||
|
||||
var wasUseEnglishToggled: Boolean
|
||||
get() = prefs.getBoolean(WAS_USE_ENGLISH_TOGGLED, false)
|
||||
set(wasUseEnglishToggled) = prefs.edit().putBoolean(WAS_USE_ENGLISH_TOGGLED, wasUseEnglishToggled).apply()
|
||||
|
||||
val wasUseEnglishToggledFlow = ::wasUseEnglishToggled.asFlowNonNull()
|
||||
|
||||
var wasSharedThemeEverActivated: Boolean
|
||||
get() = prefs.getBoolean(WAS_SHARED_THEME_EVER_ACTIVATED, false)
|
||||
set(wasSharedThemeEverActivated) = prefs.edit().putBoolean(WAS_SHARED_THEME_EVER_ACTIVATED, wasSharedThemeEverActivated).apply()
|
||||
|
|
Loading…
Reference in a new issue