Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/rajasharan/camerapeekpreview

Easily peek into the android camera preview and snap pictures
https://github.com/rajasharan/camerapeekpreview

Last synced: 3 days ago
JSON representation

Easily peek into the android camera preview and snap pictures

Awesome Lists containing this project

README

        

# Android Camera Peek Preview
Easily peek into the camera preview and snap pictures

## Demo
![](/screencast.gif)

## Usage
Add your layout file inside `CameraPeekPreview` using the `include` tag

[activity_main.xml](/demo/src/main/res/layout/activity_main.xml)
```xml

```

#### Setup `OnPictureTakenListener` to receive Bitmap
[MainActivity.java](/demo/src/main/java/com/rajasharan/camerapeekpreview/MainActivity.java)
```java
public class MainActivity extends AppCompatActivity implements CameraPeekPreview.OnPictureTakenListener {

private ImageView mImageView;
private CameraPeekPreview mRoot;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

mImageView = (ImageView) findViewById(R.id.imageview);
mRoot = (CameraPeekPreview) findViewById(R.id.camera_peek);
mRoot.setOnPictureTakenListener(this);
}

@Override
public void onPictureTaken(Bitmap bitmap) {
mImageView.setImageBitmap(bitmap);
}
}
```

## [License](/LICENSE)
The MIT License (MIT)