RxComboDetector Save

Android view click combo detector with Rx.

Project README

RxComboDetector

Android view click combo detector with Rx.

ScreenShot

combo-demo.gif

Usage

Add to gradle dependency of your module build.gradle:

repositories {
    jcenter()
}

dependencies {
    compile 'com.github.piasy:rxcombodetector:1.1.0'
}

Use in code:

new RxComboDetector.Builder()
        .detectOn(mBtnCombo)
        .start()
        .observeOn(AndroidSchedulers.mainThread())
        .subscribe(new Consumer<Integer>() {
            @Override
            public void accept(Integer combo) throws Exception {
                mTextView.setText(mTextView.getText() + "Combo x " + combo + "\n");
                mScrollView.fullScroll(View.FOCUS_DOWN);
                mYOLOComboView.combo(combo);
            }
        });

See full example for more details.

Acknowledgements

  • ViewClickOnSubscribe and Preconditions classes are grabbed from RxBinding, to reduce dependencies of this library.
  • Thanks for rebound to let me make fancy animation.
  • Thanks for YOLO, the yellow smiling face.
Open Source Agenda is not affiliated with "RxComboDetector" Project. README Source: Piasy/RxComboDetector
Stars
80
Open Issues
0
Last Commit
7 years ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating