🎬 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
:octocat: A demo project based on MVVM 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

Jaewoong Eum 288 Dec 25, 2022
A movie application where you can search a movie that you want and see the detail of movie

MovieApp This is a simple movie application where you can search a movie that you want and see the detail of movie Technologies Hilt (Dependency Injec

Serhad Mert 5 Nov 30, 2021
PopularMovieApp - A simple project to Chiper challenge taken data from The Movie DB based on Kotlin MVVM clean architecture

A simple project to Chiper challenge taken data from The Movie DB based on Kotli

Jhonatan Alvarez Caicedo 0 Jan 4, 2022
🛡️ Android security (camera/microphone dots indicators) app using Hilt, Animations, Coroutines, Material, StateFlow, Jetpack based on MVVM architecture.

??️ Android security app using Hilt, Animations, Coroutines, Material, StateFlow, Jetpack (Room, ViewModel, Paging, Security, Biometrics, Start-up) based on MVVM architecture.

null 639 Jan 6, 2023
A simple app to showcase Androids Material Design and some of the cool new cool stuff in Android Lollipop. RecyclerView, CardView, ActionBarDrawerToggle, DrawerLayout, Animations, Android Compat Design, Toolbar

#Android-LollipopShowcase This is a simple showcase to show off Android's all new Material Design and some other cool new stuff which is (new) in Andr

Mike Penz 1.8k Nov 10, 2022
A simple Pokedex App getting API with Retrofit, maintaining data using LiveData, and Material Design based on MVVM architecture

PokedexApp Pokedex A simple Pokedex App getting API with Retrofit, maintaining data using LiveData, and Material Design based on MVVM architecture. Te

Steven Adriano 0 Apr 12, 2022
:movie_camera: Movie discovery app showcasing Android best practices with Google's recommended architecture: MVVM + Repository + Offline support + Android Architecture Components + Paging library & Retrofit2.

Popular Movies Stage 1 + Stage 2 Discover the most popular and top rated movies playing. Movies data fetched using themoviedb.org API. ✨ Screenshots M

Yassin AJDI 189 Nov 26, 2022
Movie Info - MovieInfo app that recieves popular movies and allow the user to search for specific movie through the restapi

Movie_Info MovieInfo app that recieves popular movies and allow the user to sear

inderjeet yadav 3 Jun 8, 2022
Movo (Movie Information) is an android application to find out all the Movie Information and Details.

Movo About The Project Screen.Recording.2022-08-12.at.08.53.46_1.mp4 Movo (Movie Information) is an android application to find out all the Movie Info

Reihan Fatilla 4 Sep 28, 2022
Android Demo App for League of legends's Champions based on MVVM design pattern

?? LOL-Champs If this project is useful, please give it a star ⭐ A Android Sample App with champion information of the League of Legends(LOL) using An

JunBi Kim 69 Dec 19, 2022
Tv-Movie - Android application Tv&Movie that uses TMDB API

Tv&Movie This is an android application that shows lists of popular movies, popu

Tatiana Samoilenko 3 Aug 25, 2022
☀️ Wheater is a small demo application based on modern Android tech-stacks and MVVM architecture. ⛅

Wheater is a small demo application based on modern Android tech-stacks and MVVM architecture. Tech stack & Open-source libraries Minimum SDK level 19

null 2 Jan 17, 2022
Movie Android App written in Kotlin, MVVM, RxJava, Coroutine (Upcoming), Android Architecture Components and Jetpack Compose (Upcoming).

MovieHunt MovieHunt is a sample Android project using The Movie DB API based on MVVM architecture. It showcases the latest Android tech stacks with we

Engine Bai 596 Dec 31, 2022
Book Parking is a demo application based on MVVM architecture. The app allows users to booking parking slots, the app uses firebase for the backend.

Book Parking is a demo application based on MVVM architecture. The app allows users to booking parking slots, the app uses firebase for the backend.

Dheeraj Gupta 5 Dec 24, 2022
A simple material design app intro with cool animations and a fluent API.

material-intro A simple material design app intro with cool animations and a fluent API. Very inspired by Google's app intros. Demo: A demo app is ava

Jan Heinrich Reimer 1.7k Jan 7, 2023
MovieApp - Movie App using Clean Architecture with MVVM architectural pattern

MovieApp In this project, MovieDB API has been used to retrive movie data. Upcom

Cansu Aktaş 2 Jun 17, 2022
Movie App with MVVM + Clean Architecture (TMDB Api)

MovieApp Movie App is an application where you can follow movie trends, search for the movie you like and add the ones you like to your favorites. API

Feyza Ürkut 13 Aug 8, 2022