diff --git a/CHANGELOG.md b/CHANGELOG.md index 50ae21b729..effa173d49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ Attention: don't forget to add the flag for F-Droid before release - [FIX] Share infrared remote after rename - [FIX] Fix app bar colors on remote controls - [FIX] Fix remote controls texts and favorite dropdown +- [FIX] Move remote controls into tools tab - [FIX] Fix crash when saving files on remote controls - [FIX] Remove share from remote controls - [CI] Fix merge-queue files diff diff --git a/components/archive/category/src/main/java/com/flipperdevices/archive/category/api/CategoryScreenDecomposeComponentImpl.kt b/components/archive/category/src/main/java/com/flipperdevices/archive/category/api/CategoryScreenDecomposeComponentImpl.kt index 00bdf2cda5..aa19b201d6 100644 --- a/components/archive/category/src/main/java/com/flipperdevices/archive/category/api/CategoryScreenDecomposeComponentImpl.kt +++ b/components/archive/category/src/main/java/com/flipperdevices/archive/category/api/CategoryScreenDecomposeComponentImpl.kt @@ -9,7 +9,6 @@ import com.flipperdevices.archive.category.composable.ComposableCategory import com.flipperdevices.archive.category.composable.ComposableDeleted import com.flipperdevices.archive.category.model.CategoryNavigationConfig import com.flipperdevices.archive.category.viewmodels.CategoryViewModel -import com.flipperdevices.archive.category.viewmodels.DebugSettingsViewModel import com.flipperdevices.archive.category.viewmodels.DeleteViewModel import com.flipperdevices.archive.model.CategoryType import com.flipperdevices.bridge.dao.api.model.FlipperKeyPath @@ -34,15 +33,11 @@ class CategoryScreenDecomposeComponentImpl @AssistedInject constructor( private val deleteViewModelProvider: Provider, private val categoryViewModelFactory: CategoryViewModel.Factory, private val synchronizationUiApi: SynchronizationUiApi, - private val debugSettingsViewModelProvider: Provider, ) : ScreenDecomposeComponent(componentContext) { @Composable @Suppress("NonSkippableComposable") override fun Render() { - val debugSettingsViewModel = viewModelWithFactory(key = null) { - debugSettingsViewModelProvider.get() - } val deleteViewModel = viewModelWithFactory(key = null) { deleteViewModelProvider.get() } @@ -57,8 +52,6 @@ class CategoryScreenDecomposeComponentImpl @AssistedInject constructor( val onOpenKeyScreen: (FlipperKeyPath) -> Unit = { flipperKeyPath -> rootNavigation.push(RootScreenConfig.OpenKey(flipperKeyPath)) } - val showRemoteControls by debugSettingsViewModel.showRemoteControls.collectAsState() - when (categoryType) { is CategoryType.ByFileType -> ComposableCategory( categoryType = categoryType, @@ -67,7 +60,6 @@ class CategoryScreenDecomposeComponentImpl @AssistedInject constructor( onOpenKeyScreen = onOpenKeyScreen, categoryState = categoryState, synchronizationState = synchronizationState, - showRemoteControls = showRemoteControls ) CategoryType.Deleted -> ComposableDeleted( diff --git a/components/archive/category/src/main/java/com/flipperdevices/archive/category/composable/ComposableCategory.kt b/components/archive/category/src/main/java/com/flipperdevices/archive/category/composable/ComposableCategory.kt index 38cc3607f7..492d819052 100644 --- a/components/archive/category/src/main/java/com/flipperdevices/archive/category/composable/ComposableCategory.kt +++ b/components/archive/category/src/main/java/com/flipperdevices/archive/category/composable/ComposableCategory.kt @@ -20,42 +20,21 @@ import com.flipperdevices.archive.model.CategoryType import com.flipperdevices.archive.shared.composable.ComposableKeyCard import com.flipperdevices.bridge.dao.api.model.FlipperKey import com.flipperdevices.bridge.dao.api.model.FlipperKeyPath -import com.flipperdevices.bridge.dao.api.model.FlipperKeyType import com.flipperdevices.bridge.dao.api.model.FlipperKeyType.Companion.colorByFlipperKeyType import com.flipperdevices.bridge.synchronization.api.SynchronizationState import com.flipperdevices.bridge.synchronization.api.SynchronizationUiApi import com.flipperdevices.core.ui.ktx.OrangeAppBar -import com.flipperdevices.core.ui.ktx.clickableRipple import com.flipperdevices.core.ui.theme.LocalPallet -import com.flipperdevices.core.ui.theme.LocalPalletV2 import com.flipperdevices.core.ui.theme.LocalTypography -import com.flipperdevices.deeplink.model.Deeplink import com.flipperdevices.keyparser.api.model.FlipperKeyParsed -import com.flipperdevices.rootscreen.api.LocalDeeplinkHandler import kotlinx.collections.immutable.ImmutableList -@Composable -fun AddRemoteEndBlock(modifier: Modifier = Modifier) { - val deeplinkHandler = LocalDeeplinkHandler.current - Text( - text = stringResource(R.string.add_remote), - style = LocalTypography.current.buttonB14, - color = LocalPalletV2.current.text.title.blackOnColor, - modifier = modifier - .padding(horizontal = 14.dp) - .clickableRipple { - deeplinkHandler.handleDeeplink(Deeplink.BottomBar.ArchiveTab.RemoteControls) - } - ) -} - @Composable fun ComposableCategory( categoryType: CategoryType.ByFileType, categoryState: CategoryState, synchronizationState: SynchronizationState, synchronizationUiApi: SynchronizationUiApi, - showRemoteControls: Boolean, onBack: () -> Unit, modifier: Modifier = Modifier, onOpenKeyScreen: (FlipperKeyPath) -> Unit @@ -64,11 +43,6 @@ fun ComposableCategory( OrangeAppBar( title = categoryType.fileType.humanReadableName, onBack = onBack, - endBlock = { - if (categoryType.fileType == FlipperKeyType.INFRARED && showRemoteControls) { - AddRemoteEndBlock() - } - } ) ComposableCategoryContent( categoryType = categoryType, diff --git a/components/archive/category/src/main/java/com/flipperdevices/archive/category/viewmodels/DebugSettingsViewModel.kt b/components/archive/category/src/main/java/com/flipperdevices/archive/category/viewmodels/DebugSettingsViewModel.kt deleted file mode 100644 index 77210e460d..0000000000 --- a/components/archive/category/src/main/java/com/flipperdevices/archive/category/viewmodels/DebugSettingsViewModel.kt +++ /dev/null @@ -1,18 +0,0 @@ -package com.flipperdevices.archive.category.viewmodels - -import androidx.datastore.core.DataStore -import com.flipperdevices.core.preference.pb.Settings -import com.flipperdevices.core.ui.lifecycle.DecomposeViewModel -import kotlinx.coroutines.flow.SharingStarted -import kotlinx.coroutines.flow.StateFlow -import kotlinx.coroutines.flow.map -import kotlinx.coroutines.flow.stateIn -import javax.inject.Inject - -class DebugSettingsViewModel @Inject constructor( - settingsDataStore: DataStore -) : DecomposeViewModel() { - val showRemoteControls: StateFlow = settingsDataStore.data - .map { it.show_remote_controls } - .stateIn(viewModelScope, SharingStarted.Eagerly, false) -} diff --git a/components/archive/impl/src/main/java/com/flipperdevices/archive/impl/api/ArchiveDecomposeComponentImpl.kt b/components/archive/impl/src/main/java/com/flipperdevices/archive/impl/api/ArchiveDecomposeComponentImpl.kt index cefa4c08fb..b3dd88ca77 100644 --- a/components/archive/impl/src/main/java/com/flipperdevices/archive/impl/api/ArchiveDecomposeComponentImpl.kt +++ b/components/archive/impl/src/main/java/com/flipperdevices/archive/impl/api/ArchiveDecomposeComponentImpl.kt @@ -13,7 +13,6 @@ import com.flipperdevices.archive.impl.model.toArchiveNavigationStack import com.flipperdevices.bottombar.handlers.ResetTabDecomposeHandler import com.flipperdevices.core.di.AppGraph import com.flipperdevices.deeplink.model.Deeplink -import com.flipperdevices.remotecontrols.api.RemoteControlsScreenDecomposeComponent import com.flipperdevices.ui.decompose.DecomposeComponent import com.flipperdevices.ui.decompose.DecomposeOnBackParameter import com.flipperdevices.ui.decompose.findComponentByConfig @@ -32,7 +31,6 @@ class ArchiveDecomposeComponentImpl @AssistedInject constructor( private val openCategoryFactory: CategoryDecomposeComponent.Factory, private val searchFactory: SearchDecomposeComponent.Factory, private val archiveScreenFactory: ArchiveScreenDecomposeComponentImpl.Factory, - private val remoteControlsComponentFactory: RemoteControlsScreenDecomposeComponent.Factory, ) : ArchiveDecomposeComponent(), ComponentContext by componentContext, ResetTabDecomposeHandler { @@ -67,11 +65,6 @@ class ArchiveDecomposeComponentImpl @AssistedInject constructor( onItemSelected = null, onBack = { navigation.popOr(onBack::invoke) } ) - - is ArchiveNavigationConfig.RemoteControls -> remoteControlsComponentFactory( - componentContext = componentContext, - onBack = { navigation.popOr(onBack::invoke) } - ) } override fun handleDeeplink(deeplink: Deeplink.BottomBar.ArchiveTab) { diff --git a/components/archive/impl/src/main/java/com/flipperdevices/archive/impl/model/ArchiveNavigationConfig.kt b/components/archive/impl/src/main/java/com/flipperdevices/archive/impl/model/ArchiveNavigationConfig.kt index 9e35ce11c9..66eb4ef016 100644 --- a/components/archive/impl/src/main/java/com/flipperdevices/archive/impl/model/ArchiveNavigationConfig.kt +++ b/components/archive/impl/src/main/java/com/flipperdevices/archive/impl/model/ArchiveNavigationConfig.kt @@ -17,9 +17,6 @@ sealed class ArchiveNavigationConfig { @Serializable data object OpenSearch : ArchiveNavigationConfig() - - @Serializable - data object RemoteControls : ArchiveNavigationConfig() } fun Deeplink.BottomBar.ArchiveTab?.toArchiveNavigationStack(): List { @@ -39,10 +36,6 @@ fun Deeplink.BottomBar.ArchiveTab?.toArchiveNavigationStack(): List { } - - Deeplink.BottomBar.ArchiveTab.RemoteControls -> { - stack.add(ArchiveNavigationConfig.RemoteControls) - } } return stack } diff --git a/components/core/preference/src/commonMain/proto/settings.proto b/components/core/preference/src/commonMain/proto/settings.proto index 2de6a9cb0d..2b4c64b2e5 100644 --- a/components/core/preference/src/commonMain/proto/settings.proto +++ b/components/core/preference/src/commonMain/proto/settings.proto @@ -60,5 +60,4 @@ message Settings { bool fatal_ble_security_exception_happens = 26; bool notification_topic_update_enabled = 27; bool notification_dialog_shown = 28; - bool show_remote_controls = 29; } \ No newline at end of file diff --git a/components/deeplink/api/src/main/java/com/flipperdevices/deeplink/model/Deeplink.kt b/components/deeplink/api/src/main/java/com/flipperdevices/deeplink/model/Deeplink.kt index 4c8a93710a..faa4e02cd8 100644 --- a/components/deeplink/api/src/main/java/com/flipperdevices/deeplink/model/Deeplink.kt +++ b/components/deeplink/api/src/main/java/com/flipperdevices/deeplink/model/Deeplink.kt @@ -51,9 +51,6 @@ sealed interface Deeplink { @Serializable sealed interface ArchiveTab : BottomBar { - @Serializable - data object RemoteControls : ArchiveTab - @Serializable sealed interface ArchiveCategory : ArchiveTab { val category: FlipperKeyType? diff --git a/components/remote-controls/categories/impl/src/main/kotlin/com/flipperdevices/remotecontrols/impl/categories/composable/components/DeviceCategoriesLoadedContent.kt b/components/remote-controls/categories/impl/src/main/kotlin/com/flipperdevices/remotecontrols/impl/categories/composable/components/DeviceCategoriesLoadedContent.kt index 3baea45f17..e39c18d85d 100644 --- a/components/remote-controls/categories/impl/src/main/kotlin/com/flipperdevices/remotecontrols/impl/categories/composable/components/DeviceCategoriesLoadedContent.kt +++ b/components/remote-controls/categories/impl/src/main/kotlin/com/flipperdevices/remotecontrols/impl/categories/composable/components/DeviceCategoriesLoadedContent.kt @@ -1,6 +1,7 @@ package com.flipperdevices.remotecontrols.impl.categories.composable.components import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.grid.GridCells import androidx.compose.foundation.lazy.grid.LazyVerticalGrid @@ -19,7 +20,9 @@ internal fun DeviceCategoriesLoadedContent( ) { LazyVerticalGrid( columns = GridCells.Fixed(2), - modifier = modifier.padding(horizontal = 16.dp, vertical = 14.dp), + modifier = modifier + .padding(horizontal = 16.dp, vertical = 14.dp) + .fillMaxHeight(), horizontalArrangement = Arrangement.spacedBy(12.dp), verticalArrangement = Arrangement.spacedBy(12.dp) ) { diff --git a/components/settings/impl/src/main/java/com/flipperdevices/settings/impl/composable/category/DebugCategory.kt b/components/settings/impl/src/main/java/com/flipperdevices/settings/impl/composable/category/DebugCategory.kt index e3cdca115c..da09f72bdc 100644 --- a/components/settings/impl/src/main/java/com/flipperdevices/settings/impl/composable/category/DebugCategory.kt +++ b/components/settings/impl/src/main/java/com/flipperdevices/settings/impl/composable/category/DebugCategory.kt @@ -93,12 +93,6 @@ private fun DebugCategoryItems( onSwitchState = { onSwitch(DebugSettingSwitch.FapHubDev, it) } ) GrayDivider() - SwitchableElement( - titleId = R.string.debug_application_show_remote_controls, - state = settings.show_remote_controls, - onSwitchState = { onSwitch(DebugSettingSwitch.ShowRemoteControls, it) } - ) - GrayDivider() SwitchableElement( titleId = R.string.debug_selfupdater, state = settings.self_updater_debug, diff --git a/components/settings/impl/src/main/java/com/flipperdevices/settings/impl/model/DebugSetting.kt b/components/settings/impl/src/main/java/com/flipperdevices/settings/impl/model/DebugSetting.kt index 32d5763d8d..45eb5c68cc 100644 --- a/components/settings/impl/src/main/java/com/flipperdevices/settings/impl/model/DebugSetting.kt +++ b/components/settings/impl/src/main/java/com/flipperdevices/settings/impl/model/DebugSetting.kt @@ -7,7 +7,6 @@ sealed interface DebugSettingSwitch { data object SkipAutoSync : DebugSettingSwitch data object FapHubDev : DebugSettingSwitch data object SelfUpdaterDebug : DebugSettingSwitch - data object ShowRemoteControls : DebugSettingSwitch } sealed interface DebugSettingAction { diff --git a/components/settings/impl/src/main/java/com/flipperdevices/settings/impl/viewmodels/DebugViewModel.kt b/components/settings/impl/src/main/java/com/flipperdevices/settings/impl/viewmodels/DebugViewModel.kt index e9a5244239..b841363a95 100644 --- a/components/settings/impl/src/main/java/com/flipperdevices/settings/impl/viewmodels/DebugViewModel.kt +++ b/components/settings/impl/src/main/java/com/flipperdevices/settings/impl/viewmodels/DebugViewModel.kt @@ -49,7 +49,6 @@ class DebugViewModel @Inject constructor( DebugSettingSwitch.SelfUpdaterDebug -> onSwitchSelfUpdaterDebug(flag) DebugSettingSwitch.SkipAutoSync -> onSwitchSkipAutoSync(flag) DebugSettingSwitch.SkipProvisioning -> onSwitchIgnoreSubGhzProvisioning(flag) - DebugSettingSwitch.ShowRemoteControls -> onShowRemoteControls(flag) } } @@ -140,16 +139,6 @@ class DebugViewModel @Inject constructor( } } - private fun onShowRemoteControls(enabled: Boolean) { - viewModelScope.launch { - settingsDataStore.updateData { - it.copy( - show_remote_controls = enabled - ) - } - } - } - private fun installAllApplication() { viewModelScope.launch { fapInstallationAllApi.installAll() diff --git a/components/toolstab/impl/build.gradle.kts b/components/toolstab/impl/build.gradle.kts index 8ab960a25d..8e7fc27c1e 100644 --- a/components/toolstab/impl/build.gradle.kts +++ b/components/toolstab/impl/build.gradle.kts @@ -24,6 +24,7 @@ dependencies { implementation(projects.components.bottombar.api) implementation(projects.components.rootscreen.api) implementation(projects.components.info.shared) + implementation(projects.components.remoteControls.main.api) // Compose implementation(libs.compose.ui) diff --git a/components/toolstab/impl/src/main/java/com/flipperdevices/toolstab/impl/api/ToolsDecomposeComponentImpl.kt b/components/toolstab/impl/src/main/java/com/flipperdevices/toolstab/impl/api/ToolsDecomposeComponentImpl.kt index de1a5ab4b8..cdfe7f748d 100644 --- a/components/toolstab/impl/src/main/java/com/flipperdevices/toolstab/impl/api/ToolsDecomposeComponentImpl.kt +++ b/components/toolstab/impl/src/main/java/com/flipperdevices/toolstab/impl/api/ToolsDecomposeComponentImpl.kt @@ -9,6 +9,7 @@ import com.flipperdevices.bottombar.handlers.ResetTabDecomposeHandler import com.flipperdevices.core.di.AppGraph import com.flipperdevices.deeplink.model.Deeplink import com.flipperdevices.nfc.mfkey32.api.MfKey32DecomposeComponent +import com.flipperdevices.remotecontrols.api.RemoteControlsScreenDecomposeComponent import com.flipperdevices.toolstab.api.ToolsDecomposeComponent import com.flipperdevices.toolstab.impl.model.ToolsNavigationConfig import com.flipperdevices.toolstab.impl.model.toConfigStack @@ -26,7 +27,8 @@ class ToolsDecomposeComponentImpl @AssistedInject constructor( @Assisted deeplink: Deeplink.BottomBar.ToolsTab?, @Assisted private val onBack: DecomposeOnBackParameter, private val hubMainFactory: ToolsMainScreenDecomposeComponentImpl.Factory, - private val mfKey32Factory: MfKey32DecomposeComponent.Factory + private val mfKey32Factory: MfKey32DecomposeComponent.Factory, + private val remoteControlsComponentFactory: RemoteControlsScreenDecomposeComponent.Factory, ) : ToolsDecomposeComponent(), ComponentContext by componentContext, ResetTabDecomposeHandler { @@ -51,6 +53,11 @@ class ToolsDecomposeComponentImpl @AssistedInject constructor( componentContext = componentContext, onBack = { navigation.popOr(onBack::invoke) } ) + + ToolsNavigationConfig.RemoteControls -> remoteControlsComponentFactory( + componentContext = componentContext, + onBack = { navigation.popOr(onBack::invoke) } + ) } override fun handleDeeplink(deeplink: Deeplink.BottomBar.ToolsTab) { diff --git a/components/toolstab/impl/src/main/java/com/flipperdevices/toolstab/impl/api/ToolsMainScreenDecomposeComponentImpl.kt b/components/toolstab/impl/src/main/java/com/flipperdevices/toolstab/impl/api/ToolsMainScreenDecomposeComponentImpl.kt index a768a4c923..f84526d5b3 100644 --- a/components/toolstab/impl/src/main/java/com/flipperdevices/toolstab/impl/api/ToolsMainScreenDecomposeComponentImpl.kt +++ b/components/toolstab/impl/src/main/java/com/flipperdevices/toolstab/impl/api/ToolsMainScreenDecomposeComponentImpl.kt @@ -33,6 +33,9 @@ class ToolsMainScreenDecomposeComponentImpl @AssistedInject constructor( hasNotification = hasNotification, onOpenMfKey32 = { navigation.pushToFront(ToolsNavigationConfig.MfKey32) + }, + onOpenRemoteControls = { + navigation.pushToFront(ToolsNavigationConfig.RemoteControls) } ) } diff --git a/components/toolstab/impl/src/main/java/com/flipperdevices/toolstab/impl/composable/ComposableHub.kt b/components/toolstab/impl/src/main/java/com/flipperdevices/toolstab/impl/composable/ComposableHub.kt index 29485e615d..dc87d96f77 100644 --- a/components/toolstab/impl/src/main/java/com/flipperdevices/toolstab/impl/composable/ComposableHub.kt +++ b/components/toolstab/impl/src/main/java/com/flipperdevices/toolstab/impl/composable/ComposableHub.kt @@ -6,11 +6,13 @@ import androidx.compose.ui.Modifier import com.flipperdevices.core.ui.ktx.OrangeAppBar import com.flipperdevices.toolstab.impl.R import com.flipperdevices.toolstab.impl.composable.elements.MifareClassicComposable +import com.flipperdevices.toolstab.impl.composable.elements.RemoteControlsComposable @Composable fun ComposableHub( hasNotification: Boolean, onOpenMfKey32: () -> Unit, + onOpenRemoteControls: () -> Unit, modifier: Modifier = Modifier ) { Column(modifier) { @@ -21,5 +23,8 @@ fun ComposableHub( hasMfKey32Notification = hasNotification, onOpenMfKey32 = onOpenMfKey32 ) + RemoteControlsComposable( + onOpenRemoteControls = onOpenRemoteControls + ) } } diff --git a/components/toolstab/impl/src/main/java/com/flipperdevices/toolstab/impl/composable/elements/RemoteControlsComposable.kt b/components/toolstab/impl/src/main/java/com/flipperdevices/toolstab/impl/composable/elements/RemoteControlsComposable.kt new file mode 100644 index 0000000000..10516cdae5 --- /dev/null +++ b/components/toolstab/impl/src/main/java/com/flipperdevices/toolstab/impl/composable/elements/RemoteControlsComposable.kt @@ -0,0 +1,132 @@ +package com.flipperdevices.toolstab.impl.composable.elements + +import androidx.compose.foundation.Image +import androidx.compose.foundation.border +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.Card +import androidx.compose.material.Icon +import androidx.compose.material.MaterialTheme +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import com.flipperdevices.core.ui.ktx.clickableRipple +import com.flipperdevices.core.ui.theme.FlipperThemeInternal +import com.flipperdevices.core.ui.theme.LocalPallet +import com.flipperdevices.core.ui.theme.LocalPalletV2 +import com.flipperdevices.core.ui.theme.LocalTypography +import com.flipperdevices.toolstab.impl.R +import com.flipperdevices.core.ui.res.R as DesignSystem + +@Composable +fun RemoteControlsComposable( + onOpenRemoteControls: () -> Unit, + modifier: Modifier = Modifier, +) { + Card( + modifier = modifier.padding(14.dp), + shape = RoundedCornerShape(10.dp) + ) { + Column { + RemoteControlsTitle() + RemoteControls( + modifier = Modifier.clickableRipple(onClick = onOpenRemoteControls), + ) + } + } +} + +@Composable +private fun RemoteControlsTitle() = Row( + verticalAlignment = Alignment.CenterVertically +) { + Icon( + modifier = Modifier + .padding(start = 12.dp, end = 12.dp, top = 12.dp, bottom = 6.dp) + .size(24.dp), + painter = painterResource(DesignSystem.drawable.ic_fileformat_ir), + contentDescription = stringResource(R.string.remotes_library_infrared_title), + tint = LocalPalletV2.current.icon.blackAndWhite.default + ) + Text( + text = stringResource(R.string.remotes_library_infrared_title), + style = LocalTypography.current.buttonB16, + color = LocalPallet.current.text100 + ) +} + +@Composable +private fun RemoteControls( + modifier: Modifier = Modifier +) = Row( + modifier = modifier, + verticalAlignment = Alignment.CenterVertically +) { + Image( + modifier = Modifier + .padding(start = 12.dp, bottom = 6.dp, top = 6.dp) + .size(64.dp), + painter = painterResource( + if (MaterialTheme.colors.isLight) { + R.drawable.pic_remotes_library_light + } else { + R.drawable.pic_remotes_library_dark + } + ), + contentDescription = stringResource(R.string.remotes_library_title) + ) + Column( + Modifier + .weight(1f) + .padding(horizontal = 8.dp) + ) { + Text( + text = stringResource(R.string.remotes_library_title), + style = LocalTypography.current.bodyM14, + color = LocalPallet.current.text100 + ) + Text( + text = stringResource(R.string.remotes_library_desc), + style = LocalTypography.current.subtitleR12, + color = LocalPallet.current.text30 + ) + } + + Text( + text = stringResource(R.string.card_beta), + style = LocalTypography.current.subtitleR12, + color = LocalPallet.current.text30, + modifier = Modifier + .border( + 1.dp, + LocalPalletV2.current.action.neutral.border.secondary.default, + RoundedCornerShape(30.dp) + ) + .clip(RoundedCornerShape(30.dp)) + .padding(vertical = 4.dp, horizontal = 8.dp) + ) + + Icon( + modifier = Modifier.padding(start = 8.dp, end = 8.dp), + painter = painterResource(id = DesignSystem.drawable.ic_navigate), + contentDescription = stringResource(R.string.remotes_library_title), + tint = LocalPallet.current.iconTint30 + ) +} + +@Preview +@Composable +private fun RemoteControlsComposablePreview() { + FlipperThemeInternal { + RemoteControlsComposable(onOpenRemoteControls = {}) + } +} diff --git a/components/toolstab/impl/src/main/java/com/flipperdevices/toolstab/impl/model/ToolsNavigationConfig.kt b/components/toolstab/impl/src/main/java/com/flipperdevices/toolstab/impl/model/ToolsNavigationConfig.kt index 566569fed8..fd73855828 100644 --- a/components/toolstab/impl/src/main/java/com/flipperdevices/toolstab/impl/model/ToolsNavigationConfig.kt +++ b/components/toolstab/impl/src/main/java/com/flipperdevices/toolstab/impl/model/ToolsNavigationConfig.kt @@ -10,6 +10,9 @@ sealed class ToolsNavigationConfig { @Serializable data object MfKey32 : ToolsNavigationConfig() + + @Serializable + data object RemoteControls : ToolsNavigationConfig() } fun Deeplink.BottomBar.ToolsTab?.toConfigStack(): List { diff --git a/components/toolstab/impl/src/main/res/drawable/pic_remotes_library_dark.xml b/components/toolstab/impl/src/main/res/drawable/pic_remotes_library_dark.xml new file mode 100644 index 0000000000..9416ea603b --- /dev/null +++ b/components/toolstab/impl/src/main/res/drawable/pic_remotes_library_dark.xml @@ -0,0 +1,31 @@ + + + + + + + + + + diff --git a/components/toolstab/impl/src/main/res/drawable/pic_remotes_library_light.xml b/components/toolstab/impl/src/main/res/drawable/pic_remotes_library_light.xml new file mode 100644 index 0000000000..237cdb0d27 --- /dev/null +++ b/components/toolstab/impl/src/main/res/drawable/pic_remotes_library_light.xml @@ -0,0 +1,31 @@ + + + + + + + + + + diff --git a/components/toolstab/impl/src/main/res/values/strings.xml b/components/toolstab/impl/src/main/res/values/strings.xml index 852063513f..3a3fd0b978 100644 --- a/components/toolstab/impl/src/main/res/values/strings.xml +++ b/components/toolstab/impl/src/main/res/values/strings.xml @@ -6,4 +6,9 @@ MIFARE Classic Mfkey32 (Detect Reader) Calculate keys from Detect Reader + MIFARE Classic + Beta + Infrared + Remotes Library + Find remotes for your devices from a wide range of brands and models