From 105bad60515b5ea15db993d689b1582126b7fb9e Mon Sep 17 00:00:00 2001 From: Tangem Date: Thu, 25 Jun 2026 19:41:53 +0500 Subject: [PATCH] Updated on 2026-08-14 --- .../configs/feature_toggles_config.json | 4 ++ features/for-you/api/.gitignore | 1 + features/for-you/api/build.gradle.kts | 20 ++++++++++ .../tangem/features/foryou/ForYouComponent.kt | 9 +++++ .../features/foryou/ForYouFeatureToggles.kt | 5 +++ features/for-you/impl/.gitignore | 1 + features/for-you/impl/build.gradle.kts | 30 +++++++++++++++ .../foryou/impl/DefaultForYouComponent.kt | 37 +++++++++++++++++++ .../foryou/impl/di/ForYouFeatureModule.kt | 33 +++++++++++++++++ .../DefaultForYouFeatureToggles.kt | 13 +++++++ settings.gradle.kts | 3 ++ 11 files changed, 156 insertions(+) create mode 100644 features/for-you/api/.gitignore create mode 100644 features/for-you/api/build.gradle.kts create mode 100644 features/for-you/api/src/main/kotlin/com/tangem/features/foryou/ForYouComponent.kt create mode 100644 features/for-you/api/src/main/kotlin/com/tangem/features/foryou/ForYouFeatureToggles.kt create mode 100644 features/for-you/impl/.gitignore create mode 100644 features/for-you/impl/build.gradle.kts create mode 100644 features/for-you/impl/src/main/java/com/tangem/features/foryou/impl/DefaultForYouComponent.kt create mode 100644 features/for-you/impl/src/main/java/com/tangem/features/foryou/impl/di/ForYouFeatureModule.kt create mode 100644 features/for-you/impl/src/main/java/com/tangem/features/foryou/impl/featuretoggles/DefaultForYouFeatureToggles.kt diff --git a/core/config-toggles/src/main/assets/configs/feature_toggles_config.json b/core/config-toggles/src/main/assets/configs/feature_toggles_config.json index a6add9266b..51579fb873 100644 --- a/core/config-toggles/src/main/assets/configs/feature_toggles_config.json +++ b/core/config-toggles/src/main/assets/configs/feature_toggles_config.json @@ -170,5 +170,9 @@ { "name": "AND_14829_WARNINGS_REFACTORING_ENABLED", "version": "undefined" + }, + { + "name": "TWI_1469_FOR_YOU_ENABLED", + "version": "undefined" } ] diff --git a/features/for-you/api/.gitignore b/features/for-you/api/.gitignore new file mode 100644 index 0000000000..42afabfd2a --- /dev/null +++ b/features/for-you/api/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/features/for-you/api/build.gradle.kts b/features/for-you/api/build.gradle.kts new file mode 100644 index 0000000000..95c2a85416 --- /dev/null +++ b/features/for-you/api/build.gradle.kts @@ -0,0 +1,20 @@ +plugins { + alias(deps.plugins.android.library) + alias(deps.plugins.kotlin.android) + alias(deps.plugins.kotlin.serialization) + id("kotlin-parcelize") + id("configuration") +} + +android { + namespace = "com.tangem.features.foryou.api" +} + +dependencies { + /** Project - Core */ + implementation(projects.core.decompose) + implementation(projects.core.ui) + + /** Other dependencies */ + implementation(deps.compose.foundation) +} \ No newline at end of file diff --git a/features/for-you/api/src/main/kotlin/com/tangem/features/foryou/ForYouComponent.kt b/features/for-you/api/src/main/kotlin/com/tangem/features/foryou/ForYouComponent.kt new file mode 100644 index 0000000000..f9860f121a --- /dev/null +++ b/features/for-you/api/src/main/kotlin/com/tangem/features/foryou/ForYouComponent.kt @@ -0,0 +1,9 @@ +package com.tangem.features.foryou + +import com.tangem.core.decompose.factory.ComponentFactory +import com.tangem.core.ui.decompose.ComposableModularBottomSheetContentComponent + +interface ForYouComponent : ComposableModularBottomSheetContentComponent { + + interface Factory : ComponentFactory +} \ No newline at end of file diff --git a/features/for-you/api/src/main/kotlin/com/tangem/features/foryou/ForYouFeatureToggles.kt b/features/for-you/api/src/main/kotlin/com/tangem/features/foryou/ForYouFeatureToggles.kt new file mode 100644 index 0000000000..d70be90e75 --- /dev/null +++ b/features/for-you/api/src/main/kotlin/com/tangem/features/foryou/ForYouFeatureToggles.kt @@ -0,0 +1,5 @@ +package com.tangem.features.foryou + +interface ForYouFeatureToggles { + val isForYouEnabled: Boolean +} \ No newline at end of file diff --git a/features/for-you/impl/.gitignore b/features/for-you/impl/.gitignore new file mode 100644 index 0000000000..42afabfd2a --- /dev/null +++ b/features/for-you/impl/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/features/for-you/impl/build.gradle.kts b/features/for-you/impl/build.gradle.kts new file mode 100644 index 0000000000..86fa456438 --- /dev/null +++ b/features/for-you/impl/build.gradle.kts @@ -0,0 +1,30 @@ +plugins { + alias(deps.plugins.android.library) + alias(deps.plugins.kotlin.android) + alias(deps.plugins.kotlin.kapt) + alias(deps.plugins.hilt.android) + id("configuration") +} + +android { + namespace = "com.tangem.features.foryou.impl" +} + +dependencies { + + /** Features */ + implementation(projects.features.forYou.api) + + /** Core */ + implementation(projects.core.decompose) + implementation(projects.core.ui) + implementation(projects.core.configToggles) + + implementation(deps.compose.ui) + implementation(deps.compose.foundation) + implementation(deps.lifecycle.compose) + + /** DI */ + implementation(deps.hilt.android) + kapt(deps.hilt.kapt) +} \ No newline at end of file diff --git a/features/for-you/impl/src/main/java/com/tangem/features/foryou/impl/DefaultForYouComponent.kt b/features/for-you/impl/src/main/java/com/tangem/features/foryou/impl/DefaultForYouComponent.kt new file mode 100644 index 0000000000..6962ef2efd --- /dev/null +++ b/features/for-you/impl/src/main/java/com/tangem/features/foryou/impl/DefaultForYouComponent.kt @@ -0,0 +1,37 @@ +package com.tangem.features.foryou.impl + +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.runtime.Composable +import androidx.compose.runtime.State +import androidx.compose.ui.Modifier +import com.tangem.core.decompose.context.AppComponentContext +import com.tangem.core.ui.components.bottomsheets.state.BottomSheetState +import com.tangem.features.foryou.ForYouComponent +import dagger.assisted.Assisted +import dagger.assisted.AssistedFactory +import dagger.assisted.AssistedInject + +internal class DefaultForYouComponent @AssistedInject constructor( + @Assisted context: AppComponentContext, + @Suppress("UnusedPrivateMember") @Assisted params: Unit, +) : AppComponentContext by context, ForYouComponent { + + @Composable + override fun Title(bottomSheetState: State) { + TODO("Not yet implemented") + } + + @Composable + override fun Content( + bottomSheetState: State, + contentPadding: PaddingValues, + modifier: Modifier, + ) { + TODO("Not yet implemented") + } + + @AssistedFactory + interface Factory : ForYouComponent.Factory { + override fun create(context: AppComponentContext, params: Unit): DefaultForYouComponent + } +} \ No newline at end of file diff --git a/features/for-you/impl/src/main/java/com/tangem/features/foryou/impl/di/ForYouFeatureModule.kt b/features/for-you/impl/src/main/java/com/tangem/features/foryou/impl/di/ForYouFeatureModule.kt new file mode 100644 index 0000000000..043984089a --- /dev/null +++ b/features/for-you/impl/src/main/java/com/tangem/features/foryou/impl/di/ForYouFeatureModule.kt @@ -0,0 +1,33 @@ +package com.tangem.features.foryou.impl.di + +import com.tangem.core.configtoggle.feature.FeatureTogglesManager +import com.tangem.features.foryou.ForYouComponent +import com.tangem.features.foryou.ForYouFeatureToggles +import com.tangem.features.foryou.impl.DefaultForYouComponent +import com.tangem.features.foryou.impl.featuretoggles.DefaultForYouFeatureToggles +import dagger.Binds +import dagger.Module +import dagger.Provides +import dagger.hilt.InstallIn +import dagger.hilt.components.SingletonComponent +import javax.inject.Singleton + +@Module +@InstallIn(SingletonComponent::class) +internal object ForYouFeatureModule { + + @Provides + @Singleton + fun provideForYouFeatureToggles(featureTogglesManager: FeatureTogglesManager): ForYouFeatureToggles { + return DefaultForYouFeatureToggles(featureTogglesManager = featureTogglesManager) + } +} + +@Module +@InstallIn(SingletonComponent::class) +internal interface ForYouComponentModule { + + @Binds + @Singleton + fun bindForYouComponent(factory: DefaultForYouComponent.Factory): ForYouComponent.Factory +} \ No newline at end of file diff --git a/features/for-you/impl/src/main/java/com/tangem/features/foryou/impl/featuretoggles/DefaultForYouFeatureToggles.kt b/features/for-you/impl/src/main/java/com/tangem/features/foryou/impl/featuretoggles/DefaultForYouFeatureToggles.kt new file mode 100644 index 0000000000..0bdb939702 --- /dev/null +++ b/features/for-you/impl/src/main/java/com/tangem/features/foryou/impl/featuretoggles/DefaultForYouFeatureToggles.kt @@ -0,0 +1,13 @@ +package com.tangem.features.foryou.impl.featuretoggles + +import com.tangem.core.configtoggle.FeatureToggles +import com.tangem.core.configtoggle.feature.FeatureTogglesManager +import com.tangem.features.foryou.ForYouFeatureToggles +import javax.inject.Inject + +internal class DefaultForYouFeatureToggles @Inject constructor( + private val featureTogglesManager: FeatureTogglesManager, +) : ForYouFeatureToggles { + override val isForYouEnabled: Boolean + get() = featureTogglesManager.isFeatureEnabled(FeatureToggles.TWI_1469_FOR_YOU_ENABLED) +} \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index b1fabd1412..19674f11e9 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -354,6 +354,9 @@ include(":features:virtual-accounts:details:impl") include(":features:common-features:api") include(":features:common-features:impl") + +include(":features:for-you:api") +include(":features:for-you:impl") // endregion Feature modules // region Domain modules