Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added "fun" to various Kotlin interfaces and updates SDKs a bit #104

Merged
merged 4 commits into from
Apr 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- `Security` in case of vulnerabilities.

## [unreleased x.x.x] -
## [2.3.1] - 01/04/21
### Changed
- Added "fun" for all Kotlin interfaces when possible [#102] https://github.com/CanHub/Android-Image-Cropper/issues/102

## [2.3.0] - 30/03/21
### Changed
- CropOverlayView to Kotlin [#38](https://github.com/CanHub/Android-Image-Cropper/issues/38)
Expand Down
2 changes: 1 addition & 1 deletion cropper/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ android {
abortOnError false
}
buildFeatures {
viewBinding = true
viewBinding true
}
}

Expand Down
10 changes: 5 additions & 5 deletions cropper/src/main/java/com/canhub/cropper/CropImageView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1575,7 +1575,7 @@ class CropImageView @JvmOverloads constructor(context: Context, attrs: Attribute
}

/** Interface definition for a callback to be invoked when the crop overlay is released. */
interface OnSetCropOverlayReleasedListener {
fun interface OnSetCropOverlayReleasedListener {

/**
* Called when the crop overlay changed listener is called and inProgress is false.
Expand All @@ -1586,7 +1586,7 @@ class CropImageView @JvmOverloads constructor(context: Context, attrs: Attribute
}

/** Interface definition for a callback to be invoked when the crop overlay is released. */
interface OnSetCropOverlayMovedListener {
fun interface OnSetCropOverlayMovedListener {

/**
* Called when the crop overlay is moved
Expand All @@ -1597,14 +1597,14 @@ class CropImageView @JvmOverloads constructor(context: Context, attrs: Attribute
}

/** Interface definition for a callback to be invoked when the crop overlay is released. */
interface OnSetCropWindowChangeListener {
fun interface OnSetCropWindowChangeListener {

/** Called when the crop window is changed */
fun onCropWindowChanged()
}

/** Interface definition for a callback to be invoked when image async loading is complete. */
interface OnSetImageUriCompleteListener {
fun interface OnSetImageUriCompleteListener {

/**
* Called when a crop image view has completed loading image for cropping.<br></br>
Expand All @@ -1618,7 +1618,7 @@ class CropImageView @JvmOverloads constructor(context: Context, attrs: Attribute
}

/** Interface definition for a callback to be invoked when image async crop is complete. */
interface OnCropImageCompleteListener {
fun interface OnCropImageCompleteListener {

/**
* Called when a crop image view has completed cropping image.<br></br>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ class CropOverlayView
}

/** Interface definition for a callback to be invoked when crop window rectangle is changing. */
interface CropWindowChangeListener {
fun interface CropWindowChangeListener {

/**
* Called after a change in crop window rectangle.
Expand Down
2 changes: 1 addition & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ android {
freeCompilerArgs = ["-Xinline-classes"]
}
buildFeatures {
viewBinding = true
viewBinding true
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@ package com.canhub.cropper.sample.crop_image_view.domain
import com.canhub.cropper.sample.options_dialog.domain.SOptionsDomain

internal interface SCropImageViewContract {

interface View {

fun interface View {
fun setOptions(options: SOptionsDomain)
}

interface Presenter {

fun bind(view: View)
fun unbind()

fun onViewCreated()
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
package com.canhub.cropper.sample.extend_activity.domain

internal interface SExtendContract {

interface View {

fun updateRotationCounter(counter: String)
fun rotate(counter: Int)
}

interface Presenter {

fun bindView(view: View)
fun unbindView()
fun onRotateClick()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ import com.example.croppersample.databinding.FragmentOptionsBinding
import com.google.android.material.bottomsheet.BottomSheetDialogFragment

internal class SOptionsDialogBottomSheet : BottomSheetDialogFragment(), SOptionsContract.View {

interface Listener {
fun interface Listener {

fun onOptionsApplySelected(options: SOptionsDomain)
}
Expand Down Expand Up @@ -189,8 +188,10 @@ internal class SOptionsDialogBottomSheet : BottomSheetDialogFragment(), SOptions
when (options.cropShape) {
CropImageView.CropShape.RECTANGLE -> binding.cropShape.chipRectangle.isChecked = true
CropImageView.CropShape.OVAL -> binding.cropShape.chipOval.isChecked = true
CropImageView.CropShape.RECTANGLE_VERTICAL_ONLY -> binding.cropShape.chipRectangleVerticalOnly.isChecked = true
CropImageView.CropShape.RECTANGLE_HORIZONTAL_ONLY -> binding.cropShape.chipRectangleHorizontalOnly.isChecked = true
CropImageView.CropShape.RECTANGLE_VERTICAL_ONLY ->
binding.cropShape.chipRectangleVerticalOnly.isChecked = true
CropImageView.CropShape.RECTANGLE_HORIZONTAL_ONLY ->
binding.cropShape.chipRectangleHorizontalOnly.isChecked = true
}

when (options.guidelines) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,15 @@ import com.canhub.cropper.CropImageView.ScaleType
internal interface SOptionsContract {

interface View {

fun updateOptions(options: SOptionsDomain)
fun closeWithResult(options: SOptionsDomain)
}

interface Presenter {

fun bind(view: View)
fun unbind()
fun onViewCreated(options: SOptionsDomain?)
fun onDismiss()

fun onScaleTypeSelect(scaleType: ScaleType)
fun onCropShapeSelect(cropShape: CropShape)
fun onGuidelinesSelect(guidelines: Guidelines)
Expand Down
8 changes: 4 additions & 4 deletions versions.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ext {

// Project
libVersion = "2.3.0"
libVersion = "2.3.1"
compileSdkVersion = 30
targetSdkVersion = 30
minSdkVersion = 14
Expand All @@ -19,9 +19,9 @@ ext {
materialVersion = '1.4.0-alpha01'

// AndroidX
androidXAppCompatVersionSample = '1.3.0-beta01'
androidXAppCompatVersionSample = '1.3.0-rc01'
androidXAppCompatVersionCropper = '1.2.0' // Used to avoid not release stable versions on the lib
androidXExifVersion = '1.3.2'
androidXCoreKtxVersion = '1.3.2'
androidXLifeCycleVersion = '2.3.0'
}
androidXLifeCycleVersion = '2.3.1'
}