AndroidReactComponentKit

Platform API License

AndroidReactComponentKit is ReactComponentKit for Android. AndroidReactComponentKit is a library for building Activity or Fragment. You can make that based on Components. Also, It uses MVVM and Redux architectures for unidirectional data flow.

ReactComponentKit by AndroidReactComponentKit

Data Flow

  • (1) : Components dispatch actions
  • (2) : ViewModel passes the actions to the store. You can use beforeDispatch(action:) method to do some work before dispatching actions.
  • (3) : Store passes current state to the Redux pipeline. Middlewares, Reducers and Postwares make a new state.
  • (4) : New State comes out from the Redux pipeline. It is passed to the store.
  • (5) : Store passes the new state to the ViewModel.
  • (6) : ViewModel passes or propagates the new state to the Components.

Components

AndroidReactComponentKit provides four components basically.

  • ViewComponent * ViewComponent is a view. It is an abstraction of the view that makes up the screen as a component. You can use ViewComponent to create a layout of the Activity or Fragment. It can also be used to create an item views in RecyclerView.
  • FragmentComponent * FragmentComponet is a fragment. You can use FragmentComponent when creating an Activity. If you delegate responsibility for an Activity to a FragmentComponent, you can avoid creating a massive Activity.
  • RecyclerViewAdapter * The RecyclerViewAdapter connects ViewComponent and RecyclerView. The RecyclerViewAdapter can use several types of views, but only one LayoutManager can be used.
  • CollectionViewAdapter * The CollectionViewAdapter connects ViewComponent and RecyclerView. Unlike the RecyclerViewAdapter, you can use multiple LayoutManagers. In other words, you can use various LayoutManagers with different types of views.

Examples

Hello Android RCK

ReactComponentKit by AndroidReactComponentKit

Hello Android RoomDB

ReactComponentKit by AndroidReactComponentKit

Counter

ReactComponentKit by AndroidReactComponentKit

RecyclerView with DiffUtil

ReactComponentKit by AndroidReactComponentKit

CollectionViewAdapter

ReactComponentKit by AndroidReactComponentKit

Setup Gradle

Project’s build.gradle

ext.kotlin_version = '1.3.31'
ext.anko_version='0.10.8'
ext.androidx_lifecycle_version='2.0.0'
ext.rxjava2_version='2.2.8'
ext.rxkotlin_version='2.3.0'
ext.rck_version='0.0.1'

App’s build.gradle

dependencies {
	...
	implementation "io.reactivex.rxjava2:rxjava:$rxjava2_version"
	implementation "io.reactivex.rxjava2:rxkotlin:$rxkotlin_version"
	implementation "org.jetbrains.anko:anko:$anko_version"
	implementation "androidx.lifecycle:lifecycle-extensions:$androidx_lifecycle_version"
	implementation "com.github.skyfe79.android:reactcomponentkit:$rck_version"
}

MIT License

The MIT License (MIT)

Copyright (c) 2016 Sungcheol Kim, https://github.com/ReactComponentKit/AndroidReactComponentKit

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.

compile "com.github.skyfe79.android:reactcomponentkit:0.0.1"

Related Libraries

materialdrawerkt

A Kotlin DSL wrapper around the mikepenz/MaterialDrawer library.

Last updated 3 mins ago

anvil

Minimal UI library for Android inspired by React

Last updated 3 mins ago

RichUtilsKt

Advancement Utils for Android Developer written in Kotlin

Last updated 3 mins ago

mapme

The Android maps adapter

Last updated 3 mins ago

bubble

Screen orientation detector for android

Last updated 3 mins ago