Update versions, add detekt and spotless

This commit is contained in:
Oleksandr Balan
2022-08-21 09:45:13 +02:00
parent c7ba0f606d
commit 495f6f3651
22 changed files with 832 additions and 94 deletions

View File

@@ -27,7 +27,7 @@ android {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion compose_version
kotlinCompilerExtensionVersion compose_compiler_version
}
kotlinOptions {
jvmTarget = "1.8"

View File

@@ -1,3 +1,5 @@
@file:Suppress("LongParameterList", "LongMethod")
package eu.wewox.pagecurl.config
import androidx.compose.runtime.Composable

View File

@@ -63,6 +63,7 @@ public fun rememberPageCurlState(
* The state of the PageCurl.
*
* @property max The max number of pages.
* @property config The configuration for PageCurl.
* @param initialCurrent The initial current page.
*/
@ExperimentalPageCurlApi

View File

@@ -38,7 +38,11 @@ internal fun Modifier.tapGesture(
return@awaitPointerEventScope
}
if (config.tapBackwardEnabled && config.tapBackwardInteraction.target.multiply(size).contains(up.position)) {
if (config.tapBackwardEnabled &&
config.tapBackwardInteraction.target
.multiply(size)
.contains(up.position)
) {
scope.launch {
onTapBackward()
}

View File

@@ -19,9 +19,12 @@ internal fun lineLineIntersection(
val denominator = (line1a.x - line1b.x) * (line2a.y - line2b.y) - (line1a.y - line1b.y) * (line2a.x - line2b.x)
if (denominator == 0f) return null
val x = ((line1a.x * line1b.y - line1a.y * line1b.x) * (line2a.x - line2b.x) -
(line1a.x - line1b.x) * (line2a.x * line2b.y - line2a.y * line2b.x)) / denominator
val y = ((line1a.x * line1b.y - line1a.y * line1b.x) * (line2a.y - line2b.y) -
(line1a.y - line1b.y) * (line2a.x * line2b.y - line2a.y * line2b.x)) / denominator
val x1 = (line1a.x * line1b.y - line1a.y * line1b.x) * (line2a.x - line2b.x)
val x2 = (line1a.x - line1b.x) * (line2a.x * line2b.y - line2a.y * line2b.x)
val x = (x1 - x2) / denominator
val y1 = (line1a.x * line1b.y - line1a.y * line1b.x) * (line2a.y - line2b.y)
val y2 = (line1a.y - line1b.y) * (line2a.x * line2b.y - line2a.y * line2b.x)
val y = (y1 - y2) / denominator
return Offset(x, y)
}