Commit ab01fcba by sikang

bug fix other pics

parent 11747c03
...@@ -38,8 +38,16 @@ import com.common.widget.TopBar; ...@@ -38,8 +38,16 @@ import com.common.widget.TopBar;
*/ */
public class TakePhotoActivity extends BaseActivity { public class TakePhotoActivity extends BaseActivity {
public enum PhotoType { public enum PhotoType {
KTP, KTP("ktp_img.jpg"),
WORK_CARD WORK_CARD("work_card_img.jpg"),
OTHERS_IMG("others_img.jpg");
private String img_path;
PhotoType(String path) {
img_path = path;
}
} }
public static void startForResult(FragmentActivity activity, int requestCode, PhotoType type, @DrawableRes int previewMask, @DrawableRes int shootBtnImg, EasyActivityResult.OnResultListener result) { public static void startForResult(FragmentActivity activity, int requestCode, PhotoType type, @DrawableRes int previewMask, @DrawableRes int shootBtnImg, EasyActivityResult.OnResultListener result) {
...@@ -51,13 +59,12 @@ public class TakePhotoActivity extends BaseActivity { ...@@ -51,13 +59,12 @@ public class TakePhotoActivity extends BaseActivity {
new EasyActivityResult(activity).startForResult(intent, requestCode, result); new EasyActivityResult(activity).startForResult(intent, requestCode, result);
} }
PhotoType photoType;
ImageView btnCapture; ImageView btnCapture;
ImageView maskImv; ImageView maskImv;
Button mbtnCancel; Button mbtnCancel;
CameraView cameraView; CameraView cameraView;
public static String KTP_IMAGE = "ktp_img.jpg";
@Override @Override
public boolean useTopBar() { public boolean useTopBar() {
...@@ -99,8 +106,12 @@ public class TakePhotoActivity extends BaseActivity { ...@@ -99,8 +106,12 @@ public class TakePhotoActivity extends BaseActivity {
if (TextUtils.equals(type, PhotoType.KTP.name())) { if (TextUtils.equals(type, PhotoType.KTP.name())) {
TrackEventHelper.logEvent(TrackEvent.Click.KTP_SHOT); TrackEventHelper.logEvent(TrackEvent.Click.KTP_SHOT);
findViewById(R.id.imageview_id_frame).setVisibility(View.VISIBLE); findViewById(R.id.imageview_id_frame).setVisibility(View.VISIBLE);
}else if(TextUtils.equals(type, PhotoType.WORK_CARD.name())){ photoType = PhotoType.KTP;
} else if (TextUtils.equals(type, PhotoType.WORK_CARD.name())) {
TrackEventHelper.logEvent(TrackEvent.Click.WORK_CARD_SHOT); TrackEventHelper.logEvent(TrackEvent.Click.WORK_CARD_SHOT);
photoType = PhotoType.WORK_CARD;
}else{
photoType = PhotoType.OTHERS_IMG;
} }
UIHelper.bindClickListener(new OnNoShakeClickListener() { UIHelper.bindClickListener(new OnNoShakeClickListener() {
...@@ -119,7 +130,7 @@ public class TakePhotoActivity extends BaseActivity { ...@@ -119,7 +130,7 @@ public class TakePhotoActivity extends BaseActivity {
// setResult(RESULT_OK); // setResult(RESULT_OK);
// finish(); // finish();
File image = FileUtils.getImageFile(getApplicationContext(), KTP_IMAGE); File image = FileUtils.getImageFile(getApplicationContext(), photoType.img_path);
if (!image.exists()) { if (!image.exists()) {
image.mkdir(); image.mkdir();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment