Giter Club home page Giter Club logo

giphy-viewer-kotlin's Introduction

Giphy Viewer Android app written in Kotlin

You can find an in-depth exploration of this project in this blog post on developerlife.com.

Design

  • MyApplication.kt is the custom Application class that acts as a dependency injection component that provides various objects that are needed in various places throughout the app.

  • State.kt contains sealed classes that represent various events and state representations that are used throughout the app.

  • Util.kt contains a set of extension function expressions and typedefs that are used throughout the app. Coroutine functions are included here as well.

  • MyViewModel.kt contains the AndroidViewModel that holds the data that's loaded from the network service, and also exposes the network service end points to the rest of the app.

  • NetworkService.kt contains the integration w/ the Giphy Android SDK. Calls from the ViewModel are passed on the methods of GiphyClient, which ends up making calls to the Giphy Android API.

  • RecyclerViewManager.kt contains the RecyclerView data adapter, RowViewModel implementation, and configuration w/ the StaggeredGridLayoutManager. It also hooks into the ViewModel's observable to react to changes in the underlying data (as a result of network service request being made from various parts of the app).

  • NetworkServiceTest.kt contains the classes that connect to web services to load data over the network (GiphyClient SDK).

  • Unit tests (test/) test classes in State.kt and some functions in NetworkService (using Roboelectric).

  • Instrumented tests (androidTest/) test classes in NetworkServiceTest.kt over the network.

Video of app in action

References

ViewModel testing, MockK, Espresso (AndroidJUnit4)

Kotlin object expressions, declarations, constructors, constants, coroutines

Anko logging

Android testing overview (w/ Kotlin)

Roboelectric (and unit tests)

Testing async code in tests

Removing deprecations from androidTestImplementation

AssertJ

Change master to main

The Internet Engineering Task Force (IETF) points out that "Master-slave is an oppressive metaphor that will and should never become fully detached from history" as well as "In addition to being inappropriate and arcane, the master-slave metaphor is both technically and historically inaccurate." There's lots of more accurate options depending on context and it costs me nothing to change my vocabulary, especially if it is one less little speed bump to getting a new person excited about tech.

You might say, "I'm all for not using master in master-slave technical relationships, but this is clearly an instance of master-copy, not master-slave" but that may not be the case. Turns out the original usage of master in Git very likely came from another version control system (BitKeeper) that explicitly had a notion of slave branches.

#blacklivesmatter

giphy-viewer-kotlin's People

Contributors

nazmulidris avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.