TheMovies 🎬 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 and open source software engineer.❤️ Digital Nomad. Love coffee, music, magic tricks, and writing poems. Coffee Driven Development
Jaewoong Eum
A movie & TV show exploration app that implements MVVM design pattern by following the clean architecture principles, using TMDB API.

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

Bora Bor 11 Dec 22, 2022
🗡️ Deddit demonstrates modern Android development with Hilt, Coroutines, Flow, Jetpack, and Material Design based on MVVM architecture

Deddit demonstrates modern Android development with Hilt, Coroutines, Flow, Jetpack (ViewModel,Paging3), and Material Design based on MVVM

Krish Parekh 9 Sep 2, 2022
Michal Kubele 0 Jan 6, 2022
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
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
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
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
A demo project which demonstrates the work of javax.servlet.Filter capable of escaping / modifying / removing a part of JSON request based on specified criteria.

Replace Filter Demo A demo project which demonstrates the work of javax.servlet.Filter capable of escaping / modifying / removing a part of JSON reque

Vlad Krava 1 Jan 17, 2022
Shreyas Patil 2.2k Jan 4, 2023
ToDo App based on Modern Android Application tech-stacks and MVVM architecture.

ToDo App Task Management App based on Modern Android Application tech-stacks and MVVM architecture. Techs Used ?? Kotlin - First class and official pr

Rohit Sharma 12 Jul 22, 2022
🛒 Mercado Libre App Clone using modern Android development with Hilt, Coroutines, Jetpack (Room, ViewModel), and Jetpack Compose based on MVVM architecture.

Meli Clone ?? Mercado Libre App Clone using modern Android development with Hilt, Coroutines, Jetpack (Room, ViewModel), and Jetpack Compose based on

Esteban Aragon 7 Sep 22, 2022
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
❤️ A sample Marvel heroes application based on MVVM (ViewModel, Coroutines, LiveData, Room, Repository, Koin) architecture.

MarvelHeroes MarvelHeroes is a demo application based on modern Android application tech-stacks and MVVM architecture. Fetching data from the network

Jaewoong Eum 1.2k Dec 19, 2022
🦁 A Disney app using transformation motions based on MVVM (ViewModel, Coroutines, Flow, LiveData, Room, Repository, Koin) architecture.

DisneyMotions A demo Disney app using transformation motions based on MVVM architecture. The motion system is included in the 1.2.0-alpha05 released m

Jaewoong Eum 1.4k Jan 2, 2023
Kafka-hot-and-cold-retries - Demo project for elaborating how hot and cold retries can be applied in Kafka

Apache Kafka® - Hot and Cold Retries A demo project for elaborating how hot and

Berat CANKAR 11 Jun 10, 2022
My own approach to what I think an Android MVVM project with Clean Architecture should look like with Dagger-Hilt as Dependency Injector engine

MVVM Project Hilt Introducción Este proyecto es mi visión particular, ni mejor ni peor (sólo una más) que cualquier otra aproximación a lo que yo enti

Antonio Fdez. Alabarce 7 Dec 16, 2022
Quiz Zone is a simple ✅ Quiz Android application 📱 using Firbase Firestore Database and Material Design.

Quiz Zone Quiz Zone is a simple ✅ Quiz Android application ?? using Firbase Firestore Database and Material Design. You can Install and test Quiz Zone

MOHIT GUPTA 6 Dec 24, 2022
A Movie listing app with unit tests and a couple of UI tests

MovieListings App This app is a Movie listing app with unit tests and a couple of UI tests. The app gets a list of movies from a public API, and the d

Abayomi Akanji 1 Dec 1, 2021