rxui-kotlin

Set of primitives for Reactive UI on Android

Лицензия

Лицензия

Apache License Version 2.0
Категории

Категории

Kotlin Языки программирования
Группа

Группа

com.artemzin.rxui
Идентификатор

Идентификатор

rxui-kotlin
Последняя версия

Последняя версия

1.0.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

rxui-kotlin
Set of primitives for Reactive UI on Android
Ссылка на сайт

Ссылка на сайт

https://github.com/artem-zinnatullin/RxUi
Система контроля версий

Система контроля версий

https://github.com/artem-zinnatullin/RxUi

Скачать rxui-kotlin

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.artemzin.rxui/rxui-kotlin/ -->
<dependency>
    <groupId>com.artemzin.rxui</groupId>
    <artifactId>rxui-kotlin</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.artemzin.rxui/rxui-kotlin/
implementation 'com.artemzin.rxui:rxui-kotlin:1.0.1'
// https://jarcasting.com/artifacts/com.artemzin.rxui/rxui-kotlin/
implementation ("com.artemzin.rxui:rxui-kotlin:1.0.1")
'com.artemzin.rxui:rxui-kotlin:jar:1.0.1'
<dependency org="com.artemzin.rxui" name="rxui-kotlin" rev="1.0.1">
  <artifact name="rxui-kotlin" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.artemzin.rxui', module='rxui-kotlin', version='1.0.1')
)
libraryDependencies += "com.artemzin.rxui" % "rxui-kotlin" % "1.0.1"
[com.artemzin.rxui/rxui-kotlin "1.0.1"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
com.artemzin.rxui : rxui jar 1.0.1
org.jetbrains.kotlin : kotlin-stdlib jar 1.0.2

Модули Проекта

Данный проект не имеет модулей.

RxUi: Observable <-> Observable

Minimal implementation of the concept of talking to Android View layer in a Reactive way described here.

RxUi solves 3 main problems of communication between Presenters/ViewModels/etc and View layer in Android applications:
  1. Main Thread should be part of View layer, Presenters/ViewModels/etc should not know about it.
  2. Action posted to Main Thread should be part of Disposable so you could dispose() it and prevent execution.
  3. Backpressure occurred on the View layer should be detected and handled on Presenter/ViewModel/etc layer above.

Sample Apps

Check Sample app written in Java and Sample app written in Kotlin.

RxUi is so tiny that you may not even see it in the code at the first sight!


Basically, RxUi is just two main functions:
  1. bind(Observable<T>): Disposable
  2. ui(Consumer<T>): Function<Observable<T>, Disposable>

And concept of Observable <-> Observable in the View layer when View only produces Observables and consumes Observables.

interface SignInView {
  // Produces.
  Observable<String> login();
  Observable<String> password();
  Observable<Object> signInClicks();
  
  // Consumes.
  Function<Observable<Boolean>,      Disposable> signInEnable();
  Function<Observable<SignInResult>, Disposable> signInResult();
}

Download

RxUi

Only two functions at the moment: RxUi.bind() (use it in Presenters/ViewModels) and RxUi.ui() use it in View layer.

compile 'com.artemzin.rxui2:rxui:2.0.0'

 

RxUi Test

Only one function at the moment: TestRxUi.testUi(), basically same as RxUi.ui() except that it's synchronous and does not know about Main Thread.

testCompile 'com.artemzin.rxui2:rxui-test:2.0.0'

 

RxUi Kotlin

Only one extension function at the moment: Observable.bind(), absolutely same as RxUi.bind() but easier to use in Kotlin.

compile 'com.artemzin.rxui2:rxui-kotlin:2.0.0'

 


Made with ❤️ by Artem Zinnatullin, discussed with Juno Android Team and @FE_Hudl.

Версии библиотеки

Версия
1.0.1
1.0.0