Skip to content

Commit

Permalink
Added "fun" to various Kotlin interfaces and updates SDKs a bit (#104)
Browse files Browse the repository at this point in the history
* Added "fun" to Kotlin interfaces when possible

* Updated versions a bit.

* Updated changelog and library version.

Co-authored-by: AndroidDeveloperLB <770a7b267eea965d54b6c8152f2e6ed21660d076>
  • Loading branch information
AndroidDeveloperLB authored Apr 1, 2021
1 parent 197b7d6 commit 91608c8
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 28 deletions.
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'
}

0 comments on commit 91608c8

Please sign in to comment.