Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/rajasharan/camerapeekpreview
- Owner: rajasharan
- License: mit
- Created: 2015-09-07T06:49:51.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-13T08:18:35.000Z (about 9 years ago)
- Last Synced: 2023-03-12T06:04:02.525Z (over 1 year ago)
- Language: Java
- Size: 14.6 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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)