Movie Search App
This is my first android practice project, using Flow, Suspend Function, AAC ViewModel, Dagger Hilt and so on.
Project Structure
root/
┣ app
┃ ┣ App.kt
┃ ┣ MainActivity.kt
┃ ┣ nav_graph.xml
┃ ┗ HiltInjectionModules
┣ UiComponent
┃ ┣ MovieDetailFragment.kt
┃ ┣ fragment_movie_detail.xml
┃ ┣ MovieSearchFragment.kt
┃ ┗ fragment_movie_search.xml
┣ ViewModel
┃ ┣ AnyViewModel.kt
┃ ┣ MovieDetailViewModel.kt
┃ ┗ MovieSearchViewModel.kt
┣ Router
┃ ┣ MovieDetailRouter.kt (interface)
┃ ┗ MovieSearchRouter.kt (interface)
┣ UiLogic
┃ ┣ main
┃ ┃ ┣ MovieDetailUiLogicImpl.kt
┃ ┃ ┣ MovieDetailUiLogicFactoryImpl.kt
┃ ┃ ┣ MovieSearchUiLogicImpl.kt
┃ ┃ ┗ MovieSearchUiLogicFactoryImpl.kt
┃ ┗ test
┃ ┣ MovieDetailUiLogicImplTest.kt
┃ ┗ MovieSearchUiLogicImplTest.kt
┣ UiLogicInterface
┃ ┣ UiLogic.kt (interface)
┃ ┣ UiLogicFactory.kt (interface)
┃ ┣ MovieDetailUiLogic.kt (interface)
┃ ┗ MovieSearchUiLogic.kt (interface)
┣ Repository
┃ ┣ main
┃ ┃ ┗ MovieRepositoryImpl.kt
┃ ┗ test
┃ ┗ MovieRepositoryImplTest.kt
┣ RepositoryInterface
┃ ┗ MovieRepository.kt (interface)
┣ RemoteDataSource
┃ ┗ TheMovieDatabaseService.kt
┗ RemoteDataSourceInterface
┗ TheMovieDatabaseService.kt (interface)
Module Dependency Graph
View Composition and UI Layer Data Structure
UI Layer Data Structure corresponds to View Composition, therefore be able to test view patterns via unit testing. (e.g. MovieDetailUiLogicImplTest.kt)
Thrid Party Libraries
Requirements
- Android Studio Arctic Fox 2020.3.1 Patch 1
- Java 8
- Kotlin 1.5.30
Usage
To run this application, The Movie Database API Key
and Access Token
are needed. Set those required strings to app/gradle.properties
like below.
TMDB_API_KEY=xxxx
TMDB_ACCESS_TOKEN=xxxx