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