Miguelos / AndroidMultiModuleSample

Simple modular app using MVVM, Hilt, RxJava...

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Android Sample

kotlin Dagger

🚧 Under construction! 🚧

Sample App for use and practise of different libraries.

Includes:

  • Sample feature list of Beers from Punk API.
  • Samples of UI testing and Unit testing.

UI tests

Under androidTest folder in the app module there are UI tests for the app happy path. Here is the example of two tests for online and offline cases placed inside MainActivityTest.kt

    @Test
    fun searchList() {
        robot.turnOnInternetConnections()
        robot.fillEditTextAndApply(R.id.search_et, "vlad")
        robot.doOnView(withText("Hello My Name is Vladimir"), ViewActions.click())
        robot.assertOnView(withId(R.id.beer_cl))
    }


    /**
     * Check that without Internet the Ranking shows previous beers involved in battles
     */
    @Test
    fun offlineSearchList() {
        robot.turnOffInternetConnections()
        robot.fillEditTextAndApply(R.id.search_et, "vlad")
        robot.assertOnView(withText(R.string.dialog_offline))
        robot.turnOnInternetConnections()
    }

Features and Libraries

  • Clean Architecture with MVVM
  • Single Activity Design
  • Jetpack Navigation
  • Dagger Hilt
  • Kotlin Gradle DSL
  • Room
  • Lifecycle
  • Punk API

Libraries

Structure

  • Presentation: Model View View Model pattern from the base sample.
  • Domain: Holds all business logic. The domain layer starts with classes named use cases used by the application presenters. These use cases represent all the possible actions a developer can perform from the presentation layer.
  • Repository: Repository pattern from the base sample.

Author

Miguel González Pérez

License

Copyright 2020 Miguel González Pérez

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.

About

Simple modular app using MVVM, Hilt, RxJava...


Languages

Language:Kotlin 100.0%