diff --git a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/SettingPaneContent.kt b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/SettingPaneContent.kt index fe2edda..06ea8e1 100644 --- a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/SettingPaneContent.kt +++ b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/SettingPaneContent.kt @@ -92,6 +92,7 @@ import com.artemchep.keyguard.feature.home.settings.component.settingVaultPersis import com.artemchep.keyguard.feature.home.settings.component.settingWebsiteIconsProvider import com.artemchep.keyguard.feature.home.settings.component.settingWriteAccessProvider import com.artemchep.keyguard.feature.navigation.NavigationIcon +import com.artemchep.keyguard.platform.CurrentPlatform import com.artemchep.keyguard.ui.ScaffoldLazyColumn import com.artemchep.keyguard.ui.skeleton.SkeletonItem import com.artemchep.keyguard.ui.toolbar.LargeToolbar @@ -266,6 +267,8 @@ fun SettingPaneContent( ) { val di = localDI() val state by remember(items, di, hub) { + val platform = CurrentPlatform + fun create( item: SettingPaneItem.Item, group: String = "", @@ -279,7 +282,18 @@ fun SettingPaneContent( itemKey = item.key, groupKey = group, args = args, - content = content?.content, + content = content + ?.takeIf { + if ( + it.platformClass != null && + !it.platformClass.isInstance(platform) + ) { + return@takeIf false + } + + true + } + ?.content, ) } diff --git a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/component/SettingClipboardAutoClear.kt b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/component/SettingClipboardAutoClear.kt index 46c8f83..bc6617c 100644 --- a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/component/SettingClipboardAutoClear.kt +++ b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/component/SettingClipboardAutoClear.kt @@ -13,6 +13,7 @@ import com.artemchep.keyguard.common.usecase.PutClipboardAutoClear import com.artemchep.keyguard.common.usecase.WindowCoroutineScope import com.artemchep.keyguard.feature.localization.textResource import com.artemchep.keyguard.platform.LeContext +import com.artemchep.keyguard.platform.Platform import com.artemchep.keyguard.res.Res import com.artemchep.keyguard.ui.FlatDropdown import com.artemchep.keyguard.ui.FlatItemAction @@ -57,7 +58,9 @@ fun settingClipboardAutoClearProvider( ) } - SettingIi { + SettingIi( + platformClass = Platform.Mobile::class, + ) { SettingClipboardAutoClear( text = text, dropdown = dropdown, diff --git a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/component/SettingClipboardAutoRefresh.kt b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/component/SettingClipboardAutoRefresh.kt index 315dff9..044ae35 100644 --- a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/component/SettingClipboardAutoRefresh.kt +++ b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/component/SettingClipboardAutoRefresh.kt @@ -18,6 +18,7 @@ import com.artemchep.keyguard.common.usecase.PutClipboardAutoRefresh import com.artemchep.keyguard.common.usecase.WindowCoroutineScope import com.artemchep.keyguard.feature.localization.textResource import com.artemchep.keyguard.platform.LeContext +import com.artemchep.keyguard.platform.Platform import com.artemchep.keyguard.res.Res import com.artemchep.keyguard.ui.FlatDropdown import com.artemchep.keyguard.ui.FlatItemAction @@ -65,7 +66,9 @@ fun settingClipboardAutoRefreshProvider( ) } - SettingIi { + SettingIi( + platformClass = Platform.Mobile::class, + ) { SettingClipboardAutoRefresh( text = text, dropdown = dropdown, diff --git a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/component/SettingComponent.kt b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/component/SettingComponent.kt index 97259bc..125b31e 100644 --- a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/component/SettingComponent.kt +++ b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/component/SettingComponent.kt @@ -5,11 +5,12 @@ import androidx.compose.runtime.Composable import com.artemchep.keyguard.platform.Platform import com.artemchep.keyguard.ui.FlatItem import kotlinx.coroutines.flow.Flow +import kotlin.reflect.KClass typealias SettingComponent = Flow data class SettingIi( - val platform: Platform? = null, + val platformClass: KClass? = null, val search: Search? = null, val content: @Composable () -> Unit, ) { diff --git a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/component/SettingScreenshots.kt b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/component/SettingScreenshots.kt index 700b67c..7077628 100644 --- a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/component/SettingScreenshots.kt +++ b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/component/SettingScreenshots.kt @@ -13,6 +13,7 @@ import com.artemchep.keyguard.common.io.launchIn import com.artemchep.keyguard.common.usecase.GetAllowScreenshots import com.artemchep.keyguard.common.usecase.PutAllowScreenshots import com.artemchep.keyguard.common.usecase.WindowCoroutineScope +import com.artemchep.keyguard.platform.Platform import com.artemchep.keyguard.res.Res import com.artemchep.keyguard.ui.FlatItem import com.artemchep.keyguard.ui.icons.icon @@ -41,6 +42,7 @@ fun settingScreenshotsProvider( } SettingIi( + platformClass = Platform.Mobile::class, search = SettingIi.Search( group = "conceal", tokens = listOf( diff --git a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/component/SettingVaultLockAfterScreenOff.kt b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/component/SettingVaultLockAfterScreenOff.kt index 55ac838..46dd2d1 100644 --- a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/component/SettingVaultLockAfterScreenOff.kt +++ b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/component/SettingVaultLockAfterScreenOff.kt @@ -14,6 +14,7 @@ import com.artemchep.keyguard.common.usecase.GetVaultLockAfterScreenOff import com.artemchep.keyguard.common.usecase.GetVaultPersist import com.artemchep.keyguard.common.usecase.PutVaultLockAfterScreenOff import com.artemchep.keyguard.common.usecase.WindowCoroutineScope +import com.artemchep.keyguard.platform.Platform import com.artemchep.keyguard.res.Res import com.artemchep.keyguard.ui.FlatItem import com.artemchep.keyguard.ui.icons.icon @@ -47,6 +48,7 @@ fun settingVaultLockAfterScreenOffProvider( } SettingIi( + platformClass = Platform.Mobile::class, search = SettingIi.Search( group = "lock", tokens = listOf(