https://github.com/piasy/rxscreenshotdetector
Android screenshot detector with ContentObserver and Rx.
https://github.com/piasy/rxscreenshotdetector
Last synced: 12 months ago
JSON representation
Android screenshot detector with ContentObserver and Rx.
- Host: GitHub
- URL: https://github.com/piasy/rxscreenshotdetector
- Owner: Piasy
- License: mit
- Created: 2016-01-29T07:57:39.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-02-18T15:47:54.000Z (over 9 years ago)
- Last Synced: 2025-04-29T21:39:22.282Z (about 1 year ago)
- Language: Java
- Homepage: http://blog.piasy.com/2016/01/29/Android-Screenshot-Detector/
- Size: 1.51 MB
- Stars: 242
- Watchers: 8
- Forks: 43
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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

## Usage
Add to gradle dependency of your module build.gradle:
```gradle
repositories {
maven {
url "http://dl.bintray.com/piasy/maven"
}
}
dependencies {
compile 'com.github.piasy:rxscreenshotdetector:1.2.0'
}
```
Use in code:
```java
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](https://github.com/akarnokd/RxJava2Interop).
See [full example](https://github.com/Piasy/RxScreenshotDetector/tree/master/app) for more details.
## Acknowledgements
+ Thanks for [RxPermissions](https://github.com/tbruyelle/RxPermissions), for request permission in reactive way.