rx3-timer

This is a simple rxjava2/rxjava3/kotlin-flow timer.

Лицензия

Лицензия

Группа

Группа

com.github.thepacific
Идентификатор

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

rx3-timer
Последняя версия

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

1.0.0
Дата

Дата

Тип

Тип

aar
Описание

Описание

rx3-timer
This is a simple rxjava2/rxjava3/kotlin-flow timer.
Ссылка на сайт

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

https://github.com/thepacific/timer
Система контроля версий

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

https://github.com/thepacific/timer

Скачать rx3-timer

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

<!-- https://jarcasting.com/artifacts/com.github.thepacific/rx3-timer/ -->
<dependency>
    <groupId>com.github.thepacific</groupId>
    <artifactId>rx3-timer</artifactId>
    <version>1.0.0</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.github.thepacific/rx3-timer/
implementation 'com.github.thepacific:rx3-timer:1.0.0'
// https://jarcasting.com/artifacts/com.github.thepacific/rx3-timer/
implementation ("com.github.thepacific:rx3-timer:1.0.0")
'com.github.thepacific:rx3-timer:aar:1.0.0'
<dependency org="com.github.thepacific" name="rx3-timer" rev="1.0.0">
  <artifact name="rx3-timer" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.github.thepacific', module='rx3-timer', version='1.0.0')
)
libraryDependencies += "com.github.thepacific" % "rx3-timer" % "1.0.0"
[com.github.thepacific/rx3-timer "1.0.0"]

Зависимости

runtime (2)

Идентификатор библиотеки Тип Версия
io.reactivex.rxjava3 : rxandroid jar 3.0.0
io.reactivex.rxjava3 : rxjava jar 3.0.5

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

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

This is a simple rxjava2/rxjava3/kotlin-flow timer. I copy this class into all the little apps I make. I'm tired of doing it. Now it's a library

Download

Usage

timer = Rx2Timer.builder()
                .initialDelay(0) //default is 0
                .period(1) //default is 1
                .take(30) //default is 60
                .unit(TimeUnit.SECONDS) // default is TimeUnit.SECONDS
                .onEmit(count -> {
                    if (count < 10) {
                        binding.text.setText("0" + count + " s");
                    } else {
                        binding.text.setText(count + " s");
                    }
                })
                .onError(e -> binding.text.setText(R.string.count))
                .onComplete(() -> binding.text.setText(R.string.count))
                .build();

timer.start();
timer.stop();
timer.restart();
timer.pause();
timer.resume();
                

Gradle

// rxjava2
implementation 'com.github.thepacific:rx2-timer:1.0.0'
// rxjava3
implementation 'com.github.thepacific:rx3-timer:1.0.0'

License

The MIT License

com.github.thepacific

thepacific

Thepacific Corp

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

Версия
1.0.0