Intro, features, and setup for README

pull/1/head
Dylan McIntyre 8 years ago
parent f25e5bc826
commit 5cfa3112a4
  1. BIN
      .repo/camerakit-android-header.png
  2. BIN
      .repo/google-play-badge.png
  3. 24
      README.md
  4. 11
      camerakit/src/main/java/com/flurgle/camerakit/CameraView.java
  5. 2
      demo/src/main/java/com/flurgle/camerakit/demo/MainActivity.java
  6. 3
      demo/src/main/res/layout/activity_main.xml

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

@ -1,13 +1,33 @@
![CameraKit Header](.repo/camerakit-android-header.png)
CameraKit is an extraordinarily easy to use utility to work with the infamous Android Camera and Camera2 APIs. Built by [Dylan McIntyre](https://github.com/dwillmc).
Try out all the unique features using the CameraKit Demo from the Google Play store!
<a href='https://play.google.com/store/apps/details?id=com.flurgle.camerakit.demo&pcampaignid=MKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png' height='80'/></a>
## Features
- Image and video capture seamlessly working with the same preview session.
- Automatic system permission handling.
- Automatic preview scaling.
- Create a `CameraView` of any size (not just presets!).
- Automatic output cropping to match your `CameraView` bounds.
- Multiple capture modes.
- `PICTURE_MODE_QUALITY`: an image captured normally using the camera APIs.
- `PICTURE_MODE_SPEED`: a freeze frame of the `CameraView` preview (similar to SnapChat and Instagram) for devices with slower cameras.
- Automatic picture mode determination based on measured speed.
## Setup ## Setup
Add __CameraKit__ to your dependencies block: Add __CameraKit__ to the dependencies block in your `app` level `build.gradle`:
```groovy ```groovy
compile 'com.flurgle:camerakit:1.0.0' compile 'com.flurgle:camerakit:1.0.0'
``` ```
## Usage ## Usage
## To Do (incoming!)
## Credits ## Credits
Dylan McIntyre Dylan McIntyre

@ -2,6 +2,8 @@ package com.flurgle.camerakit;
import android.content.Context; import android.content.Context;
import android.content.res.TypedArray; import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;
import android.support.annotation.IntDef; import android.support.annotation.IntDef;
@ -277,7 +279,7 @@ public class CameraView extends FrameLayout {
} }
protected static class CameraListenerMiddleWare extends CameraListener { protected class CameraListenerMiddleWare extends CameraListener {
private CameraListener mCameraListener; private CameraListener mCameraListener;
@ -300,7 +302,14 @@ public class CameraView extends FrameLayout {
@Override @Override
public void onPictureTaken(byte[] picture) { public void onPictureTaken(byte[] picture) {
super.onPictureTaken(picture); super.onPictureTaken(picture);
if (mCropOutput) {
Bitmap bitmap = BitmapFactory.decodeByteArray(picture, 0, picture.length);
int previewWidth = mCameraImpl.mPreview.getWidth();
int previewHeight = mCameraImpl.mPreview.getWidth();
mCameraListener.onPictureTaken(picture); mCameraListener.onPictureTaken(picture);
} else {
mCameraListener.onPictureTaken(picture);
}
} }
@Override @Override

@ -57,6 +57,8 @@ public class MainActivity extends AppCompatActivity {
@BindView(R.id.height) @BindView(R.id.height)
EditText height; EditText height;
int pictureMode = Constants.PICTURE_MODE_QUALITY;
boolean blockInvalidation; boolean blockInvalidation;
@Override @Override

@ -18,7 +18,8 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="400dp" android:layout_height="400dp"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
app:ckFacing="front" /> app:ckCropOutput="true"
app:ckFacing="back" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"

Loading…
Cancel
Save