Giter Site home page Giter Site logo

skydoves / goldmovies Goto Github PK

View Code? Open in Web Editor NEW
355.0 15.0 52.0 37.5 MB

👑 The GoldMovies is based on Kotlin, MVVM architecture, coroutines, dagger, koin, and material designs & animations.

License: Apache License 2.0

Kotlin 100.00%
android kotlin coroutines mvvm mvvm-architecture dagger koin themoviedb skydoves

goldmovies's Introduction

GoldMovies

License API Build Status License

👑 The GoldMovies is based on Kotlin, MVVM architecture, coroutines, dagger, koin, and material designs & animations.

Previews

What Open API Used?

The Movies Database (TMDB) is a community built movie and TV database. Every piece of data has been added by our amazing community dating back to 2008. TMDb's strong international focus and breadth of data is largely unmatched and something we're incredibly proud of. Put simply, we live and breathe community and that's precisely what makes us different.

How to build on your environment

Add your The Movie DB's API key in your local.properties file.

tmdb_api_key=YOUR_API_KEY

Module structure

The module structure is designed to try several different architectures.

Entity module

Entity module composed of entity models for persisting in database and response models for fetching data from network requests.

Dependencies

  • Room Persistence - constructing database (An abstraction layer over SQLite).
  • Gson converter - a converter which uses Gson for serialization to and from JSON.
  • Threetenabp - an adaptation of the JSR-310 backport for Android.

Unit Test

Unit Tests to construct database and migration to newer versions using the Room.

Network module

Network module composed of abstractions for RESTful requests. And ApiResponseModel for standardizing a raw request model. An Interceptor for requesting every time with a query parameter api_key.

Dependencies

Unit Test

Unit Tests to verify RESTful requests abstractions via a testing web server and mocked data.

Common-ui module

Common-ui module composed of adapters and viewholders for composing recyclerview's item via databinding. And some factories and extensions related to custom views.

Dependencies

  • Google-Material - material Components for Android (MDC-Android) help developers execute Material Design.
  • Glide - loading image.
  • GlidePalette - compatible with glide, extracting a primary color from an image.
  • BaseRecyclerViewAdapter - fast way to binding RecyclerView adapter and ViewHolder for implementing clean sections.
  • WhatIf - fluent Kotlin expressions for a single if-else statement, nullable and boolean.
  • Flourish - a polished and dynamic way to show up layouts.
  • AndroidRibbon - beautiful and the simplest ribbon view with shimmering effect.
  • ExpandableTextView - allows developers to easily create an TextView which can expand/collapse.

Mvvm module

Mvvm module is the implementation of user interfaces on the application. Based on mvvm architecture (view-databinding-viewmodel-model) with the repository pattern.

  • JetPack
    • LiveData - notify domain layer data to views.
    • Lifecycle - dispose observing data when lifecycle state changes.
    • ViewModel - UI related data holder, lifecycle aware.
    • Room Persistence - construct database.
  • Dagger2 - constructing dependency injection framework based on compile-time.
  • Timber - this is a logger with a small, extensible API.

Unit Test

Unit Tests verify the interactions of viewmodels between repositories and dao & REST api requests.

Mvvm-coroutines module

Mvvm-coroutines module almost same as the Mvvm module. Implementation of user interfaces on the application. Based on mvvm architecture and coroutines.

  • Coroutines - kotlin side(at the language level) supports for asynchronous programming.
  • Koin - A pragmatic lightweight dependency injection, actually service locator.
  • Timber - this is a logger with a small, extensible API.

Unit Test

Unit Tests verify the interactions of viewmodels between repositories and DAO & REST api requests.

Unit Testing Frameworks

  • Robolectric - Robolectric is the industry-standard unit testing framework for Android.
  • Mockito-Kotlin - a small library that provides helper functions to work with Mockito in Kotlin.

User Interface Design

Based on Material design & animations.

  • Google Material Design.
  • Ripple Effect.
  • Shared Element Transition.

Find this repository useful? ❤️

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

Sponsor ☕

If you feel like to sponsor me a coffee for my efforts, I would greatly appreciate it.

Buy Me A Coffee

License

Designed and developed by 2019 skydoves (Jaewoong Eum)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

goldmovies's People

Contributors

skydoves avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

goldmovies's Issues

RecyclerView List Items does not retain their postition on rotation of screen (configuration change)

  • Affected Device(s) [All]

Describe the Bug:

RecyclerView List Items does not retain their postition on rotation of screen (configuration change).

On going potrait --> landscapt --> potrait mode, the list items in recycler view do not retain the position which is clearly a bug and an undesirable behavior.

Expected Behavior:

List Item in reyclerview should retain their position on configuration change. Suppose I scrolled down halfway through the list and on going potrait --> landscapt --> potrait mode, (rotating devide), the list item not scroll back to top.

Since you are using ViewModel, I assumed this would not be the issue.
Your TheMovies repo has the same issue.

java.lang.ClassCastException: com.squareup.moshi.LinkedHashTreeMap cannot be cast to ...

Please complete the following information:

  • Library Version [e.g. v1.0.0]
    Answer︰同github上的,沒有修改過。

  • Affected Device(s) [e.g. Samsung Galaxy s10 with Android 9.0]
    Answer︰HTC U11 with Android 9.0

Describe the Bug:
Add a clear description about the problem.
Answer︰java.lang.ClassCastException: com.squareup.moshi.LinkedHashTreeMap cannot be cast to ...
2020-01-06_185348

Expected Behavior:
A clear description of what you expected to happen.
Answer︰點擊某部電影後,快速地按下返回鍵。然後再馬上點擊該部電影,再快速地按下返回鍵。快速地不斷的重複這個行為。

Close response body

Hi, I was reading the console log and found that whenever there's a bad response the following message shows up:

A connection to https://image.tmdb.org/ was leaked. Did you forget to close a response body?

Any workaround for that? I was digging a little and the solution is to close the body response on finally try catch on the ApiResponse.kt but I cannot get it to work.

Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.