mirror of
https://github.com/Suwayomi/TachideskJUI.git
synced 2025-12-10 14:52:03 +01:00
No default values for expect functions 3
This commit is contained in:
@@ -28,7 +28,7 @@ actual class ComponentRect actual constructor(
|
||||
) : TooltipPlacement
|
||||
|
||||
@Composable
|
||||
actual fun TooltipArea(
|
||||
internal actual fun RealTooltipArea(
|
||||
tooltip: @Composable () -> Unit,
|
||||
modifier: Modifier,
|
||||
delayMillis: Int,
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
package ca.gosyer.jui.ui.base.file
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.net.Uri
|
||||
import androidx.activity.compose.ManagedActivityResultLauncher
|
||||
import androidx.activity.compose.rememberLauncherForActivityResult
|
||||
@@ -24,8 +25,9 @@ actual class FileSaver(
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("Recycle")
|
||||
@Composable
|
||||
actual fun rememberFileSaver(
|
||||
internal actual fun realRememberFileSaver(
|
||||
onFileSelected: (Sink) -> Unit,
|
||||
onCancel: () -> Unit,
|
||||
onError: () -> Unit
|
||||
|
||||
@@ -10,6 +10,6 @@ import androidx.compose.runtime.Composable
|
||||
import androidx.activity.compose.BackHandler as AndroidBackHandler
|
||||
|
||||
@Composable
|
||||
actual fun BackHandler(enabled: Boolean, onBack: () -> Unit) {
|
||||
internal actual fun RealBackHandler(enabled: Boolean, onBack: () -> Unit) {
|
||||
AndroidBackHandler(enabled, onBack)
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ expect class ComponentRect(
|
||||
|
||||
@OptIn(ExperimentalFoundationApi::class)
|
||||
@Composable
|
||||
expect fun TooltipArea(
|
||||
fun TooltipArea(
|
||||
tooltip: @Composable () -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
delayMillis: Int = 500,
|
||||
@@ -53,4 +53,21 @@ expect fun TooltipArea(
|
||||
offset = DpOffset(0.dp, 16.dp)
|
||||
),
|
||||
content: @Composable () -> Unit
|
||||
) = RealTooltipArea(
|
||||
tooltip = tooltip,
|
||||
modifier = modifier,
|
||||
delayMillis = delayMillis,
|
||||
tooltipPlacement = tooltipPlacement,
|
||||
content = content
|
||||
)
|
||||
|
||||
|
||||
@OptIn(ExperimentalFoundationApi::class)
|
||||
@Composable
|
||||
internal expect fun RealTooltipArea(
|
||||
tooltip: @Composable () -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
delayMillis: Int = 500,
|
||||
tooltipPlacement: TooltipPlacement,
|
||||
content: @Composable () -> Unit
|
||||
)
|
||||
|
||||
@@ -14,8 +14,19 @@ expect class FileSaver {
|
||||
}
|
||||
|
||||
@Composable
|
||||
expect fun rememberFileSaver(
|
||||
fun rememberFileSaver(
|
||||
onFileSelected: (Sink) -> Unit,
|
||||
onCancel: () -> Unit = {},
|
||||
onError: () -> Unit = {}
|
||||
): FileSaver = realRememberFileSaver(
|
||||
onFileSelected = onFileSelected,
|
||||
onCancel = onCancel,
|
||||
onError = onError
|
||||
)
|
||||
|
||||
@Composable
|
||||
internal expect fun realRememberFileSaver(
|
||||
onFileSelected: (Sink) -> Unit,
|
||||
onCancel: () -> Unit,
|
||||
onError: () -> Unit
|
||||
): FileSaver
|
||||
|
||||
@@ -9,4 +9,7 @@ package ca.gosyer.jui.ui.base.navigation
|
||||
import androidx.compose.runtime.Composable
|
||||
|
||||
@Composable
|
||||
expect fun BackHandler(enabled: Boolean = true, onBack: () -> Unit)
|
||||
fun BackHandler(enabled: Boolean = true, onBack: () -> Unit) = RealBackHandler(enabled, onBack)
|
||||
|
||||
@Composable
|
||||
internal expect fun RealBackHandler(enabled: Boolean, onBack: () -> Unit)
|
||||
|
||||
@@ -18,7 +18,7 @@ actual typealias ComponentRect = androidx.compose.foundation.TooltipPlacement.Co
|
||||
|
||||
@OptIn(ExperimentalFoundationApi::class)
|
||||
@Composable
|
||||
actual fun TooltipArea(
|
||||
internal actual fun RealTooltipArea(
|
||||
tooltip: @Composable () -> Unit,
|
||||
modifier: Modifier,
|
||||
delayMillis: Int,
|
||||
|
||||
@@ -40,7 +40,7 @@ actual class FileSaver(
|
||||
}
|
||||
|
||||
@Composable
|
||||
actual fun rememberFileSaver(
|
||||
internal actual fun realRememberFileSaver(
|
||||
onFileSelected: (Sink) -> Unit,
|
||||
onCancel: () -> Unit,
|
||||
onError: () -> Unit
|
||||
|
||||
@@ -9,4 +9,4 @@ package ca.gosyer.jui.ui.base.navigation
|
||||
import androidx.compose.runtime.Composable
|
||||
|
||||
@Composable
|
||||
actual fun BackHandler(enabled: Boolean, onBack: () -> Unit) {}
|
||||
internal actual fun RealBackHandler(enabled: Boolean, onBack: () -> Unit) {}
|
||||
|
||||
@@ -28,7 +28,7 @@ actual class ComponentRect actual constructor(
|
||||
) : TooltipPlacement
|
||||
|
||||
@Composable
|
||||
actual fun TooltipArea(
|
||||
internal actual fun RealTooltipArea(
|
||||
tooltip: @Composable () -> Unit,
|
||||
modifier: Modifier,
|
||||
delayMillis: Int,
|
||||
|
||||
@@ -21,7 +21,7 @@ actual class FileSaver(
|
||||
}
|
||||
|
||||
@Composable
|
||||
actual fun rememberFileSaver(
|
||||
internal actual fun realRememberFileSaver(
|
||||
onFileSelected: (Sink) -> Unit,
|
||||
onCancel: () -> Unit,
|
||||
onError: () -> Unit
|
||||
|
||||
@@ -9,4 +9,4 @@ package ca.gosyer.jui.ui.base.navigation
|
||||
import androidx.compose.runtime.Composable
|
||||
|
||||
@Composable
|
||||
actual fun BackHandler(enabled: Boolean, onBack: () -> Unit) {}
|
||||
internal actual fun RealBackHandler(enabled: Boolean, onBack: () -> Unit) {}
|
||||
|
||||
Reference in New Issue
Block a user