mirror of
https://github.com/fankes/pagecurl-multiplatform.git
synced 2025-09-09 03:54:08 +08:00
Increase compose to 2023.03.00
This commit is contained in:
@@ -4,7 +4,7 @@ buildscript {
|
|||||||
min_sdk_version = 24
|
min_sdk_version = 24
|
||||||
target_sdk_version = 33
|
target_sdk_version = 33
|
||||||
|
|
||||||
compose_bom_version = "2023.01.00"
|
compose_bom_version = "2023.03.00"
|
||||||
compose_compiler_version = "1.4.2"
|
compose_compiler_version = "1.4.2"
|
||||||
accompanist_version = "0.28.0"
|
accompanist_version = "0.28.0"
|
||||||
activity_version = "1.6.1"
|
activity_version = "1.6.1"
|
||||||
|
@@ -4,6 +4,7 @@ import androidx.compose.foundation.layout.Box
|
|||||||
import androidx.compose.foundation.layout.BoxWithConstraints
|
import androidx.compose.foundation.layout.BoxWithConstraints
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
|
import androidx.compose.runtime.key
|
||||||
import androidx.compose.runtime.mutableStateOf
|
import androidx.compose.runtime.mutableStateOf
|
||||||
import androidx.compose.runtime.remember
|
import androidx.compose.runtime.remember
|
||||||
import androidx.compose.runtime.rememberCoroutineScope
|
import androidx.compose.runtime.rememberCoroutineScope
|
||||||
@@ -69,6 +70,8 @@ public fun PageCurl(
|
|||||||
onTapBackward = state::prev,
|
onTapBackward = state::prev,
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
|
// Wrap in key to synchronize state updates
|
||||||
|
key(updatedCurrent, internalState.forward.value, internalState.backward.value) {
|
||||||
if (updatedCurrent + 1 < state.max) {
|
if (updatedCurrent + 1 < state.max) {
|
||||||
content(updatedCurrent + 1)
|
content(updatedCurrent + 1)
|
||||||
}
|
}
|
||||||
@@ -87,6 +90,7 @@ public fun PageCurl(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shows the pages which may be turned by drag or tap gestures.
|
* Shows the pages which may be turned by drag or tap gestures.
|
||||||
|
Reference in New Issue
Block a user