美文网首页
2018-08-28

2018-08-28

作者: Run_4729 | 来源:发表于2018-08-28 23:34 被阅读0次

    RxScreenshotDetector

    Android screenshot detector with ContentObserver and Rx.

    Note that this library only work as best effort, it won't (and can't I think) cover all corner cases. Good luck with it :)

    ScreenShot

    [图片上传失败...(image-cfbd3f-1535470492042)]

    Usage

    Add to gradle dependency of your module build.gradle:

    repositories {
        maven {
            url  "http://dl.bintray.com/piasy/maven"
        }
    }
    
    dependencies {
        compile 'com.github.piasy:rxscreenshotdetector:1.2.0'
    }
    

    Use in code:

    RxScreenshotDetector.start(this)
            .compose(bindToLifecycle())
            .subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(path -> mTextView.setText(mTextView.getText() + "\nScreenshot: " + path),
                    Throwable::printStackTrace);
    

    To use with RxJava 1.x, see RxJava2Interop.

    See full example for more details.

    Acknowledgements

    • Thanks for RxPermissions, for request permission in reactive way.

    相关文章

      网友评论

          本文标题:2018-08-28

          本文链接:https://www.haomeiwen.com/subject/irvcwftx.html