Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rajasharan/screenshotlayer
An intuitive way to take screenshots in android using custom layout
https://github.com/rajasharan/screenshotlayer
Last synced: 3 days ago
JSON representation
An intuitive way to take screenshots in android using custom layout
- Host: GitHub
- URL: https://github.com/rajasharan/screenshotlayer
- Owner: rajasharan
- License: mit
- Created: 2015-06-26T12:17:40.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-07-31T07:53:10.000Z (over 9 years ago)
- Last Synced: 2023-03-12T06:04:05.299Z (over 1 year ago)
- Language: Java
- Size: 12.2 MB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Android Screenshot Layer
An intuitive way to take screenshots in android using custom layout## Screencast Demo
![](/screencast.gif)### Layout Usage
Add the main layout as a child of this Layer to enable screenshots.
Swipe from left or right edges of the screen.
([activity_main.xml](/demo/src/main/res/layout/activity_main.xml))
```xml
```
**Use ScreenshotListener for success/error messages** ([MainActivity.java](/demo/src/main/java/com/rajasharan/demo/MainActivity.java))
```java@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
root = (ScreenshotLayer) findViewById(R.id.layer);
root.setScreenshotListener(new ScreenshotLayer.ScreenshotListener() {
@Override
public void onScreenshotSaved(String path) {
Toast.makeText(MainActivity.this, "Screenshot saved in " + path, Toast.LENGTH_SHORT).show();
}@Override
public void onScreenshotError(String reason) {
Toast.makeText(MainActivity.this, "Screenshot failed: " + reason, Toast.LENGTH_SHORT).show();
}
});
}```