Skip to content

Commit

Permalink
move all next steps in start() to handler postdelayed
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdian-s committed Jul 17, 2018
1 parent b957e72 commit 36560d9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,11 @@ public void onClick(View v) {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mCameraView = (CameraView) findViewById(R.id.camera);
mCameraView = findViewById(R.id.camera);
if (mCameraView != null) {
mCameraView.setKycImageType("SELFIE_ID");
mCameraView.setTitleText("Pastikan KTP anda sejajar dengan\n"
+ "garis panduan");
mCameraView.addCallback(mCallback);
}
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.take_picture);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@ public void onSurfaceChanged() {
boolean start() {
chooseCamera();
openCamera();
if (mPreview.isReady()) {
setUpPreview();
}
mShowingPreview = true;
mCamera.startPreview();
return true;
}

Expand Down Expand Up @@ -329,6 +324,11 @@ public void run() {
adjustCameraParameters();
mCamera.setDisplayOrientation(calcDisplayOrientation(mDisplayOrientation));
mCallback.onCameraOpened();
if (mPreview.isReady()) {
setUpPreview();
}
mShowingPreview = true;
mCamera.startPreview();
}
}, delay);

Expand Down

0 comments on commit 36560d9

Please sign in to comment.