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
abstract class MovieSearchEntry : FeatureEntry { | |
final override val featureRoute = "movie-search" | |
} |
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
interface CommonProvider { | |
val appContext: Context | |
} |
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
@Singleton | |
@Component | |
interface AppComponent { | |
val appContext: Context | |
@Component.Factory | |
interface Factory { | |
fun create(@BindsInstance appContext: Context): AppComponent | |
} |
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
@Module | |
interface MovieSearchEntryModule { | |
@Binds | |
@Singleton | |
@IntoMap | |
@FeatureEntryKey(MovieSearchEntry::class) | |
fun movieSearchEntry(impl: MovieSearchEntryImpl): FeatureEntry | |
} |
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
@Composable | |
inline fun <reified VM : ViewModel> injectedViewModel( | |
key: String? = null, | |
crossinline viewModelInstanceCreator: () -> VM | |
): VM { | |
val factory = remember(key) { | |
object : ViewModelProvider.Factory { | |
override fun <VM : ViewModel> create(modelClass: Class<VM>): VM { | |
@Suppress("UNCHECKED_CAST") | |
return viewModelInstanceCreator() as VM |
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
interface DataProvider { | |
val moviesRepository: MoviesRepository | |
} |
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
import androidx.navigation.compose.composable | |
import androidx.navigation.navigation | |
class MovieDetailsEntryImpl @Inject constructor() : MovieDetailsEntry() { | |
override fun NavGraphBuilder.navigation( | |
navController: NavHostController, | |
destinations: Destinations | |
) { | |
navigation(startDestination = destination(), route = "@ignored") { |