mirror of
				https://github.com/SimpleMobileTools/Simple-Camera.git
				synced 2025-06-27 09:02:59 +02:00 
			
		
		
		
	move preview resuming to a separate function
This commit is contained in:
		| @@ -301,16 +301,7 @@ public class Preview extends ViewGroup | ||||
|             new Handler().postDelayed(new Runnable() { | ||||
|                 @Override | ||||
|                 public void run() { | ||||
|                     if (mCamera != null) { | ||||
|                         mCamera.startPreview(); | ||||
|                     } | ||||
|  | ||||
|                     mCanTakePicture = true; | ||||
|  | ||||
|                     if (mIsFlashEnabled) { | ||||
|                         mParameters.setFlashMode(Camera.Parameters.FLASH_MODE_OFF); | ||||
|                         mCamera.setParameters(mParameters); | ||||
|                     } | ||||
|                     resumePreview(); | ||||
|                 } | ||||
|             }, PHOTO_PREVIEW_LENGTH); | ||||
|  | ||||
| @@ -318,6 +309,19 @@ public class Preview extends ViewGroup | ||||
|         } | ||||
|     }; | ||||
|  | ||||
|     private void resumePreview() { | ||||
|         if (mCamera != null) { | ||||
|             mCamera.startPreview(); | ||||
|         } | ||||
|  | ||||
|         mCanTakePicture = true; | ||||
|  | ||||
|         if (mIsFlashEnabled) { | ||||
|             mParameters.setFlashMode(Camera.Parameters.FLASH_MODE_OFF); | ||||
|             mCamera.setParameters(mParameters); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     private Camera.Size getOptimalPictureSize() { | ||||
|         final int maxResolution = Config.Companion.newInstance(mContext).getMaxPhotoResolution(); | ||||
|         final List<Camera.Size> sizes = mParameters.getSupportedPictureSizes(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user