Giter VIP home page Giter VIP logo

coroutines-flows-modularised's Introduction

Platform

Build Status

banner

SpaceX ๐Ÿš€

The purpose of this project is to follow up Clean Architecture principles by bringing them to Android. It is worth saying that the idea is to take advantage of the Kotlin Programming Language features plus also pull in lessons learned and ideas from other interesting aproaches like Functional Programming, MVVM setup, Coroutines, Flow and LiveData (I've kept a branch using RxJava). DarkTheme support is added too.

structure

Modules ๐Ÿฌ

  • app - The application module with access to all the application
  • data - Android module that can only access domain module
  • data-api - Android module that can only access data module
  • domain - Kotlin module that cannot access any other module
  • presentation - Android module that can only access domain module
  • navigation - Android jetpack navigation abstraction (it contains the navigation config file) cannot access any other module

And two extra modules:

  • core - Base classes module (factories, events, etc.) that cannot access any other module
  • core-android-test - Tests classes module (rules, date builders,etc.) that cannot access any other module

Testing ๐Ÿ”Ž

Unit Testing

There are some highlights:

  • Every layer in the architecture has been tested with its mapper|transformer|provider.
  • Mockito has been used for mocking|stubbing.
  • Given|When|Then steps have been followed, in order to give a more structured overview.

UI Testing

Following the same approach I made in a previous personal project, a month ago Medium Post, I've used a dynamic test configuration.

  • In order to mock the responses and use them for instrumentation testing, I've used MockWebServer.
  • In order to give a concise and clean face of the Espresso tests, I've applied Robot Pattern.

robot

Demo ๐Ÿ“ฒ

Libraries Used ๐Ÿ“˜

  • Coroutines Library support for Kotlin coroutines.
  • Flows for asynchronous data streams (still in experimental version).
  • LiveData for reactive style programming (from VM to UI).
  • Navigation for in-app navigation.
  • Dagger2 for dependency injection.
  • Retrofit for REST api communication.
  • Timber for logging.
  • Espresso for UI tests.
  • Mockito-Kotlin for mocking in tests.
  • MockWebServer for Instrumentation tests.
  • AndroidX Test Library for providing JUnit4 and functions as launchActivity in UI tests
  • Picasso Image downloading and caching library
  • JodaTime Date library that lets manage more extensively and easily dates
  • BottomSheet Library that contains a bottom sheet view with animations (expand/collapse)
  • SolidAdapter Library that provides a SolidAdapter implementation, instead of RecyclerView.Adapter

License

Copyright 2019 Fernando Prieto Moyano

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.

coroutines-flows-modularised's People

Contributors

ferprieto avatar

Watchers

James Cloos avatar

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.