Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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();
}
});
}

```