-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AND-9587 Stories: Implemented module skeleton
- Loading branch information
Showing
16 changed files
with
180 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
plugins { | ||
alias(deps.plugins.android.library) | ||
alias(deps.plugins.kotlin.android) | ||
id("kotlin-parcelize") | ||
id("configuration") | ||
} | ||
|
||
android { | ||
namespace = "com.tangem.features.stories.api" | ||
} | ||
|
||
dependencies { | ||
/* Project - Core */ | ||
implementation(projects.core.decompose) | ||
implementation(projects.core.ui) | ||
} |
6 changes: 6 additions & 0 deletions
6
features/stories/api/src/main/java/com/tangem/features/stories/api/StoriesFeatureToggles.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.tangem.features.stories.api | ||
|
||
interface StoriesFeatureToggles { | ||
|
||
val isFeatureEnabled: Boolean | ||
} |
13 changes: 13 additions & 0 deletions
13
...s/stories/api/src/main/java/com/tangem/features/stories/api/component/StoriesComponent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.tangem.features.stories.api.component | ||
|
||
import com.tangem.core.decompose.factory.ComponentFactory | ||
import com.tangem.core.ui.decompose.ComposableContentComponent | ||
|
||
interface StoriesComponent : ComposableContentComponent { | ||
interface Factory : ComponentFactory<Params, StoriesComponent> | ||
|
||
/** | ||
* Params | ||
*/ | ||
data object Params | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
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.stories.impl" | ||
} | ||
|
||
dependencies { | ||
|
||
implementation(deps.compose.ui) | ||
implementation(deps.compose.material3) | ||
|
||
implementation(projects.core.configToggles) | ||
implementation(projects.core.decompose) | ||
implementation(projects.core.ui) | ||
|
||
/** Feature modules */ | ||
implementation(projects.features.stories.api) | ||
|
||
/** DI */ | ||
implementation(deps.hilt.android) | ||
kapt(deps.hilt.kapt) | ||
} |
28 changes: 28 additions & 0 deletions
28
...es/stories/impl/src/main/java/com/tangem/features/stories/impl/DefaultStoriesComponent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.tangem.features.stories.impl | ||
|
||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import com.tangem.core.decompose.context.AppComponentContext | ||
import com.tangem.features.stories.api.component.StoriesComponent | ||
import com.tangem.features.stories.impl.ui.StoriesComponentContent | ||
import dagger.assisted.Assisted | ||
import dagger.assisted.AssistedFactory | ||
import dagger.assisted.AssistedInject | ||
|
||
// todo Temporary remove in AND-9353 | ||
@Suppress("UnusedPrivateMember") | ||
internal class DefaultStoriesComponent @AssistedInject constructor( | ||
@Assisted appComponentContext: AppComponentContext, | ||
@Assisted params: StoriesComponent.Params, | ||
) : StoriesComponent, AppComponentContext by appComponentContext { | ||
|
||
@Composable | ||
override fun Content(modifier: Modifier) { | ||
StoriesComponentContent() | ||
} | ||
|
||
@AssistedFactory | ||
interface Factory : StoriesComponent.Factory { | ||
override fun create(context: AppComponentContext, params: StoriesComponent.Params): DefaultStoriesComponent | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...ories/impl/src/main/java/com/tangem/features/stories/impl/DefaultStoriesFeatureToggles.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.tangem.features.stories.impl | ||
|
||
import com.tangem.core.configtoggle.feature.FeatureTogglesManager | ||
import com.tangem.features.stories.api.StoriesFeatureToggles | ||
|
||
internal class DefaultStoriesFeatureToggles( | ||
private val featureTogglesManager: FeatureTogglesManager, | ||
) : StoriesFeatureToggles { | ||
override val isFeatureEnabled: Boolean | ||
get() = featureTogglesManager.isFeatureEnabled("STORIES_ENABLED") | ||
} |
18 changes: 18 additions & 0 deletions
18
.../stories/impl/src/main/java/com/tangem/features/stories/impl/di/StoriesComponentModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.tangem.features.stories.impl.di | ||
|
||
import com.tangem.features.stories.api.component.StoriesComponent | ||
import com.tangem.features.stories.impl.DefaultStoriesComponent | ||
import dagger.Binds | ||
import dagger.Module | ||
import dagger.hilt.InstallIn | ||
import dagger.hilt.components.SingletonComponent | ||
import javax.inject.Singleton | ||
|
||
@Module | ||
@InstallIn(SingletonComponent::class) | ||
internal interface StoriesComponentModule { | ||
|
||
@Binds | ||
@Singleton | ||
fun bindStoriesComponentFactory(factory: DefaultStoriesComponent.Factory): StoriesComponent.Factory | ||
} |
21 changes: 21 additions & 0 deletions
21
...es/stories/impl/src/main/java/com/tangem/features/stories/impl/di/StoriesFeatureModule.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.tangem.features.stories.impl.di | ||
|
||
import com.tangem.core.configtoggle.feature.FeatureTogglesManager | ||
import com.tangem.features.stories.api.StoriesFeatureToggles | ||
import com.tangem.features.stories.impl.DefaultStoriesFeatureToggles | ||
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 StoriesFeatureModule { | ||
|
||
@Provides | ||
@Singleton | ||
fun provideStoriesFeatureToggles(featureTogglesManager: FeatureTogglesManager): StoriesFeatureToggles { | ||
return DefaultStoriesFeatureToggles(featureTogglesManager) | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...stories/impl/src/main/java/com/tangem/features/stories/impl/ui/StoriesComponentContent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.tangem.features.stories.impl.ui | ||
|
||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
|
||
@Composable | ||
fun StoriesComponentContent() { | ||
Text("Stories!") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters