Skip to content

Commit

Permalink
Update README_EN.md
Browse files Browse the repository at this point in the history
  • Loading branch information
wildma authored Apr 28, 2019
1 parent b25052c commit a726208
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
![](https://github.com/wildma/IDCardCamera/blob/master/screenshots/screenshot.jpg)

### APK
[download APK](https://github.com/wildma/IDCardCamera/raw/master/apk/com.wildma.idcardcamera-1.0.2.apk)
[download APK](https://github.com/wildma/IDCardCamera/raw/master/apk/com.wildma.idcardcamera-1.1.0.apk)

### Features
- Custom camera interface
Expand All @@ -35,23 +35,33 @@ allprojects {
##### Step 2. Add a gradle dependency
```
dependencies {
compile 'com.github.wildma:IDCardCamera:1.0.2'
compile 'com.github.wildma:IDCardCamera:1.1.0'
}
```

##### Step 3. Open photographic interface
- front
```
CameraActivity.toCameraActivity(this, CameraActivity.TYPE_IDCARD_FRONT);
IDCardCamera.create(this).openCamera(IDCardCamera.TYPE_IDCARD_FRONT);
```
- back
```
IDCardCamera.create(this).openCamera(IDCardCamera.TYPE_IDCARD_BACK);
```
**notice:** In the Fragment,Replace "this" with "fragment.this".

##### Step 4. Get a picture
```
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == CameraActivity.REQUEST_CODE && resultCode == CameraActivity.RESULT_CODE) {
final String path = CameraActivity.getImagePath(data);
if (resultCode == IDCardCamera.RESULT_CODE) {
final String path = IDCardCamera.getImagePath(data);
if (!TextUtils.isEmpty(path)) {
imageView.setImageBitmap(BitmapFactory.decodeFile(path));
if (requestCode == IDCardCamera.TYPE_IDCARD_FRONT) {
mIvFront.setImageBitmap(BitmapFactory.decodeFile(path));
} else if (requestCode == IDCardCamera.TYPE_IDCARD_BACK) {
mIvBack.setImageBitmap(BitmapFactory.decodeFile(path));
}
}
}
}
Expand Down

0 comments on commit a726208

Please sign in to comment.