https://github.com/reactcomponentkit/androidreactcomponentkit
AndroidReactComponentKit = Component + MVVM + Redux for Android!!!
https://github.com/reactcomponentkit/androidreactcomponentkit
android component mvvm react redux
Last synced: 8 months ago
JSON representation
AndroidReactComponentKit = Component + MVVM + Redux for Android!!!
- Host: GitHub
- URL: https://github.com/reactcomponentkit/androidreactcomponentkit
- Owner: ReactComponentKit
- License: mit
- Created: 2019-05-13T12:30:38.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-09-19T12:26:12.000Z (over 6 years ago)
- Last Synced: 2025-04-04T21:39:48.329Z (11 months ago)
- Topics: android, component, mvvm, react, redux
- Language: Kotlin
- Homepage: https://github.com/ReactComponentKit/AndroidReactComponentKit
- Size: 3.19 MB
- Stars: 11
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AndroidReactComponentKit
[](http://developer.android.com/index.html)
[](https://android-arsenal.com/api?level=16)
[](http://opensource.org/licenses/MIT)
AndroidReactComponentKit is [ReactComponentKit](https://github.com/ReactComponentKit/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.
## 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 Mutation pipeline. Reducers make a new state.
* (4) : New State comes out from the Mutation pipeline. It is passed to the store.
* (5) : Store passes the new state to the ViewModel.
* (6) : ViewModel passes 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](https://github.com/ReactComponentKit/HelloAndroidRCK)

### [Hello Android RoomDB](https://github.com/ReactComponentKit/HelloRoom)

### [Counter](https://github.com/ReactComponentKit/AndroidReactComponentKit/tree/master/app/src/main/java/com/github/skyfe79/android/library/app/examples/counter2)

### [RecyclerView with DiffUtil](https://github.com/ReactComponentKit/AndroidReactComponentKit/tree/master/app/src/main/java/com/github/skyfe79/android/library/app/examples/emojicollection)

### [CollectionViewAdapter](https://github.com/ReactComponentKit/AndroidReactComponentKit/tree/master/app/src/main/java/com/github/skyfe79/android/library/app/examples/collectionview)

## Setup Gradle
### Project's build.gradle
```groovy
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='2.0.4'
```
### App's build.gradle
```groovy
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](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.