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

View File

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