Updated on 2026-08-14

This commit is contained in:
Tangem 2025-01-10 13:08:12 +05:00
parent 728f0e3509
commit fabac3cf5b
6 changed files with 44 additions and 10 deletions

View file

@ -26,5 +26,9 @@
{
"name": "NAVIGATION_REFACTORING",
"version": "undefined"
},
{
"name": "SWAP_STORIES_ENABLED",
"version": "undefined"
}
]

View file

@ -1,18 +1,10 @@
plugins {
alias(deps.plugins.android.library)
alias(deps.plugins.kotlin.android)
alias(deps.plugins.kotlin.kapt)
alias(deps.plugins.kotlin.serialization)
alias(deps.plugins.hilt.android)
id("kotlin-parcelize")
id("configuration")
}
android {
namespace = "com.tangem.feature.swap.api"
}
dependencies {
/** DI */
implementation(deps.hilt.android)
kapt(deps.hilt.kapt)
namespace = "com.tangem.features.swap.api"
}

View file

@ -0,0 +1,5 @@
package com.tangem.features.swap
interface SwapFeatureToggles {
val isPromoStoriesEnabled: Boolean
}

View file

@ -44,6 +44,7 @@ dependencies {
implementation(projects.features.swap.domain.api)
implementation(projects.features.swap.domain.models)
implementation(projects.features.wallet.api)
implementation(projects.features.swap.api)
/** AndroidX */
implementation(deps.androidx.activity.compose)

View file

@ -0,0 +1,11 @@
package com.tangem.feature.swap
import com.tangem.core.configtoggle.feature.FeatureTogglesManager
import com.tangem.features.swap.SwapFeatureToggles
internal class DefaultSwapFeatureToggles(
private val featureToggles: FeatureTogglesManager,
) : SwapFeatureToggles {
override val isPromoStoriesEnabled: Boolean
get() = featureToggles.isFeatureEnabled("SWAP_STORIES_ENABLED")
}

View file

@ -0,0 +1,21 @@
package com.tangem.feature.swap.di
import com.tangem.core.configtoggle.feature.FeatureTogglesManager
import com.tangem.feature.swap.DefaultSwapFeatureToggles
import com.tangem.features.swap.SwapFeatureToggles
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 SwapFeatureModule {
@Provides
@Singleton
fun provideSwapFeatureToggles(featureToggles: FeatureTogglesManager): SwapFeatureToggles {
return DefaultSwapFeatureToggles(featureToggles)
}
}