🎬 A demo project for The Movie DB based on Kotlin MVVM architecture and material design & animations.

Overview

TheMovies

license API Build Status License

A simple project for The Movie DB based on Kotlin MVVM clean architecture and material design & animations.

gif0 gif1

How to build on your environment

Add your API key in local.properties file.

tmdb_api_key=YOUR_API_KEY

Development process

Based on Test-driven development.

  1. API Service -> API Service Unit Test with api response mock files
  2. DAO -> DAO Unit Test
  3. Repository -> Repository Unit Test
  4. ViewModel -> ViewModel Unit Test
  5. DI & Refactoring
  6. Implmentating UI & Layouts

    tdd

Architecture

Based on mvvm architecture and repository pattern.

architecture

Specs & Open-source libraries

  • Minimum SDK 16
  • 100% Kotlin based
  • MVVM Architecture
  • Architecture Components (Lifecycle, LiveData, ViewModel, Room Persistence)
  • DataBinding
  • Material Design & Animations
  • The Movie DB API
  • Dagger2 for dependency injection
  • Retrofit2 & Gson for constructing the REST API
  • OkHttp3 for implementing interceptor, logging and mocking web server
  • Glide for loading images
  • BaseRecyclerViewAdapter for implementing adapters and viewHolders
  • WhatIf - checking nullable object and empty collections more fluently
  • Mockito-kotlin for Junit mock test
  • Timber for logging
  • Stetho for debugging persistence data & network packets
  • Ripple animation, Shared element transition
  • Custom Views ExpandableTextView

Posting

Medium - Android MVVM Architecture Components using The Movie Database API

Find this library useful? ❤️

Support it by joining stargazers for this repository.
And follow me for my next creations! 🤩

Supports

If you feel like support me a coffee for my efforts, I would greatly appreciate it.
Buy Me A Coffee

License

The MIT License (MIT)

Copyright (c) 2018 skydoves

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.
Comments
  • Unable to load images on Android P

    Unable to load images on Android P

    Images are not displayed in the app.

    Log:

    2018-12-25 20:27:20.913 29401-29401/com.skydoves.themovies W/Glide: Load failed for http://image.tmdb.org/t/p/w342/gwPSoYUHAKmdyVywgLpKKA4BjRr.jpg with size [720x840]
        class com.bumptech.glide.load.engine.GlideException: Failed to load resource
        There were 2 causes:
        java.io.IOException(Cleartext HTTP traffic to image.tmdb.org not permitted)
        java.io.FileNotFoundException(No content provider: http://image.tmdb.org/t/p/w342/gwPSoYUHAKmdyVywgLpKKA4BjRr.jpg)
         call GlideException#logRootCauses(String) for more detail
          Cause (1 of 2): class com.bumptech.glide.load.engine.GlideException: Fetching data failed, class java.io.InputStream, REMOTE
        There was 1 cause:
        java.io.IOException(Cleartext HTTP traffic to image.tmdb.org not permitted)
         call GlideException#logRootCauses(String) for more detail
            Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Fetch failed
        There was 1 cause:
        java.io.IOException(Cleartext HTTP traffic to image.tmdb.org not permitted)
         call GlideException#logRootCauses(String) for more detail
              Cause (1 of 1): class java.io.IOException: Cleartext HTTP traffic to image.tmdb.org not permitted
          Cause (2 of 2): class com.bumptech.glide.load.engine.GlideException: Fetching data failed, class android.content.res.AssetFileDescriptor, LOCAL
        There was 1 cause:
        java.io.FileNotFoundException(No content provider: http://image.tmdb.org/t/p/w342/gwPSoYUHAKmdyVywgLpKKA4BjRr.jpg)
         call GlideException#logRootCauses(String) for more detail
            Cause (1 of 1): class java.io.FileNotFoundException: No content provider: http://image.tmdb.org/t/p/w342/gwPSoYUHAKmdyVywgLpKKA4BjRr.jpg
    
    opened by paolorotolo 2
  • Remove Aanko with Splitties as Anko is deprecated now.

    Remove Aanko with Splitties as Anko is deprecated now.

    Removed Anko with Splitties as Anko is deprecated now. Developers of Anko also suggesting Splitties instead of Anko.

    https://github.com/Kotlin/anko/blob/master/GOODBYE.md

    opened by Pravin-Divraniya 1
  • Avoid Cleartext HTTP traffic not permitted on Android P

    Avoid Cleartext HTTP traffic not permitted on Android P

    This PR fixes the "Cleartext HTTP traffic not permitted" on Android P: https://developer.android.com/training/articles/security-config#CleartextTrafficPermitted

    Actually 2 fixes are available:

    • continue using HTTP APIs and allowing cleartext traffic in Andorid Manifest with:
    android:usesCleartextTraffic="true"
    
    • Switch to HTTPS APIs.
        private const val BASE_POSTER_PATH = "https://image.tmdb.org/t/p/w342"
        private const val BASE_BACKDROP_PATH = "https://image.tmdb.org/t/p/w780"
        private const val YOUTUBE_VIDEO_URL = "https://www.youtube.com/watch?v="
        private const val YOUTUBE_THUMBNAIL_URL = "https://img.youtube.com/vi/"
    

    This PR implements the second option.

    Please review and merge.

    opened by paolorotolo 1
  • fix: non null constraint on tv poster path

    fix: non null constraint on tv poster path

    Guidelines

    This fixes a non null constraint crash for tv poster path.

    Types of changes

    What types of changes does your code introduce?

    • [ ] Bugfix (non-breaking change which fixes an issue)

    Preparing a pull request for review

    Ensure your change is properly formatted by running:

    $ ./gradlew spotlessApply
    

    Please correct any failures before requesting a review.

    opened by egbuna 0
  • Upgrade gradle plugins and some artifacts.

    Upgrade gradle plugins and some artifacts.

    update the Android Gradle plugin from the current version 3.5.3 to version 3.6.1 and Gradle to version 5.6.4

    Update below artifacts: materialVersion -> 1.2.0-alpha05 androidFragment -> 1.2.2 roomVersion -> 2.2.4

    Resolve below warning. Warning:- Incremental annotation processing requested, but support is disabled because the following processors are not incremental: androidx.room.RoomProcessor

    Solution:-

    Enable Kapt Incremental annotation processing requeste

    kapt.incremental.apt=true

    Enable android.databinding.annotationprocessor.ProcessDataBinding (DYNAMIC)

    android.databinding.incremental=true

    Decrease gradle builds time

    kapt.use.worker.api=true

    opened by Pravin-Divraniya 0
  • UI enhancemnt in Movie and TV list screen. Also resolve one crash.

    UI enhancemnt in Movie and TV list screen. Also resolve one crash.

    1. Change ImageView scaleType to centerCrop in item_poster.xml and item_person.xml, so its look proper on tablet and big screen phone devices.

    2. For some Star's place_of_birth coming null so it was crashing the app. So make changes in PersonDetail.kt and make place_of_birth field nullable.

    opened by Pravin-Divraniya 0
  • Discover movies by other parameter

    Discover movies by other parameter

    Hello, i'm still new to android development, and I use this project as my way of learning it.

    Currently, discover movie/tv request only uses page as a single parameter, can you tell me how to add other parameters, for example discover by genres/company/keyword?

    opened by firsttimeeagle 1
  • Task 'offline' not found in root project 'TheMovies'.

    Task 'offline' not found in root project 'TheMovies'.

    Please complete the following information:

    • Feature (Login Screen)
    • Affected Device(s) [e.g. Samsung Galaxy s10 with Android 9.0]

    Describe the Bug:

    Add a clear description about the problem.

    Expected Behavior:

    A clear description of what you expected to happen.

    opened by abhilasha1-agatsa 0
Releases(1.0.1)
Owner
Jaewoong Eum
Android software engineer. Digital Nomad. Open Source Contributor. ❤️ Love coffee, music, magic tricks and writing poems. Coffee Driven Development.
Jaewoong Eum
Movie app that receives popular movies and allows the user to search for the specific movie through the Rest API with help of retrofit library &MVVM architecture.

MovieClue Millions of movies, TV shows and people to discover. Explore now Movie app that recieves popular movies and allow the user to search for spe

Shubham Tomar 6 Mar 31, 2022
Skeleton project for show the architecture of Android project using MVVM, Clean Architecture and Kotlin coroutine Flow

ClearScoreDemo Skeleton project for showing the architecture of Android project using MVVM, Clean architecture and Kotlin coroutine Flow App Architect

Plabon Modak 1 Mar 6, 2022
FaceTimeClone app that implements Coroutines , mvvm architecture , clean architecture , navigation component , hilt , etc.... using kotlin language

This repository contains a FaceTimeClone app that implements Coroutines , mvvm architecture , clean architecture , navigation component , hilt , etc.... using kotlin language

null 17 Dec 13, 2022
Delish, a Food Recipes App in Jetpack Compose and Hilt based on modern Android tech-stacks and MVVM clean architecture.

Delish Screens Tech stack & Open-source libraries 100% Kotlin based + Coroutines + Flow for asynchronous. Dagger Hilt 2.37 Accompanist JetPack Jetpack

Mohamed Elbehiry 305 Dec 12, 2022
Educational App made with Retrofit, Coroutines, Navigation Component, Room, Dagger Hilt, Flow & Material Motion Animations.

TechHub TechHub is a sample educational app that provides courses for people who want to learn new skills in mostly tech-related areas. The goal of th

Jon Areas 32 Dec 20, 2022
Pokemon App is a sample Pokemon application based on MVVM architecture.

Pokemon App Pokemon App is an Application based on Modern Android tech-stacks and MVVM Architecture. Techs Used ?? 100% Kotlin based Coroutines + Flow

Rohit Sharma 2 Oct 25, 2022
🪐 Modern Android development with Hilt, Coroutines, Flow, JetPack(ViewModel) based on MVVM architecture.

Ceres ?? Modern Android development with Hilt, Coroutines, Flow, JetPack(ViewModel) based on MVVM architecture. Download Gradle Add the dependency bel

Teodor G. 21 Jan 11, 2023
Android project setup files when developing apps from scratch. The codebase uses lates jetpack libraries and MVVM repository architecture for setting up high performance apps

Android architecture app Includes the following Android Respository architecture MVVM Jepack libraries Carousel view Kotlin Kotlin Flow and Livedata P

null 2 Mar 31, 2022
Filmesflix - Project made during the NTT DATA Android Developer bootcamp. Developing knowledge in MVVM and Clear Architecture

FilmesFlix Projeto criado para o módulo de MVVM e Clean Architecture no Bootcamp

Italo Bruno 0 Feb 12, 2022
Multi module architecture Android template project using MVVM, Dagger-Hilt, and Navigation Components

ModularAppTemplate An Android template project following a multi module approach with clean architecture. It has been built following Clean Architectu

Mbuodile Obiosio 7 May 23, 2022
Example Multi module architecture Android project using MVVM, Dynamic Features, Dagger-Hilt, Coroutines and Navigation Components

ModularDynamicFeatureHilt An Android template project following a multi module approach with clean architecture. It has been built following Clean Arc

Mbuodile Obiosio 25 Nov 23, 2022
A personal project made using Jetpack Compose, Clean-MVVM architecture and other jetpack libraries

A basic CRUD for recording your personal credit and debit transactions. Made using Jetpack Compose, Clean-MVVM and other Jetpack libraries, incorporated with Unit Tests.

Shoaib Ahmed 3 Dec 6, 2022
Cleanarchitecture MVVM Hilt base - Android Clean Architecture example project

Android Clean Architecture example project Note: This is project based on MVVM c

Mohsin Javed 4 Aug 30, 2022
This Project for how to use MVVM , state flow, Retrofit, dagger hit, coroutine , use cases with Clean architecture.

Clean-architecture This Project for how to use MVVM , state flow, Retrofit, dagger hit, coroutine , use cases with Clean architecture. Why i should us

Kareem Aboelatta 10 Dec 13, 2022
CryptoMovies is a small app that show modern Android developement: with Hilt, Coroutines, Flow, Jetpack and Material Design 3

CryptoMovies is a small app that show modern Android developement: with Hilt, Coroutines, Flow, Jetpack and Material Design 3.

Leonardo Pirro 7 Sep 2, 2022
Bego Chat is chat application in Kotlin and Firebase with the following features: last seen , user status like typing ,online and last seen with MVVM pattern and clean architecture

Compose ChatApp(Bego Chat) Bego Chat is Compose chat application in Kotlin and Firebase with the following features: sending all file types and abilit

Ahmed EL Bagory 5 Dec 20, 2022
A movie and TV Show streaming mobile app built with Jetpack Compose.

PhotoPlay A movie and TV Show streaming mobile app in Android built using Jetpack compose. This project is developed by Javokhir Savriev for more proj

Javokhir 4 Nov 9, 2022
LifecycleMvp 1.2 0.0 Kotlin is MVP architecture implementation with Android Architecture Components and Kotlin language features

MinSDK 14+ Download Gradle Add to project level build.gradle allprojects { repositories { ... maven { url 'https://jitpack.io' }

Robert 20 Nov 9, 2021