feature/newfeature/
├── build.gradle.kts
└── src/main/java/com/shrivatsav/monomail/feature/newfeature/
└── NewFeatureScreen.kt build.gradle.kts template:
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.compose)
alias(libs.plugins.ksp)
alias(libs.plugins.hilt)
}
android {
namespace = "com.shrivatsav.monomail.feature.newfeature"
compileSdk = 37
defaultConfig {
minSdk = 26
consumerProguardFiles("consumer-rules.pro")
}
flavorDimensions += "distribution"
productFlavors {
create("github") { dimension = "distribution" }
create("playstore") { dimension = "distribution" }
}
buildFeatures { compose = true }
}
dependencies {
implementation(project(":core:model"))
implementation(project(":core:designsystem"))
implementation(project(":core:data"))
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.ui)
implementation(libs.androidx.compose.material3)
implementation(libs.androidx.lifecycle.viewmodel.compose)
implementation(libs.hilt.android)
ksp(libs.hilt.compiler)
} include(":feature:newfeature") // app/build.gradle.kts
dependencies {
implementation(project(":feature:newfeature"))
} Follow the standard screen pattern: sealed class state in ViewModel, @HiltViewModel with @Inject constructor, Composable function with viewModel parameter and nav callbacks.
sealed class Screen(val route: String) {
object NewFeature : Screen("new_feature")
}
// In NavGraph composable block:
composable(Screen.NewFeature.route) {
NewFeatureScreen(
onBack = { navController.popBackStack() }
)
} If the new feature needs new singleton providers, add them to the appropriate DI module in :app/di/ or create a new one.
If the feature differs between github and playstore:
main/.github/ and playstore/ source sets.@Binds in a DI module to bind the interface.Add a SettingsCard in SettingsScreen.kt that navigates to the new route.