From d2c9d5ff80e5843fea7ac26abf9b32e175c740d0 Mon Sep 17 00:00:00 2001 From: Niklas Baudy Date: Thu, 16 Jun 2022 13:42:27 +0200 Subject: [PATCH] Sample: Use consistent name for flipping options. --- .../java/com/canhub/cropper/sample/SampleUsingImageView.kt | 6 +++--- .../sample/options_dialog/SampleOptionsBottomSheet.kt | 7 ++++--- .../cropper/sample/options_dialog/SampleOptionsEntity.kt | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/sample/src/main/java/com/canhub/cropper/sample/SampleUsingImageView.kt b/sample/src/main/java/com/canhub/cropper/sample/SampleUsingImageView.kt index b563aade..c8e9c53b 100644 --- a/sample/src/main/java/com/canhub/cropper/sample/SampleUsingImageView.kt +++ b/sample/src/main/java/com/canhub/cropper/sample/SampleUsingImageView.kt @@ -75,7 +75,7 @@ internal class SampleUsingImageView : resetCropRect() options = options?.copy( scaleType = CropImageView.ScaleType.FIT_CENTER, - flipHorizontal = false, + flipHorizontally = false, flipVertically = false, autoZoom = true, maxZoomLvl = 2 @@ -104,7 +104,7 @@ internal class SampleUsingImageView : isShowProgressBar = options.showProgressBar isAutoZoomEnabled = options.autoZoom maxZoom = options.maxZoomLvl - isFlippedHorizontally = options.flipHorizontal + isFlippedHorizontally = options.flipHorizontally isFlippedVertically = options.flipVertically isShowCropLabel = options.showCropLabel } @@ -191,7 +191,7 @@ internal class SampleUsingImageView : centerMove = true, showCropOverlay = true, showProgressBar = true, - flipHorizontal = false, + flipHorizontally = false, flipVertically = false, showCropLabel = false ) diff --git a/sample/src/main/java/com/canhub/cropper/sample/options_dialog/SampleOptionsBottomSheet.kt b/sample/src/main/java/com/canhub/cropper/sample/options_dialog/SampleOptionsBottomSheet.kt index ce45b5e1..acbfb79c 100644 --- a/sample/src/main/java/com/canhub/cropper/sample/options_dialog/SampleOptionsBottomSheet.kt +++ b/sample/src/main/java/com/canhub/cropper/sample/options_dialog/SampleOptionsBottomSheet.kt @@ -112,7 +112,7 @@ internal class SampleOptionsBottomSheet : BottomSheetDialogFragment() { binding.centerMoveEnabled.toggle.isChecked = options.centerMove binding.cropOverlay.toggle.isChecked = options.showCropOverlay binding.progressBar.toggle.isChecked = options.showProgressBar - binding.flipHorizontal.toggle.isChecked = options.flipHorizontal + binding.flipHorizontal.toggle.isChecked = options.flipHorizontally binding.flipVertical.toggle.isChecked = options.flipVertically binding.cropLabelText.toggle.isChecked = options.showCropLabel } @@ -134,7 +134,7 @@ internal class SampleOptionsBottomSheet : BottomSheetDialogFragment() { centerMove = true, showCropOverlay = true, showProgressBar = true, - flipHorizontal = false, + flipHorizontally = false, flipVertically = false, showCropLabel = true ) @@ -237,7 +237,7 @@ internal class SampleOptionsBottomSheet : BottomSheetDialogFragment() { } binding.flipHorizontal.toggle.setOnCheckedChangeListener { _, isChecked -> - options = options.copy(flipHorizontal = isChecked) + options = options.copy(flipHorizontally = isChecked) } binding.flipVertical.toggle.setOnCheckedChangeListener { _, isChecked -> @@ -255,6 +255,7 @@ internal class SampleOptionsBottomSheet : BottomSheetDialogFragment() { binding.progressBar.toggle.setOnCheckedChangeListener { _, isChecked -> options = options.copy(showProgressBar = isChecked) } + binding.cropLabelText.toggle.setOnCheckedChangeListener { _, isChecked -> options = options.copy(showCropLabel = isChecked) } diff --git a/sample/src/main/java/com/canhub/cropper/sample/options_dialog/SampleOptionsEntity.kt b/sample/src/main/java/com/canhub/cropper/sample/options_dialog/SampleOptionsEntity.kt index 0e7597df..c42f3be5 100644 --- a/sample/src/main/java/com/canhub/cropper/sample/options_dialog/SampleOptionsEntity.kt +++ b/sample/src/main/java/com/canhub/cropper/sample/options_dialog/SampleOptionsEntity.kt @@ -18,7 +18,7 @@ internal data class SampleOptionsEntity( val centerMove: Boolean, val showCropOverlay: Boolean, val showProgressBar: Boolean, - val flipHorizontal: Boolean, + val flipHorizontally: Boolean, val flipVertically: Boolean, val showCropLabel: Boolean ) : Parcelable