Advertisement
Guest User

Untitled

a guest
Mar 10th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. public void eyeTracking(FirebaseVisionFace face){
  2.  
  3. final boolean right_eye = face.getRightEyeOpenProbability() < 0.5;
  4. final boolean left_eye = face.getLeftEyeOpenProbability() < 0.5;
  5.  
  6. final long start = System.currentTimeMillis();
  7. Log.d(TAG, "TimeA: " + start);
  8.  
  9. if (right_eye && left_eye) {
  10.  
  11. new CountDownTimer(5000, 1000) {
  12.  
  13. public void onTick(long millisUntilFinished) {
  14.  
  15.  
  16. }
  17.  
  18. public void onFinish() {
  19. long end = System.currentTimeMillis();
  20. Log.d(TAG, "TimeB: " + end);
  21. if(end - start >= 5000){
  22. if (right_eye && left_eye) {
  23. alertBox();
  24. }
  25. }
  26.  
  27. }
  28. }.start();
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement