renaming some functions and variables

This commit is contained in:
tibbi 2022-10-28 15:59:02 +02:00
parent 674f259d5b
commit 3989eca8e8
2 changed files with 9 additions and 9 deletions

View File

@ -257,7 +257,7 @@ class MainActivity : SimpleActivity(), PhotoProcessor.MediaSavedListener, Camera
} }
} }
private fun is3rdPartyIntent() = isVideoCaptureIntent() || isImageCaptureIntent() private fun isThirdPartyIntent() = isVideoCaptureIntent() || isImageCaptureIntent()
private fun isImageCaptureIntent(): Boolean = intent?.action == MediaStore.ACTION_IMAGE_CAPTURE || intent?.action == MediaStore.ACTION_IMAGE_CAPTURE_SECURE private fun isImageCaptureIntent(): Boolean = intent?.action == MediaStore.ACTION_IMAGE_CAPTURE || intent?.action == MediaStore.ACTION_IMAGE_CAPTURE_SECURE
@ -321,12 +321,12 @@ class MainActivity : SimpleActivity(), PhotoProcessor.MediaSavedListener, Camera
} }
val outputUri = intent.extras?.get(MediaStore.EXTRA_OUTPUT) as? Uri val outputUri = intent.extras?.get(MediaStore.EXTRA_OUTPUT) as? Uri
val is3rdPartyIntent = is3rdPartyIntent() val isThirdPartyIntent = isThirdPartyIntent()
mPreview = CameraXInitializer(this).createCameraXPreview( mPreview = CameraXInitializer(this).createCameraXPreview(
preview_view, preview_view,
listener = this, listener = this,
outputUri = outputUri, outputUri = outputUri,
is3rdPartyIntent = is3rdPartyIntent, isThirdPartyIntent = isThirdPartyIntent,
initInPhotoMode = mIsInPhotoMode, initInPhotoMode = mIsInPhotoMode,
) )
checkImageCaptureIntent() checkImageCaptureIntent()
@ -409,13 +409,13 @@ class MainActivity : SimpleActivity(), PhotoProcessor.MediaSavedListener, Camera
} }
private fun onSwipeLeft() { private fun onSwipeLeft() {
if (!is3rdPartyIntent() && camera_mode_tab.isVisible()) { if (!isThirdPartyIntent() && camera_mode_tab.isVisible()) {
selectPhotoTab(triggerListener = true) selectPhotoTab(triggerListener = true)
} }
} }
private fun onSwipeRight() { private fun onSwipeRight() {
if (!is3rdPartyIntent() && camera_mode_tab.isVisible()) { if (!isThirdPartyIntent() && camera_mode_tab.isVisible()) {
selectVideoTab(triggerListener = true) selectVideoTab(triggerListener = true)
} }
} }

View File

@ -12,11 +12,11 @@ class CameraXInitializer(private val activity: BaseSimpleActivity) {
previewView: PreviewView, previewView: PreviewView,
listener: CameraXPreviewListener, listener: CameraXPreviewListener,
outputUri: Uri?, outputUri: Uri?,
is3rdPartyIntent: Boolean, isThirdPartyIntent: Boolean,
initInPhotoMode: Boolean, initInPhotoMode: Boolean,
): CameraXPreview { ): CameraXPreview {
val cameraErrorHandler = newCameraErrorHandler() val cameraErrorHandler = newCameraErrorHandler()
val mediaOutputHelper = newMediaOutputHelper(cameraErrorHandler, outputUri, is3rdPartyIntent) val mediaOutputHelper = newMediaOutputHelper(cameraErrorHandler, outputUri, isThirdPartyIntent)
return CameraXPreview( return CameraXPreview(
activity, activity,
previewView, previewView,
@ -30,13 +30,13 @@ class CameraXInitializer(private val activity: BaseSimpleActivity) {
private fun newMediaOutputHelper( private fun newMediaOutputHelper(
cameraErrorHandler: CameraErrorHandler, cameraErrorHandler: CameraErrorHandler,
outputUri: Uri?, outputUri: Uri?,
is3rdPartyIntent: Boolean, isThirdPartyIntent: Boolean,
): MediaOutputHelper { ): MediaOutputHelper {
return MediaOutputHelper( return MediaOutputHelper(
activity, activity,
cameraErrorHandler, cameraErrorHandler,
outputUri, outputUri,
is3rdPartyIntent, isThirdPartyIntent,
) )
} }