A movie & TV show exploration app that implements MVVM design pattern by following the clean architecture principles, using TMDB API.

Overview

🎬 Movie App πŸ“Ί

Platform API Kotlin License

A movie & TV show exploration app that implements MVVM design pattern by following the clean architecture principles, using TMDB API.

✨ Features

πŸ”Έ Project Features

  • Written in Kotlin
  • Implementing MVVM design pattern with Android Architecture Components
  • Following clean architecture principles*
  • Dependency injection with Hilt
  • Consuming a REST API
  • Safe API call with Retrofit & Coroutines with the help of Sealed Class
  • Caching API response with OkHttpClient
  • Observing data changes and updating the UI state with StateFlow
  • Lifecycle-aware RecyclerView & ViewPager2 adapters with util classes that implements DefaultLifecycleObserver
  • Easing the binding process and handling common operations with base classes (BaseActivity, BaseFragment, and BaseViewModel)
  • Handling common view logic with BindingAdapter
  • Infinite scrolling with the help of RecyclerView.OnScrollListener (no paging library used)
  • ViewPager2 auto sliding functionality with the help of Handler & Runnable
  • Detecting and fixing leaks with LeakCanary

πŸ”Ή App Features

  • Browse movies-TV shows through various categories on the Home screen
  • Search movies-TV shows-people on the Search screen
  • See the details of a movie-TV show-person
    • Adjusted background color according to the dominant color of the poster
    • Watch trailers directly in the app
    • View more details by expanding the Details section
    • Navigate to IMDb, Facebook, Instagram, or Twitter page in the browser or own app if installed
    • Mark the movie-TV show as favorite by tapping the heart icon
  • View favorite movies-TV shows on the Favorites screen
  • Offline support (if cached data is available)

β–Ά Demos

Home_Movie-Person.Detail.Screen.mp4
Home_TV.Show-Season-Episode.Detail.Screen.mp4
Search.Screen.mp4
Favorites.Screen.mp4

πŸ”‘ Prerequisite

To build the project successfully, you need to get your TMDB API key and add a new line in the local.properties file as shown below.

tmdb_api_key=Your_TMDB_API_Key

Do the same with YouTube Data API key.

youtube_api_key=Your_YouTube_Data_API_Key

πŸ›  Project Structure

project_structure

The project separated into three main layers:

  • Data
  • Presentation
  • Domain

πŸ”Έ Data

Data layer contains application data that are fetched from either the network source or the local database.

Consists of four packages:

  • local contains Room components to fetch data from the local database
  • mapper contains mapping functions to map DTOs(Data Transfer Objects) and database entities to domain models
  • remote contains Retrofit components to fetch data from the network source
  • repository contains implementations of repository interfaces that are defined in the domain layer

πŸ”Έ Presentation

Presentation layer is responsible for displaying application data on the screen. It contains UI elements that render the data on the screen and ViewModel classes that store and manage data in a lifecycle-conscious way.

Consists of two packages:

  • adapter contains RecyclerView & ViewPager2 adapter classes
  • ui contains Activities & Fragments with their corresponding ViewModel classes

πŸ”Έ Domain

Domain layer is the central layer of the project. This layer is a bridge between the data layer and the presentation layer-it retrieves data from the data layer and exposes it to the presentation layer. This layer is independent of other layers-any changes in other layers don't affect this layer.

Consists of three packages:

  • model contains data classes that hold the data retrieved from the data layer to be used later on in the presentation layer to expose it to UI
  • repository contains repository interfaces to abstract the domain layer from the data layer
  • usecase contains use cases(interactors) that handle the business logic, which are reused by multiple ViewModels

πŸ“Œ Note

This is a learning project. I'm not claiming that this project implements clean architecture immaculately, I'm still in the learning phase. I will update the project as I learn more about clean architecture and realize my mistakes. I'm also open to any kind of advice to make the project's code quality better.

πŸ“š Libraries

  • Jetpack libraries
    • Navigation - Handling navigation between destinations within the app
    • Lifecycle - Handling lifecycles with lifecycle-aware component
    • DataBinding - Binding UI components in layouts to data sources using a declarative format
    • ViewModel - Storing and managing UI-related data in a lifecycle-conscious way
    • Hilt - Injecting dependencies
    • Room - Constructing SQLite database more easily
    • DataStore - Persisting the key-value pairs or typed objects with protocol buffers
    • Palette - Extracting prominent colors from images
  • Kotlin Coroutines - Allowing asynchronous programming with Kotlin
  • Retrofit - Interacting with the REST API
  • OkHttp - Implementing interceptors
  • Gson - Converting JSON to Kotlin data class
  • Glide - Loading and caching images
  • Glide Transformations - Providing image transformations for Glide
  • PhotoView - Implementing zoom functionality to ImageView
  • ExpandableLayout - Animating the expansion and collapse of its child views
  • YouTube Android Player - Playing YouTube video in app
  • LeakCanary - Detecting leaks within the app

πŸ“± Try the App

Check out the Releases and download & install the APK file to try the app.

πŸ“œ License

Copyright (c) 2022 Bora Bor

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
You might also like...
FirestoreCleanArchitectureApp is an app built with Kotlin and Firestore that displays data in real-time using the MVVM Architecture Pattern. For the UI it uses Jetpack Compose,  Android's modern toolkit for building native UI.
FirestoreCleanArchitectureApp is an app built with Kotlin and Firestore that displays data in real-time using the MVVM Architecture Pattern. For the UI it uses Jetpack Compose, Android's modern toolkit for building native UI.

FirestoreCleanArchitectureApp FirestoreCleanArchitectureApp is an app built with Kotlin and Cloud Firestore that displays data in real-time using Andr

A simple demo project based on MVVM clean architecture and material design & animations.
A simple demo project based on MVVM clean architecture and material design & animations.

GithubFollows A simple demo project based on MVVM clean architecture and material design & animations. Architecture Specs & Open-source libraries Mini

πŸ“š  Sample Android Components Architecture on a modular word focused on the scalability, testability and maintainability written in Kotlin, following best practices using Jetpack.
πŸ“š Sample Android Components Architecture on a modular word focused on the scalability, testability and maintainability written in Kotlin, following best practices using Jetpack.

Android Components Architecture in a Modular Word Android Components Architecture in a Modular Word is a sample project that presents modern, 2020 app

An Android app consuming Pixabay API to search and display list of images, built with MVVM pattern
An Android app consuming Pixabay API to search and display list of images, built with MVVM pattern

Images An Android app consuming Pixabay API to search and display list of images, built with MVVM pattern as well as Architecture Components. Min Api

Kotlin extension function provides a facility to "add" methods to class without inheriting a class or using any type of design pattern

What is Kotlin Extension Function ? Kotlin extension function provides a facility to "add" methods to class without inheriting a class or using any ty

Demonstration of Object Pool Design Pattern using Kotlin language and Coroutine
Demonstration of Object Pool Design Pattern using Kotlin language and Coroutine

Object Pool Design Pattern with Kotlin Demonstration of Thread Safe Object Pool Design Pattern using Kotlin language and Coroutine. Abstract The objec

Accounting-App - An Android app built with Kotlin, Material, Jetpack Compose, Hilt, Room, Coroutines, Data-Store, MVVM-Clean Architecture and JUnit tests Simple Note App With MVVM Clean Architecture
Simple Note App With MVVM Clean Architecture

NoteWakeup Simple Note App With MVVM Clean Architecture ✍🏽 Simple Note App. Here i demonstrate the use of Modern Android development tools - (Kotlin,

AbstractFactoryDesignPatternWithKotlin - Abstract Factory Design Pattern With Kotlin
AbstractFactoryDesignPatternWithKotlin - Abstract Factory Design Pattern With Kotlin

AbstractFactoryDesignPatternWithKotlin Abstract Factory Design Pattern With Kotl

Owner
Bora Bor
B.S. degree in Electrical & Electronics Engineering. Currently working on Android development with Kotlin.
Bora Bor
This Kotlin Multiplatform library is for accessing the TMDB API to get movie and TV show content. Using for Android, iOS, and JS projects.

Website | Forum | Documentation | TMDb 3 API Get movie and TV show content from TMDb in a fast and simple way. TMDb API This library gives access to T

Moviebase 37 Dec 29, 2022
An Android app built with Kotlin, consuming StarWars API to display characters of the popular StarWars Movie. It is built with the MVVM pattern and the latest Jetpack components.

StarWars An Android app built with Kotlin, consuming StarWars API to display characters of the popular StarWars Movie. It is built with the MVVM patte

Joel Kanyi 42 Nov 20, 2022
Kotlin backend based on the Clean Architecture principles. Ktor, JWT, Exposed, Flyway, KGraphQL/GraphQL generated endpoints, Gradle.

Kotlin Clean Architecture Backend Kotlin backend based on the Clean Architecture principles. The application is separated into three modules: Domain,

null 255 Jan 3, 2023
Movie Android App written in Kotlin, MVVM, Clean Architechture, Modularized, Coroutines, Android Architecture Components and Hilt

Movie Android App written in Kotlin, MVVM, Clean Architechture, Modularized, Coroutines, Android Architecture Components and Hilt.

Klejvi Kapaj 16 Dec 27, 2022
KotlinForDS - An exploration of data science using Kotlin

Kotlin Jupyter Notebook An example notebook can be found here: https://mybinder.

Krulvis 0 Jan 20, 2022
A complete Kotlin application built to demonstrate the use of Modern development tools with best practices implementation using multi-module architecture developed using SOLID principles

This repository serves as template and demo for building android applications for scale. It is suited for large teams where individuals can work independently on feature wise and layer wise reducing the dependency on each other.

Devrath 11 Oct 21, 2022
TheMovies 🎬 A demo project for The Movie DB based on Kotlin MVVM architecture and material design & animations.

A simple project for The Movie DB based on Kotlin MVVM clean architecture and material design & animations. How to build on your environment

Jaewoong Eum 420 Nov 29, 2022
This is an example of a simple application with layered software base on clean-architecture as application architecture and mvvm as presentation architecture

This is an example of a simple application with layered software base on clean-architecture as application architecture and mvvm as presentation archi

null 3 Jul 2, 2021
Futurama Quotes demonstrates modern Android development implements MVVM architecture

This application allows you to see futurama quotes. You can search quotes according to the character that said it as well. Futurama Quotes demonstrates modern Android development implements MVVM architecture.

Soumik 2 Apr 28, 2022
Learning Project (Story App) For Applying Android Architecture Components And Clean Architecture Using MVVM With Kotlin

Learning Project (Story App) For Applying Android Architecture Components And Clean Architecture Using MVVM With Kotlin. Implemented by Clean Architecture, Hilt, MVVM, LiveData, Coroutines, Retrofit2, Glide

Samad Talukder 4 Sep 27, 2022