Skip to content

An example Android Application that follow up Clean Architecture principles using MVVM pattern with Google architecture components, jetpack compose, dagger HILT, Error Handling, State-FLOW, detekt with kotlin.

Notifications You must be signed in to change notification settings

AlvaroQ/RickAndMorty

Repository files navigation

Rick and Morty Android App 📱

Platform JetpackCompose Hilt Detekt License Bitrise

The purpose of this project is to reflect knowledge in Kotlin of MVVM pattern, coroutines, Flows, dagger hilt injector, Room with SQLite and COMPOSE! using https://rickandmortyapi.com/ public api.

banner

Kotlin - Clean Architecture following SOLID and MVVM 💻

Single Responsibility Principle, Open/Closed Principle, Liskov Substitution Principle, Interface

Segregation Principle and Dependency Inversion Principle

Use cases with a CharacterRepository with Character and Local data sources

Dependency management with Kotlin kts and Kotlin Symbol Processing (KSP)

Dagger Hilt dependency and Error handling with Arrow library.

clean_architecture

Modules 📑

  • ::app - The application module with access to all the application
  • ::data - Android module that can only access domain module
  • ::domain - Kotlin module that cannot access any other module
  • ::usecases - Android module that can only access data and domain modules

Compose 🌀

Jetpack Compose and Compose Navigation

CollapsingLayout, HorizontalPager and two tabs Enter and exit transition with slide horizontally
collapsing_and_horizontal_pager transition
Scale animation on enable favorite button Showing cards sequentially on LazyColumn
expand_fav sequentially_cards

Multi-filter with pagination ⚡

Filtered results with Status (All/Alive/Dead/Unknown), Gender(All/Female/Male/Genderless/Unknown) and naming with scroll-end pagination.

clean_architecture

Local storage 💾

Room store favorite on data base SQLite. I use the Entity 'Character' to save the characters selected as favorites by the user and I manage queries in DAO FavoriteCharacterDao.

Theme ☀️ / 🌛

Dark and light depending system theme


@Composable
fun RickAndMortyTheme(darkTheme: Boolean = isSystemInDarkTheme(),content: @Composable () -> Unit) {
    val colors = if (darkTheme) {
        DarkColorScheme
    } else {
        LightColorScheme
    }
}

Analysis tool 💊

Detekt code analysis tool

Detekt

Libraries 📖

  • Compose Toolkit for building native UI (in a declarative way - 100% Kotlin).
  • Compose Navigation for tabs navigation using Jetpack Compose.
  • Material3 The next evolution of Material Design. Material 3 includes updated theming and components.
  • Coroutines Library support for Kotlin coroutines.
  • Flows Stream processing API, built on top of Coroutines.
  • Dagger Hilt Dependency injection library for Android.
  • Retrofit Type-safe REST client for Android to consume RESTful web services.
  • Coil Compose Image downloading and caching library supported by Jetpack Compose.
  • Lottie Compose Library that provides that parses Adobe After Effects animations exported as json with Bodymovin and renders them natively on mobile.
  • Arrow Functional programming to Kotlin.
  • OkHttp3 Third party library for sending and receive network requests.
  • Room The Room persistence library provides an abstraction layer over SQLite to allow for more robust database access while harnessing the full power of SQLite.
  • Detekt Static code analysis tool for the Kotlin programming language.

License 📄

Copyright 2023 Alvaro Quintana
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.
http://www.apache.org/licenses/

Buy Me A Coffee

About

An example Android Application that follow up Clean Architecture principles using MVVM pattern with Google architecture components, jetpack compose, dagger HILT, Error Handling, State-FLOW, detekt with kotlin.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages