mirror of
https://github.com/Suwayomi/TachideskJUI.git
synced 2025-12-10 06:42:05 +01:00
No default values for expect functions 2
This commit is contained in:
@@ -12,6 +12,7 @@ import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.produceState
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import ca.gosyer.jui.core.lang.withIOContext
|
||||
import com.mikepenz.aboutlibraries.Libs
|
||||
@@ -36,7 +37,16 @@ actual fun getLicenses(): Libs? {
|
||||
return libs
|
||||
}
|
||||
|
||||
actual typealias LibraryDefaults = LibraryDefaults
|
||||
actual val LibraryDefaultsContentPadding
|
||||
get() = LibraryDefaults.ContentPadding
|
||||
|
||||
@Composable
|
||||
actual fun RealLibraryDefaultsLibraryColors(
|
||||
backgroundColor: Color,
|
||||
contentColor: Color,
|
||||
badgeBackgroundColor: Color,
|
||||
badgeContentColor: Color
|
||||
) = LibraryDefaults.libraryColors(backgroundColor, contentColor, badgeBackgroundColor, badgeContentColor)
|
||||
|
||||
actual typealias LibraryColors = LibraryColors
|
||||
|
||||
|
||||
@@ -61,17 +61,30 @@ internal expect fun InternalAboutLibraries(
|
||||
onLibraryClick: ((Library) -> Unit)?
|
||||
)
|
||||
|
||||
expect val LibraryDefaultsContentPadding: PaddingValues
|
||||
|
||||
@Composable
|
||||
fun LibraryDefaultsLibraryColors(
|
||||
backgroundColor: Color = MaterialTheme.colors.background,
|
||||
contentColor: Color = contentColorFor(backgroundColor),
|
||||
badgeBackgroundColor: Color = MaterialTheme.colors.primary,
|
||||
badgeContentColor: Color = contentColorFor(badgeBackgroundColor)
|
||||
) = RealLibraryDefaultsLibraryColors(
|
||||
backgroundColor = backgroundColor,
|
||||
contentColor = contentColor,
|
||||
badgeBackgroundColor = badgeBackgroundColor,
|
||||
badgeContentColor = badgeContentColor
|
||||
)
|
||||
|
||||
@Composable
|
||||
internal expect fun RealLibraryDefaultsLibraryColors(
|
||||
backgroundColor: Color,
|
||||
contentColor: Color,
|
||||
badgeBackgroundColor: Color,
|
||||
badgeContentColor: Color
|
||||
): LibraryColors
|
||||
|
||||
expect interface LibraryColors
|
||||
expect object LibraryDefaults {
|
||||
@Composable
|
||||
fun libraryColors(
|
||||
backgroundColor: Color = MaterialTheme.colors.background,
|
||||
contentColor: Color = contentColorFor(backgroundColor),
|
||||
badgeBackgroundColor: Color = MaterialTheme.colors.primary,
|
||||
badgeContentColor: Color = contentColorFor(badgeBackgroundColor)
|
||||
): LibraryColors
|
||||
val ContentPadding: PaddingValues
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun AboutLibraries(
|
||||
@@ -82,8 +95,8 @@ fun AboutLibraries(
|
||||
showAuthor: Boolean = true,
|
||||
showVersion: Boolean = true,
|
||||
showLicenseBadges: Boolean = true,
|
||||
colors: LibraryColors = LibraryDefaults.libraryColors(),
|
||||
itemContentPadding: PaddingValues = LibraryDefaults.ContentPadding,
|
||||
colors: LibraryColors = LibraryDefaultsLibraryColors(),
|
||||
itemContentPadding: PaddingValues = LibraryDefaultsContentPadding,
|
||||
onLibraryClick: ((Library) -> Unit)? = null
|
||||
) {
|
||||
InternalAboutLibraries(
|
||||
|
||||
@@ -12,6 +12,7 @@ import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.produceState
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import ca.gosyer.jui.core.lang.withIOContext
|
||||
import ca.gosyer.jui.i18n.MR
|
||||
import com.mikepenz.aboutlibraries.Libs
|
||||
@@ -34,7 +35,16 @@ actual fun getLicenses(): Libs? {
|
||||
return libs
|
||||
}
|
||||
|
||||
actual typealias LibraryDefaults = LibraryDefaults
|
||||
actual val LibraryDefaultsContentPadding
|
||||
get() = LibraryDefaults.ContentPadding
|
||||
|
||||
@Composable
|
||||
actual fun RealLibraryDefaultsLibraryColors(
|
||||
backgroundColor: Color,
|
||||
contentColor: Color,
|
||||
badgeBackgroundColor: Color,
|
||||
badgeContentColor: Color
|
||||
) = LibraryDefaults.libraryColors(backgroundColor, contentColor, badgeBackgroundColor, badgeContentColor)
|
||||
|
||||
actual typealias LibraryColors = LibraryColors
|
||||
|
||||
|
||||
@@ -32,17 +32,16 @@ actual fun getLicenses(): Libs? {
|
||||
return libs
|
||||
}
|
||||
|
||||
actual object LibraryDefaults {
|
||||
@Composable
|
||||
actual fun libraryColors(
|
||||
backgroundColor: Color,
|
||||
contentColor: Color,
|
||||
badgeBackgroundColor: Color,
|
||||
badgeContentColor: Color
|
||||
): LibraryColors = object : LibraryColors {}
|
||||
actual val LibraryDefaultsContentPadding
|
||||
get() = PaddingValues()
|
||||
|
||||
actual val ContentPadding: PaddingValues get() = PaddingValues()
|
||||
}
|
||||
@Composable
|
||||
actual fun RealLibraryDefaultsLibraryColors(
|
||||
backgroundColor: Color,
|
||||
contentColor: Color,
|
||||
badgeBackgroundColor: Color,
|
||||
badgeContentColor: Color
|
||||
) = object : LibraryColors {}
|
||||
|
||||
actual interface LibraryColors
|
||||
|
||||
|
||||
Reference in New Issue
Block a user