From 46f2f7f4d93fd3fdc142a3be05ffcb8856eac3ec Mon Sep 17 00:00:00 2001 From: T8RIN Date: Tue, 24 Dec 2024 19:22:04 +0300 Subject: [PATCH] fix kotlin 2.1.0 data class warnings --- gradle/libs.versions.toml | 2 +- .../src/main/java/com/t8rin/collages/CollageType.kt | 1 + .../com/smarttoolfactory/cropper/settings/CropDefaults.kt | 4 ++-- .../main/java/com/t8rin/curves/ImageCurvesEditorState.kt | 1 + .../java/com/smarttoolfactory/image/ImageWithThumbnail.kt | 6 +++--- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f48e6da3..9e5b0b50 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,7 +5,7 @@ androidCompileSdk = "35" jvmTarget = "17" -libVersion = "3.2.6" +libVersion = "3.2.7" kotlin = "2.1.0" agp = "8.7.3" diff --git a/libs/collages/src/main/java/com/t8rin/collages/CollageType.kt b/libs/collages/src/main/java/com/t8rin/collages/CollageType.kt index 2df0a4eb..947934c9 100644 --- a/libs/collages/src/main/java/com/t8rin/collages/CollageType.kt +++ b/libs/collages/src/main/java/com/t8rin/collages/CollageType.kt @@ -2,6 +2,7 @@ package com.t8rin.collages import com.t8rin.collages.model.TemplateItem +@ConsistentCopyVisibility data class CollageType internal constructor( internal val templateItem: TemplateItem?, internal val index: Int? diff --git a/libs/cropper/src/main/java/com/smarttoolfactory/cropper/settings/CropDefaults.kt b/libs/cropper/src/main/java/com/smarttoolfactory/cropper/settings/CropDefaults.kt index f328c13f..5e53b8c9 100644 --- a/libs/cropper/src/main/java/com/smarttoolfactory/cropper/settings/CropDefaults.kt +++ b/libs/cropper/src/main/java/com/smarttoolfactory/cropper/settings/CropDefaults.kt @@ -89,7 +89,7 @@ object CropDefaults { * is shared between ui and state. */ @Immutable -data class CropProperties internal constructor( +data class CropProperties( val cropType: CropType, val handleSize: Float, val middleHandleSize: Float, @@ -111,7 +111,7 @@ data class CropProperties internal constructor( * by [CropState] or [Modifier.crop] */ @Immutable -data class CropStyle internal constructor( +data class CropStyle( val drawOverlay: Boolean, val drawGrid: Boolean, val strokeWidth: Dp, diff --git a/libs/curves/src/main/java/com/t8rin/curves/ImageCurvesEditorState.kt b/libs/curves/src/main/java/com/t8rin/curves/ImageCurvesEditorState.kt index 40a4be5a..148ce123 100644 --- a/libs/curves/src/main/java/com/t8rin/curves/ImageCurvesEditorState.kt +++ b/libs/curves/src/main/java/com/t8rin/curves/ImageCurvesEditorState.kt @@ -6,6 +6,7 @@ import com.t8rin.curves.view.PhotoFilterCurvesControl.CurvesValue import jp.co.cyberagent.android.gpuimage.filter.GPUImageFilter import jp.co.cyberagent.android.gpuimage.filter.GPUImageToneCurveFilter +@ConsistentCopyVisibility data class ImageCurvesEditorState internal constructor( internal val curvesToolValue: CurvesToolValue ) { diff --git a/libs/image/src/main/java/com/smarttoolfactory/image/ImageWithThumbnail.kt b/libs/image/src/main/java/com/smarttoolfactory/image/ImageWithThumbnail.kt index 05ba8687..bcfc303a 100644 --- a/libs/image/src/main/java/com/smarttoolfactory/image/ImageWithThumbnail.kt +++ b/libs/image/src/main/java/com/smarttoolfactory/image/ImageWithThumbnail.kt @@ -223,7 +223,7 @@ private fun ThumbnailLayoutImpl( BoxWithConstraints(modifier) { - val canvasWidth = constraints.maxWidth.toFloat() + val canvasWidth = this.constraints.maxWidth.toFloat() val canvasHeight = constraints.maxHeight.toFloat() val thumbnailWidthInPx: Float @@ -484,7 +484,7 @@ fun rememberThumbnailState( } @Immutable -data class ThumbnailState internal constructor( +data class ThumbnailState( @Stable val size: DpSize = DpSize(80.dp, 80.dp), @Stable @@ -533,7 +533,7 @@ fun Border( } @Immutable -data class Border internal constructor( +data class Border( @Stable val strokeWidth: Dp, @Stable