Updated on 2026-08-14
This commit is contained in:
parent
ec06f2e51c
commit
105bad6051
11 changed files with 156 additions and 0 deletions
1
features/for-you/impl/.gitignore
vendored
Normal file
1
features/for-you/impl/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
/build
|
||||
30
features/for-you/impl/build.gradle.kts
Normal file
30
features/for-you/impl/build.gradle.kts
Normal file
|
|
@ -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)
|
||||
}
|
||||
|
|
@ -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<BottomSheetState>) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
@Composable
|
||||
override fun Content(
|
||||
bottomSheetState: State<BottomSheetState>,
|
||||
contentPadding: PaddingValues,
|
||||
modifier: Modifier,
|
||||
) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
@AssistedFactory
|
||||
interface Factory : ForYouComponent.Factory {
|
||||
override fun create(context: AppComponentContext, params: Unit): DefaultForYouComponent
|
||||
}
|
||||
}
|
||||
|
|
@ -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
|
||||
}
|
||||
|
|
@ -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)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue