Browse Source

Remove internal from common public @Composable as it is not required for 1.4.0-rc03 (#3008)

pull/3009/head
Nikita Lipsky 2 years ago committed by GitHub
parent
commit
1d955a2e6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      examples/chat/gradle.properties
  2. 6
      examples/chat/shared/src/commonMain/kotlin/ChatApp.kt
  3. 2
      examples/chat/shared/src/commonMain/kotlin/SendMessage.kt
  4. 4
      examples/codeviewer/gradle.properties
  5. 2
      examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/platform/Resources.kt
  6. 4
      examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/platform/Scrollbar.kt
  7. 2
      examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/ui/CodeViewerView.kt
  8. 2
      examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/ui/MainView.kt
  9. 2
      examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/ui/common/Fonts.kt
  10. 2
      examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/ui/editor/EditorEmptyView.kt
  11. 4
      examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/ui/editor/EditorTabsView.kt
  12. 2
      examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/ui/editor/EditorView.kt
  13. 4
      examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/ui/filetree/FileTreeView.kt
  14. 2
      examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/ui/statusbar/StatusBar.kt
  15. 4
      examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/util/Loadable.kt
  16. 4
      examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/util/VerticalSplittable.kt
  17. 2
      examples/codeviewer/shared/src/iosMain/kotlin/org/jetbrains/codeviewer/platform/Resources.kt
  18. 4
      examples/codeviewer/shared/src/iosMain/kotlin/org/jetbrains/codeviewer/platform/Scrollbar.kt
  19. 4
      examples/falling-balls/gradle.properties
  20. 2
      examples/falling-balls/shared/src/commonMain/kotlin/bouncingBalls/BouncingBalls.kt
  21. 2
      examples/falling-balls/shared/src/commonMain/kotlin/fallingBalls/FallingBalls.kt
  22. 2
      examples/falling-balls/shared/src/commonMain/kotlin/fallingBalls/Piece.kt
  23. 4
      examples/imageviewer/gradle.properties
  24. 2
      examples/imageviewer/shared/src/androidMain/kotlin/example/imageviewer/filter/BitmapFilter.android.kt
  25. 2
      examples/imageviewer/shared/src/androidMain/kotlin/example/imageviewer/view/CameraView.android.kt
  26. 2
      examples/imageviewer/shared/src/androidMain/kotlin/example/imageviewer/view/EditMemoryDialog.android.kt
  27. 2
      examples/imageviewer/shared/src/androidMain/kotlin/example/imageviewer/view/LocationVisualizer.android.kt
  28. 2
      examples/imageviewer/shared/src/androidMain/kotlin/example/imageviewer/view/ScrollableColumn.android.kt
  29. 2
      examples/imageviewer/shared/src/androidMain/kotlin/example/imageviewer/view/Tooltip.android.kt
  30. 2
      examples/imageviewer/shared/src/androidMain/kotlin/example/imageviewer/view/ZoomControllerView.android.kt
  31. 4
      examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/ImageViewer.common.kt
  32. 2
      examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/NameAndDescription.common.kt
  33. 2
      examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/filter/BitmapFilter.common.kt
  34. 2
      examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/style/Palette.kt
  35. 2
      examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/CameraScreen.kt
  36. 2
      examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/CameraView.common.kt
  37. 6
      examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/CircularButton.kt
  38. 2
      examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/EditMemoryDialog.common.kt
  39. 2
      examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/FullscreenImageScreen.kt
  40. 4
      examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/GalleryScreen.kt
  41. 2
      examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/LocationVisualizer.common.kt
  42. 14
      examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/MemoryScreen.kt
  43. 2
      examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/ScalableImage.common.kt
  44. 4
      examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/ScrollableColumn.common.kt
  45. 2
      examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/Thumbnail.kt
  46. 2
      examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/ThumbnailImage.kt
  47. 2
      examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/Toast.kt
  48. 2
      examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/Tooltip.common.kt
  49. 2
      examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/TopLayout.kt
  50. 2
      examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/ZoomControllerView.common.kt
  51. 4
      examples/imageviewer/shared/src/desktopMain/kotlin/example/imageviewer/filter/BitmapFilter.desktop.kt
  52. 2
      examples/imageviewer/shared/src/desktopMain/kotlin/example/imageviewer/view/CameraView.desktop.kt
  53. 2
      examples/imageviewer/shared/src/desktopMain/kotlin/example/imageviewer/view/EditMemoryDialog.desktop.kt
  54. 2
      examples/imageviewer/shared/src/desktopMain/kotlin/example/imageviewer/view/LocationVisualizer.desktop.kt
  55. 2
      examples/imageviewer/shared/src/desktopMain/kotlin/example/imageviewer/view/ScrollableColumn.desktop.kt
  56. 2
      examples/imageviewer/shared/src/desktopMain/kotlin/example/imageviewer/view/Tooltip.desktop.kt
  57. 2
      examples/imageviewer/shared/src/desktopMain/kotlin/example/imageviewer/view/ZoomControllerView.desktop.kt
  58. 2
      examples/imageviewer/shared/src/iosMain/kotlin/example/imageviewer/filter/BitmapFilter.ios.kt
  59. 2
      examples/imageviewer/shared/src/iosMain/kotlin/example/imageviewer/view/CameraView.ios.kt
  60. 2
      examples/imageviewer/shared/src/iosMain/kotlin/example/imageviewer/view/EditMemoryDialog.ios.kt
  61. 2
      examples/imageviewer/shared/src/iosMain/kotlin/example/imageviewer/view/LocationVisualizer.ios.kt
  62. 2
      examples/imageviewer/shared/src/iosMain/kotlin/example/imageviewer/view/ScrollableColumn.ios.kt
  63. 2
      examples/imageviewer/shared/src/iosMain/kotlin/example/imageviewer/view/Tooltip.ios.kt
  64. 2
      examples/imageviewer/shared/src/iosMain/kotlin/example/imageviewer/view/ZoomControllerView.ios.kt
  65. 4
      examples/minesweeper/gradle.properties
  66. 2
      examples/minesweeper/shared/src/commonMain/kotlin/BoardView.kt
  67. 4
      examples/minesweeper/shared/src/commonMain/kotlin/game.kt
  68. 2
      examples/minesweeper/shared/src/commonMain/kotlin/gameInteraction.kt
  69. 12
      examples/minesweeper/shared/src/commonMain/kotlin/widgets.kt
  70. 4
      examples/todoapp-lite/gradle.properties
  71. 2
      examples/todoapp-lite/shared/src/commonMain/kotlin/example/todoapp/lite/common/RootContent.kt
  72. 4
      examples/visual-effects/gradle.properties
  73. 6
      examples/visual-effects/shared/src/commonMain/kotlin/AllSamlesView.kt
  74. 18
      examples/visual-effects/shared/src/commonMain/kotlin/HappyNY.kt
  75. 10
      examples/visual-effects/shared/src/commonMain/kotlin/RotatingWords.kt
  76. 6
      examples/visual-effects/shared/src/commonMain/kotlin/WaveEffect.kt
  77. 4
      examples/widgets-gallery/gradle.properties
  78. 4
      examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/platform/Scrollbar.kt
  79. 2
      examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/platform/System.kt
  80. 2
      examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/theme/Theme.kt
  81. 4
      examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/ui/MainView.kt
  82. 2
      examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/ui/WidgetView.kt
  83. 2
      examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/ui/screens/AppBars.kt
  84. 2
      examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/ui/screens/Buttons.kt
  85. 2
      examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/ui/screens/Chips.kt
  86. 2
      examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/ui/screens/Loaders.kt
  87. 2
      examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/ui/screens/SnackBars.kt
  88. 2
      examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/ui/screens/TextInputs.kt
  89. 2
      examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/ui/screens/Texts.kt
  90. 2
      examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/ui/screens/Toggles.kt
  91. 2
      examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/ui/screens/UICards.kt
  92. 2
      examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/ui/utils/ResizablePanel.kt
  93. 4
      examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/ui/utils/Text.kt
  94. 4
      examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/ui/utils/VerticalSplittable.kt
  95. 4
      examples/widgets-gallery/shared/src/iosMain/kotlin/org/jetbrains/compose/demo/widgets/platform/Scrollbar.kt
  96. 2
      examples/widgets-gallery/shared/src/iosMain/kotlin/org/jetbrains/compose/demo/widgets/platform/System.kt

4
examples/chat/gradle.properties

@ -11,6 +11,6 @@ kotlin.native.useEmbeddableCompilerJar=true
kotlin.mpp.androidSourceSetLayoutVersion=2 kotlin.mpp.androidSourceSetLayoutVersion=2
# Enable kotlin/native experimental memory model # Enable kotlin/native experimental memory model
kotlin.native.binary.memoryModel=experimental kotlin.native.binary.memoryModel=experimental
kotlin.version=1.8.0 kotlin.version=1.8.20
agp.version=7.1.3 agp.version=7.1.3
compose.version=1.4.0-rc01 compose.version=1.4.0-rc03

6
examples/chat/shared/src/commonMain/kotlin/ChatApp.kt

@ -18,7 +18,7 @@ val friendMessages = listOf(
val store = CoroutineScope(SupervisorJob()).createStore() val store = CoroutineScope(SupervisorJob()).createStore()
@Composable @Composable
internal fun ChatAppWithScaffold(displayTextField: Boolean = true) { fun ChatAppWithScaffold(displayTextField: Boolean = true) {
Theme { Theme {
Scaffold( Scaffold(
topBar = { topBar = {
@ -33,7 +33,7 @@ internal fun ChatAppWithScaffold(displayTextField: Boolean = true) {
} }
@Composable @Composable
internal fun ChatApp(displayTextField: Boolean = true) { fun ChatApp(displayTextField: Boolean = true) {
val state by store.stateFlow.collectAsState() val state by store.stateFlow.collectAsState()
Theme { Theme {
Surface { Surface {
@ -74,7 +74,7 @@ internal fun ChatApp(displayTextField: Boolean = true) {
} }
@Composable @Composable
internal fun Theme(content: @Composable () -> Unit) { fun Theme(content: @Composable () -> Unit) {
MaterialTheme( MaterialTheme(
colors = darkColors( colors = darkColors(
surface = Color(ChatColors.SURFACE), surface = Color(ChatColors.SURFACE),

2
examples/chat/shared/src/commonMain/kotlin/SendMessage.kt

@ -17,7 +17,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
@Composable @Composable
internal fun SendMessage(sendMessage: (String) -> Unit) { fun SendMessage(sendMessage: (String) -> Unit) {
var inputText by remember { mutableStateOf("") } var inputText by remember { mutableStateOf("") }
TextField( TextField(
modifier = Modifier.fillMaxWidth() modifier = Modifier.fillMaxWidth()

4
examples/codeviewer/gradle.properties

@ -11,6 +11,6 @@ kotlin.native.useEmbeddableCompilerJar=true
kotlin.mpp.androidSourceSetLayoutVersion=2 kotlin.mpp.androidSourceSetLayoutVersion=2
# Enable kotlin/native experimental memory model # Enable kotlin/native experimental memory model
kotlin.native.binary.memoryModel=experimental kotlin.native.binary.memoryModel=experimental
kotlin.version=1.8.0 kotlin.version=1.8.20
agp.version=7.1.3 agp.version=7.1.3
compose.version=1.4.0-rc01 compose.version=1.4.0-rc03

2
examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/platform/Resources.kt

@ -6,4 +6,4 @@ import androidx.compose.ui.text.font.FontStyle
import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.font.FontWeight
@Composable @Composable
internal expect fun font(name: String, res: String, weight: FontWeight, style: FontStyle): Font expect fun font(name: String, res: String, weight: FontWeight, style: FontStyle): Font

4
examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/platform/Scrollbar.kt

@ -7,13 +7,13 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.Dp
@Composable @Composable
internal expect fun VerticalScrollbar( expect fun VerticalScrollbar(
modifier: Modifier, modifier: Modifier,
scrollState: ScrollState scrollState: ScrollState
) )
@Composable @Composable
internal expect fun VerticalScrollbar( expect fun VerticalScrollbar(
modifier: Modifier, modifier: Modifier,
scrollState: LazyListState scrollState: LazyListState
) )

2
examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/ui/CodeViewerView.kt

@ -26,7 +26,7 @@ import org.jetbrains.codeviewer.util.SplitterState
import org.jetbrains.codeviewer.util.VerticalSplittable import org.jetbrains.codeviewer.util.VerticalSplittable
@Composable @Composable
internal fun CodeViewerView(model: CodeViewer) { fun CodeViewerView(model: CodeViewer) {
val panelState = remember { PanelState() } val panelState = remember { PanelState() }
val animatedSize = if (panelState.splitter.isResizing) { val animatedSize = if (panelState.splitter.isResizing) {

2
examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/ui/MainView.kt

@ -12,7 +12,7 @@ import org.jetbrains.codeviewer.ui.editor.Editors
import org.jetbrains.codeviewer.ui.filetree.FileTree import org.jetbrains.codeviewer.ui.filetree.FileTree
@Composable @Composable
internal fun MainView() { fun MainView() {
val codeViewer = remember { val codeViewer = remember {
val editors = Editors() val editors = Editors()

2
examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/ui/common/Fonts.kt

@ -8,7 +8,7 @@ import org.jetbrains.codeviewer.platform.font
object Fonts { object Fonts {
@Composable @Composable
internal fun jetbrainsMono() = FontFamily( fun jetbrainsMono() = FontFamily(
font( font(
"JetBrains Mono", "JetBrains Mono",
"jetbrainsmono_regular", "jetbrainsmono_regular",

2
examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/ui/editor/EditorEmptyView.kt

@ -16,7 +16,7 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
@Composable @Composable
internal fun EditorEmptyView() = Box(Modifier.fillMaxSize()) { fun EditorEmptyView() = Box(Modifier.fillMaxSize()) {
Column(Modifier.align(Alignment.Center)) { Column(Modifier.align(Alignment.Center)) {
Icon( Icon(
Icons.Default.Code, Icons.Default.Code,

4
examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/ui/editor/EditorTabsView.kt

@ -24,14 +24,14 @@ import androidx.compose.ui.unit.sp
import org.jetbrains.codeviewer.ui.common.AppTheme import org.jetbrains.codeviewer.ui.common.AppTheme
@Composable @Composable
internal fun EditorTabsView(model: Editors) = Row(Modifier.horizontalScroll(rememberScrollState())) { fun EditorTabsView(model: Editors) = Row(Modifier.horizontalScroll(rememberScrollState())) {
for (editor in model.editors) { for (editor in model.editors) {
EditorTabView(editor) EditorTabView(editor)
} }
} }
@Composable @Composable
internal fun EditorTabView(model: Editor) = Surface( fun EditorTabView(model: Editor) = Surface(
color = if (model.isActive) { color = if (model.isActive) {
AppTheme.colors.backgroundDark AppTheme.colors.backgroundDark
} else { } else {

2
examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/ui/editor/EditorView.kt

@ -32,7 +32,7 @@ import org.jetbrains.codeviewer.util.withoutWidthConstraints
import kotlin.text.Regex.Companion.fromLiteral import kotlin.text.Regex.Companion.fromLiteral
@Composable @Composable
internal fun EditorView(model: Editor, settings: Settings) = key(model) { fun EditorView(model: Editor, settings: Settings) = key(model) {
with (LocalDensity.current) { with (LocalDensity.current) {
SelectionContainer { SelectionContainer {
Surface( Surface(

4
examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/ui/filetree/FileTreeView.kt

@ -31,7 +31,7 @@ import org.jetbrains.codeviewer.platform.VerticalScrollbar
import org.jetbrains.codeviewer.util.withoutWidthConstraints import org.jetbrains.codeviewer.util.withoutWidthConstraints
@Composable @Composable
internal fun FileTreeViewTabView() = Surface { fun FileTreeViewTabView() = Surface {
Row( Row(
Modifier.padding(8.dp), Modifier.padding(8.dp),
verticalAlignment = Alignment.CenterVertically verticalAlignment = Alignment.CenterVertically
@ -46,7 +46,7 @@ internal fun FileTreeViewTabView() = Surface {
} }
@Composable @Composable
internal fun FileTreeView(model: FileTree) = Surface( fun FileTreeView(model: FileTree) = Surface(
modifier = Modifier.fillMaxSize() modifier = Modifier.fillMaxSize()
) { ) {
with(LocalDensity.current) { with(LocalDensity.current) {

2
examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/ui/statusbar/StatusBar.kt

@ -16,7 +16,7 @@ private val MinFontSize = 6.sp
private val MaxFontSize = 40.sp private val MaxFontSize = 40.sp
@Composable @Composable
internal fun StatusBar(settings: Settings) = Box( fun StatusBar(settings: Settings) = Box(
Modifier Modifier
.height(32.dp) .height(32.dp)
.fillMaxWidth() .fillMaxWidth()

4
examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/util/Loadable.kt

@ -5,14 +5,14 @@ import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
@Composable @Composable
internal fun <T : Any> loadable(load: () -> T): MutableState<T?> { fun <T : Any> loadable(load: () -> T): MutableState<T?> {
return loadableScoped { load() } return loadableScoped { load() }
} }
private val loadingKey = Any() private val loadingKey = Any()
@Composable @Composable
internal fun <T : Any> loadableScoped(load: CoroutineScope.() -> T): MutableState<T?> { fun <T : Any> loadableScoped(load: CoroutineScope.() -> T): MutableState<T?> {
val state: MutableState<T?> = remember { mutableStateOf(null) } val state: MutableState<T?> = remember { mutableStateOf(null) }
LaunchedEffect(loadingKey) { LaunchedEffect(loadingKey) {
try { try {

4
examples/codeviewer/shared/src/commonMain/kotlin/org/jetbrains/codeviewer/util/VerticalSplittable.kt

@ -22,7 +22,7 @@ import org.jetbrains.codeviewer.platform.cursorForHorizontalResize
import org.jetbrains.codeviewer.ui.common.AppTheme import org.jetbrains.codeviewer.ui.common.AppTheme
@Composable @Composable
internal fun VerticalSplittable( fun VerticalSplittable(
modifier: Modifier, modifier: Modifier,
splitterState: SplitterState, splitterState: SplitterState,
onResize: (delta: Dp) -> Unit, onResize: (delta: Dp) -> Unit,
@ -57,7 +57,7 @@ class SplitterState {
} }
@Composable @Composable
internal fun VerticalSplitter( fun VerticalSplitter(
splitterState: SplitterState, splitterState: SplitterState,
onResize: (delta: Dp) -> Unit, onResize: (delta: Dp) -> Unit,
color: Color = AppTheme.colors.backgroundDark color: Color = AppTheme.colors.backgroundDark

2
examples/codeviewer/shared/src/iosMain/kotlin/org/jetbrains/codeviewer/platform/Resources.kt

@ -13,7 +13,7 @@ private val cache: MutableMap<String, Font> = mutableMapOf()
@OptIn(ExperimentalResourceApi::class) @OptIn(ExperimentalResourceApi::class)
@Composable @Composable
internal actual fun font(name: String, res: String, weight: FontWeight, style: FontStyle): Font { actual fun font(name: String, res: String, weight: FontWeight, style: FontStyle): Font {
return cache.getOrPut(res) { return cache.getOrPut(res) {
val byteArray = runBlocking { val byteArray = runBlocking {
resource("font/$res.ttf").readBytes() resource("font/$res.ttf").readBytes()

4
examples/codeviewer/shared/src/iosMain/kotlin/org/jetbrains/codeviewer/platform/Scrollbar.kt

@ -6,13 +6,13 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
@Composable @Composable
internal actual fun VerticalScrollbar( actual fun VerticalScrollbar(
modifier: Modifier, modifier: Modifier,
scrollState: ScrollState scrollState: ScrollState
) = Unit ) = Unit
@Composable @Composable
internal actual fun VerticalScrollbar( actual fun VerticalScrollbar(
modifier: Modifier, modifier: Modifier,
scrollState: LazyListState scrollState: LazyListState
) = Unit ) = Unit

4
examples/falling-balls/gradle.properties

@ -11,6 +11,6 @@ kotlin.native.useEmbeddableCompilerJar=true
kotlin.mpp.androidSourceSetLayoutVersion=2 kotlin.mpp.androidSourceSetLayoutVersion=2
# Enable kotlin/native experimental memory model # Enable kotlin/native experimental memory model
kotlin.native.binary.memoryModel=experimental kotlin.native.binary.memoryModel=experimental
kotlin.version=1.8.0 kotlin.version=1.8.20
agp.version=7.1.3 agp.version=7.1.3
compose.version=1.4.0-rc01 compose.version=1.4.0-rc03

2
examples/falling-balls/shared/src/commonMain/kotlin/bouncingBalls/BouncingBalls.kt

@ -43,7 +43,7 @@ private var areaWidth = 0
private var areaHeight = 0 private var areaHeight = 0
@Composable @Composable
internal fun BouncingBallsApp(initialBallsCount: Int = 5) { fun BouncingBallsApp(initialBallsCount: Int = 5) {
val items = remember { val items = remember {
val list = mutableStateListOf<BouncingBall>() val list = mutableStateListOf<BouncingBall>()
list.addAll(generateSequence { list.addAll(generateSequence {

2
examples/falling-balls/shared/src/commonMain/kotlin/fallingBalls/FallingBalls.kt

@ -15,7 +15,7 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
@Composable @Composable
internal fun FallingBalls(game: Game) { fun FallingBalls(game: Game) {
val density = LocalDensity.current val density = LocalDensity.current
Column { Column {
Text( Text(

2
examples/falling-balls/shared/src/commonMain/kotlin/fallingBalls/Piece.kt

@ -20,7 +20,7 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
@Composable @Composable
internal fun Piece(index: Int, piece: PieceData) { fun Piece(index: Int, piece: PieceData) {
val boxSize = 40.dp val boxSize = 40.dp
Box( Box(
Modifier Modifier

4
examples/imageviewer/gradle.properties

@ -11,6 +11,6 @@ kotlin.mpp.androidSourceSetLayoutVersion=2
kotlin.native.useEmbeddableCompilerJar=true kotlin.native.useEmbeddableCompilerJar=true
# Enable kotlin/native experimental memory model # Enable kotlin/native experimental memory model
kotlin.native.binary.memoryModel=experimental kotlin.native.binary.memoryModel=experimental
kotlin.version=1.8.10 kotlin.version=1.8.20
agp.version=7.1.3 agp.version=7.1.3
compose.version=1.4.0-rc01 compose.version=1.4.0-rc03

2
examples/imageviewer/shared/src/androidMain/kotlin/example/imageviewer/filter/BitmapFilter.android.kt

@ -27,7 +27,7 @@ actual fun blurFilter(bitmap: ImageBitmap, context: PlatformContext): ImageBitma
actual class PlatformContext(val androidContext: Context) actual class PlatformContext(val androidContext: Context)
@Composable @Composable
internal actual fun getPlatformContext(): PlatformContext = PlatformContext(LocalContext.current) actual fun getPlatformContext(): PlatformContext = PlatformContext(LocalContext.current)
private fun applyBlurFilter(bitmap: Bitmap, context: Context): Bitmap { private fun applyBlurFilter(bitmap: Bitmap, context: Context): Bitmap {

2
examples/imageviewer/shared/src/androidMain/kotlin/example/imageviewer/view/CameraView.android.kt

@ -48,7 +48,7 @@ private val executor = Executors.newSingleThreadExecutor()
@OptIn(ExperimentalPermissionsApi::class) @OptIn(ExperimentalPermissionsApi::class)
@Composable @Composable
internal actual fun CameraView( actual fun CameraView(
modifier: Modifier, modifier: Modifier,
onCapture: (picture: PictureData.Camera, image: PlatformStorableImage) -> Unit onCapture: (picture: PictureData.Camera, image: PlatformStorableImage) -> Unit
) { ) {

2
examples/imageviewer/shared/src/androidMain/kotlin/example/imageviewer/view/EditMemoryDialog.android.kt

@ -27,7 +27,7 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
@Composable @Composable
internal actual fun BoxScope.EditMemoryDialog( actual fun BoxScope.EditMemoryDialog(
previousName: String, previousName: String,
previousDescription: String, previousDescription: String,
save: (name: String, description: String) -> Unit save: (name: String, description: String) -> Unit

2
examples/imageviewer/shared/src/androidMain/kotlin/example/imageviewer/view/LocationVisualizer.android.kt

@ -9,7 +9,7 @@ import com.google.maps.android.compose.rememberCameraPositionState
import example.imageviewer.model.GpsPosition import example.imageviewer.model.GpsPosition
@Composable @Composable
internal actual fun LocationVisualizer(modifier: Modifier, gps: GpsPosition, title: String) { actual fun LocationVisualizer(modifier: Modifier, gps: GpsPosition, title: String) {
val currentLocation = LatLng(gps.latitude, gps.longitude) val currentLocation = LatLng(gps.latitude, gps.longitude)
val cameraPositionState = rememberCameraPositionState { val cameraPositionState = rememberCameraPositionState {
position = CameraPosition.fromLatLngZoom(currentLocation, 10f) position = CameraPosition.fromLatLngZoom(currentLocation, 10f)

2
examples/imageviewer/shared/src/androidMain/kotlin/example/imageviewer/view/ScrollableColumn.android.kt

@ -4,5 +4,5 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
@Composable @Composable
internal actual fun ScrollableColumn(modifier: Modifier, content: @Composable () -> Unit) = actual fun ScrollableColumn(modifier: Modifier, content: @Composable () -> Unit) =
TouchScrollableColumn(modifier, content) TouchScrollableColumn(modifier, content)

2
examples/imageviewer/shared/src/androidMain/kotlin/example/imageviewer/view/Tooltip.android.kt

@ -4,7 +4,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
@Composable @Composable
internal actual fun Tooltip( actual fun Tooltip(
text: String, text: String,
content: @Composable () -> Unit content: @Composable () -> Unit
) { ) {

2
examples/imageviewer/shared/src/androidMain/kotlin/example/imageviewer/view/ZoomControllerView.android.kt

@ -6,6 +6,6 @@ import example.imageviewer.model.ScalableState
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
@Composable @Composable
internal actual fun ZoomControllerView(modifier: Modifier, scalableState: ScalableState) { actual fun ZoomControllerView(modifier: Modifier, scalableState: ScalableState) {
// No need for additional ZoomControllerView for Android // No need for additional ZoomControllerView for Android
} }

4
examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/ImageViewer.common.kt

@ -14,7 +14,7 @@ enum class ExternalImageViewerEvent {
} }
@Composable @Composable
internal fun ImageViewerCommon( fun ImageViewerCommon(
dependencies: Dependencies dependencies: Dependencies
) { ) {
CompositionLocalProvider( CompositionLocalProvider(
@ -30,7 +30,7 @@ internal fun ImageViewerCommon(
@OptIn(ExperimentalAnimationApi::class) @OptIn(ExperimentalAnimationApi::class)
@Composable @Composable
internal fun ImageViewerWithProvidedDependencies( fun ImageViewerWithProvidedDependencies(
pictures: SnapshotStateList<PictureData> pictures: SnapshotStateList<PictureData>
) { ) {
val selectedPictureIndex = remember { mutableStateOf(0) } val selectedPictureIndex = remember { mutableStateOf(0) }

2
examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/NameAndDescription.common.kt

@ -10,7 +10,7 @@ class NameAndDescription(
) )
@Composable @Composable
internal fun createNewPhotoNameAndDescription(): NameAndDescription { fun createNewPhotoNameAndDescription(): NameAndDescription {
val localization = LocalLocalization.current val localization = LocalLocalization.current
return remember { return remember {

2
examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/filter/BitmapFilter.common.kt

@ -17,4 +17,4 @@ expect fun blurFilter(bitmap: ImageBitmap, context: PlatformContext): ImageBitma
expect class PlatformContext expect class PlatformContext
@Composable @Composable
internal expect fun getPlatformContext(): PlatformContext expect fun getPlatformContext(): PlatformContext

2
examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/style/Palette.kt

@ -48,7 +48,7 @@ object ImageviewerColors {
} }
@Composable @Composable
internal fun ImageViewerTheme(content: @Composable () -> Unit) { fun ImageViewerTheme(content: @Composable () -> Unit) {
isSystemInDarkTheme() // todo check and change colors isSystemInDarkTheme() // todo check and change colors
MaterialTheme( MaterialTheme(
colors = MaterialTheme.colors.copy( colors = MaterialTheme.colors.copy(

2
examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/CameraScreen.kt

@ -10,7 +10,7 @@ import example.imageviewer.LocalImageProvider
import kotlinx.coroutines.delay import kotlinx.coroutines.delay
@Composable @Composable
internal fun CameraScreen(onBack: (resetSelectedPicture: Boolean) -> Unit) { fun CameraScreen(onBack: (resetSelectedPicture: Boolean) -> Unit) {
val imageProvider = LocalImageProvider.current val imageProvider = LocalImageProvider.current
var showCamera by remember { mutableStateOf(false) } var showCamera by remember { mutableStateOf(false) }
LaunchedEffect(onBack) { LaunchedEffect(onBack) {

2
examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/CameraView.common.kt

@ -7,4 +7,4 @@ import example.imageviewer.PlatformStorableImage
import example.imageviewer.model.PictureData import example.imageviewer.model.PictureData
@Composable @Composable
internal expect fun CameraView(modifier: Modifier, onCapture: (picture: PictureData.Camera, image: PlatformStorableImage)->Unit) expect fun CameraView(modifier: Modifier, onCapture: (picture: PictureData.Camera, image: PlatformStorableImage)->Unit)

6
examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/CircularButton.kt

@ -18,7 +18,7 @@ import example.imageviewer.icon.IconCustomArrowBack
import example.imageviewer.style.ImageviewerColors import example.imageviewer.style.ImageviewerColors
@Composable @Composable
internal fun CircularButton( fun CircularButton(
content: @Composable () -> Unit, content: @Composable () -> Unit,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
enabled: Boolean, enabled: Boolean,
@ -41,7 +41,7 @@ internal fun CircularButton(
} }
@Composable @Composable
internal fun CircularButton( fun CircularButton(
imageVector: ImageVector, imageVector: ImageVector,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
enabled: Boolean = true, enabled: Boolean = true,
@ -58,7 +58,7 @@ internal fun CircularButton(
} }
@Composable @Composable
internal fun BackButton(onClick: () -> Unit) { fun BackButton(onClick: () -> Unit) {
Tooltip(LocalLocalization.current.back) { Tooltip(LocalLocalization.current.back) {
CircularButton( CircularButton(
imageVector = IconCustomArrowBack, imageVector = IconCustomArrowBack,

2
examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/EditMemoryDialog.common.kt

@ -4,7 +4,7 @@ import androidx.compose.foundation.layout.BoxScope
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
@Composable @Composable
internal expect fun BoxScope.EditMemoryDialog( expect fun BoxScope.EditMemoryDialog(
previousName: String, previousName: String,
previousDescription: String, previousDescription: String,
save: (name: String, description: String) -> Unit save: (name: String, description: String) -> Unit

2
examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/FullscreenImageScreen.kt

@ -25,7 +25,7 @@ import example.imageviewer.model.*
import example.imageviewer.style.* import example.imageviewer.style.*
@Composable @Composable
internal fun FullscreenImageScreen( fun FullscreenImageScreen(
picture: PictureData, picture: PictureData,
back: () -> Unit, back: () -> Unit,
) { ) {

4
examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/GalleryScreen.kt

@ -47,7 +47,7 @@ enum class GalleryStyle {
@OptIn(ExperimentalFoundationApi::class) @OptIn(ExperimentalFoundationApi::class)
@Composable @Composable
internal fun GalleryScreen( fun GalleryScreen(
pictures: SnapshotStateList<PictureData>, pictures: SnapshotStateList<PictureData>,
selectedPictureIndex: MutableState<Int>, selectedPictureIndex: MutableState<Int>,
onClickPreviewPicture: (PictureData) -> Unit, onClickPreviewPicture: (PictureData) -> Unit,
@ -195,7 +195,7 @@ private fun SquaresGalleryView(
} }
@Composable @Composable
internal fun SquareThumbnail( fun SquareThumbnail(
picture: PictureData, picture: PictureData,
isHighlighted: Boolean, isHighlighted: Boolean,
onClick: () -> Unit onClick: () -> Unit

2
examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/LocationVisualizer.common.kt

@ -5,4 +5,4 @@ import androidx.compose.ui.Modifier
import example.imageviewer.model.GpsPosition import example.imageviewer.model.GpsPosition
@Composable @Composable
internal expect fun LocationVisualizer(modifier: Modifier, gps: GpsPosition, title: String) expect fun LocationVisualizer(modifier: Modifier, gps: GpsPosition, title: String)

14
examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/MemoryScreen.kt

@ -41,7 +41,7 @@ import org.jetbrains.compose.resources.ExperimentalResourceApi
import org.jetbrains.compose.resources.painterResource import org.jetbrains.compose.resources.painterResource
@Composable @Composable
internal fun MemoryScreen( fun MemoryScreen(
pictures: SnapshotStateList<PictureData>, pictures: SnapshotStateList<PictureData>,
memoryPage: MemoryPage, memoryPage: MemoryPage,
onSelectRelatedMemory: (PictureData) -> Unit, onSelectRelatedMemory: (PictureData) -> Unit,
@ -181,7 +181,7 @@ private fun MemoryHeader(bitmap: ImageBitmap, picture: PictureData, onClick: ()
@OptIn(ExperimentalResourceApi::class) @OptIn(ExperimentalResourceApi::class)
@Composable @Composable
internal fun BoxScope.MagicButtonOverlay(onClick: () -> Unit) { fun BoxScope.MagicButtonOverlay(onClick: () -> Unit) {
Column( Column(
modifier = Modifier.align(Alignment.BottomEnd).padding(12.dp) modifier = Modifier.align(Alignment.BottomEnd).padding(12.dp)
) { ) {
@ -193,7 +193,7 @@ internal fun BoxScope.MagicButtonOverlay(onClick: () -> Unit) {
} }
@Composable @Composable
internal fun BoxScope.MemoryTextOverlay(picture: PictureData) { fun BoxScope.MemoryTextOverlay(picture: PictureData) {
val shadowTextStyle = LocalTextStyle.current.copy( val shadowTextStyle = LocalTextStyle.current.copy(
shadow = Shadow( shadow = Shadow(
color = Color.Black.copy(0.75f), color = Color.Black.copy(0.75f),
@ -228,7 +228,7 @@ internal fun BoxScope.MemoryTextOverlay(picture: PictureData) {
} }
@Composable @Composable
internal fun Collapsible(s: String) { fun Collapsible(s: String) {
val interctionSource = remember { MutableInteractionSource() } val interctionSource = remember { MutableInteractionSource() }
var isCollapsed by remember { mutableStateOf(true) } var isCollapsed by remember { mutableStateOf(true) }
val text = if (isCollapsed) s.lines().first() + "... (see more)" else s val text = if (isCollapsed) s.lines().first() + "... (see more)" else s
@ -254,7 +254,7 @@ internal fun Collapsible(s: String) {
} }
@Composable @Composable
internal fun Headliner(s: String) { fun Headliner(s: String) {
Text( Text(
text = s, text = s,
fontWeight = FontWeight.SemiBold, fontWeight = FontWeight.SemiBold,
@ -265,7 +265,7 @@ internal fun Headliner(s: String) {
} }
@Composable @Composable
internal fun RelatedMemoriesVisualizer( fun RelatedMemoriesVisualizer(
pictures: List<PictureData>, pictures: List<PictureData>,
onSelectRelatedMemory: (PictureData) -> Unit onSelectRelatedMemory: (PictureData) -> Unit
) { ) {
@ -284,7 +284,7 @@ internal fun RelatedMemoriesVisualizer(
} }
@Composable @Composable
internal fun RelatedMemory( fun RelatedMemory(
galleryEntry: PictureData, galleryEntry: PictureData,
onSelectRelatedMemory: (PictureData) -> Unit onSelectRelatedMemory: (PictureData) -> Unit
) { ) {

2
examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/ScalableImage.common.kt

@ -31,7 +31,7 @@ private const val INITIAL_ZOOM = 1.0f
private const val SLIGHTLY_INCREASED_ZOOM = 1.5f private const val SLIGHTLY_INCREASED_ZOOM = 1.5f
@Composable @Composable
internal fun ScalableImage(scalableState: ScalableState, image: ImageBitmap, modifier: Modifier = Modifier) { fun ScalableImage(scalableState: ScalableState, image: ImageBitmap, modifier: Modifier = Modifier) {
BoxWithConstraints { BoxWithConstraints {
val areaSize = areaSize val areaSize = areaSize
val imageSize = image.size val imageSize = image.size

4
examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/ScrollableColumn.common.kt

@ -7,10 +7,10 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
@Composable @Composable
internal expect fun ScrollableColumn(modifier: Modifier, content: @Composable () -> Unit) expect fun ScrollableColumn(modifier: Modifier, content: @Composable () -> Unit)
@Composable @Composable
internal fun TouchScrollableColumn(modifier: Modifier, content: @Composable () -> Unit) { fun TouchScrollableColumn(modifier: Modifier, content: @Composable () -> Unit) {
val scrollState = rememberScrollState() val scrollState = rememberScrollState()
Column(modifier.verticalScroll(scrollState)) { Column(modifier.verticalScroll(scrollState)) {
content() content()

2
examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/Thumbnail.kt

@ -26,7 +26,7 @@ import example.imageviewer.icon.IconMoreVert
import example.imageviewer.model.PictureData import example.imageviewer.model.PictureData
@Composable @Composable
internal fun Thumbnail( fun Thumbnail(
picture: PictureData, picture: PictureData,
onClickSelect: () -> Unit, onClickSelect: () -> Unit,
onClickFullScreen: () -> Unit, onClickFullScreen: () -> Unit,

2
examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/ThumbnailImage.kt

@ -9,7 +9,7 @@ import example.imageviewer.LocalImageProvider
import example.imageviewer.model.PictureData import example.imageviewer.model.PictureData
@Composable @Composable
internal fun ThumbnailImage( fun ThumbnailImage(
modifier: Modifier, modifier: Modifier,
picture: PictureData, picture: PictureData,
filter: (ImageBitmap) -> ImageBitmap = remember { { it } }, filter: (ImageBitmap) -> ImageBitmap = remember { { it } },

2
examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/Toast.kt

@ -24,7 +24,7 @@ sealed interface ToastState {
} }
@Composable @Composable
internal fun Toast( fun Toast(
state: MutableState<ToastState> state: MutableState<ToastState>
) { ) {
val value = state.value val value = state.value

2
examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/Tooltip.common.kt

@ -4,7 +4,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
@Composable @Composable
internal expect fun Tooltip( expect fun Tooltip(
text: String, text: String,
content: @Composable () -> Unit content: @Composable () -> Unit
) )

2
examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/TopLayout.kt

@ -11,7 +11,7 @@ import androidx.compose.ui.unit.dp
import example.imageviewer.notchPadding import example.imageviewer.notchPadding
@Composable @Composable
internal fun TopLayout( fun TopLayout(
alignLeftContent: @Composable () -> Unit = {}, alignLeftContent: @Composable () -> Unit = {},
alignRightContent: @Composable () -> Unit = {}, alignRightContent: @Composable () -> Unit = {},
) { ) {

2
examples/imageviewer/shared/src/commonMain/kotlin/example/imageviewer/view/ZoomControllerView.common.kt

@ -6,4 +6,4 @@ import androidx.compose.ui.Modifier
import example.imageviewer.model.ScalableState import example.imageviewer.model.ScalableState
@Composable @Composable
internal expect fun ZoomControllerView(modifier: Modifier, scalableState: ScalableState) expect fun ZoomControllerView(modifier: Modifier, scalableState: ScalableState)

4
examples/imageviewer/shared/src/desktopMain/kotlin/example/imageviewer/filter/BitmapFilter.desktop.kt

@ -24,9 +24,9 @@ actual fun blurFilter(bitmap: ImageBitmap, context: PlatformContext): ImageBitma
actual class PlatformContext actual class PlatformContext
@Composable @Composable
internal actual fun getPlatformContext(): PlatformContext = PlatformContext() actual fun getPlatformContext(): PlatformContext = PlatformContext()
internal fun scaleBitmapAspectRatio( fun scaleBitmapAspectRatio(
bitmap: BufferedImage, bitmap: BufferedImage,
width: Int, width: Int,
height: Int height: Int

2
examples/imageviewer/shared/src/desktopMain/kotlin/example/imageviewer/view/CameraView.desktop.kt

@ -26,7 +26,7 @@ import java.util.*
@OptIn(ExperimentalResourceApi::class) @OptIn(ExperimentalResourceApi::class)
@Composable @Composable
internal actual fun CameraView( actual fun CameraView(
modifier: Modifier, modifier: Modifier,
onCapture: (picture: PictureData.Camera, image: PlatformStorableImage) -> Unit onCapture: (picture: PictureData.Camera, image: PlatformStorableImage) -> Unit
) { ) {

2
examples/imageviewer/shared/src/desktopMain/kotlin/example/imageviewer/view/EditMemoryDialog.desktop.kt

@ -30,7 +30,7 @@ import androidx.compose.ui.unit.sp
@OptIn(ExperimentalMaterialApi::class) @OptIn(ExperimentalMaterialApi::class)
@Composable @Composable
internal actual fun BoxScope.EditMemoryDialog( actual fun BoxScope.EditMemoryDialog(
previousName: String, previousName: String,
previousDescription: String, previousDescription: String,
save: (name: String, description: String) -> Unit save: (name: String, description: String) -> Unit

2
examples/imageviewer/shared/src/desktopMain/kotlin/example/imageviewer/view/LocationVisualizer.desktop.kt

@ -10,7 +10,7 @@ import org.jetbrains.compose.resources.painterResource
@OptIn(ExperimentalResourceApi::class) @OptIn(ExperimentalResourceApi::class)
@Composable @Composable
internal actual fun LocationVisualizer(modifier: Modifier, gps: GpsPosition, title: String) { actual fun LocationVisualizer(modifier: Modifier, gps: GpsPosition, title: String) {
Image( Image(
painter = painterResource("dummy_map.png"), painter = painterResource("dummy_map.png"),
contentDescription = "Map", contentDescription = "Map",

2
examples/imageviewer/shared/src/desktopMain/kotlin/example/imageviewer/view/ScrollableColumn.desktop.kt

@ -14,7 +14,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
@Composable @Composable
internal actual fun ScrollableColumn(modifier: Modifier, content: @Composable () -> Unit) { actual fun ScrollableColumn(modifier: Modifier, content: @Composable () -> Unit) {
val scrollState = rememberScrollState() val scrollState = rememberScrollState()
Modifier.verticalScroll(scrollState) Modifier.verticalScroll(scrollState)

2
examples/imageviewer/shared/src/desktopMain/kotlin/example/imageviewer/view/Tooltip.desktop.kt

@ -14,7 +14,7 @@ import androidx.compose.ui.unit.dp
@OptIn(ExperimentalFoundationApi::class) @OptIn(ExperimentalFoundationApi::class)
@Composable @Composable
internal actual fun Tooltip( actual fun Tooltip(
text: String, text: String,
content: @Composable () -> Unit content: @Composable () -> Unit
) { ) {

2
examples/imageviewer/shared/src/desktopMain/kotlin/example/imageviewer/view/ZoomControllerView.desktop.kt

@ -11,7 +11,7 @@ import androidx.compose.ui.unit.dp
import example.imageviewer.model.ScalableState import example.imageviewer.model.ScalableState
@Composable @Composable
internal actual fun ZoomControllerView(modifier: Modifier, scalableState: ScalableState) { actual fun ZoomControllerView(modifier: Modifier, scalableState: ScalableState) {
Slider( Slider(
modifier = modifier.fillMaxWidth(0.5f).padding(12.dp), modifier = modifier.fillMaxWidth(0.5f).padding(12.dp),
value = scalableState.zoom, value = scalableState.zoom,

2
examples/imageviewer/shared/src/iosMain/kotlin/example/imageviewer/filter/BitmapFilter.ios.kt

@ -21,7 +21,7 @@ actual fun blurFilter(bitmap: ImageBitmap, context: PlatformContext): ImageBitma
actual class PlatformContext actual class PlatformContext
@Composable @Composable
internal actual fun getPlatformContext(): PlatformContext = PlatformContext() actual fun getPlatformContext(): PlatformContext = PlatformContext()
private fun scaleBitmapAspectRatio( private fun scaleBitmapAspectRatio(
bitmap: Bitmap, bitmap: Bitmap,

2
examples/imageviewer/shared/src/iosMain/kotlin/example/imageviewer/view/CameraView.ios.kt

@ -54,7 +54,7 @@ private val deviceTypes = listOf(
) )
@Composable @Composable
internal actual fun CameraView( actual fun CameraView(
modifier: Modifier, modifier: Modifier,
onCapture: (picture: PictureData.Camera, image: PlatformStorableImage) -> Unit onCapture: (picture: PictureData.Camera, image: PlatformStorableImage) -> Unit
) { ) {

2
examples/imageviewer/shared/src/iosMain/kotlin/example/imageviewer/view/EditMemoryDialog.ios.kt

@ -27,7 +27,7 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
@Composable @Composable
internal actual fun BoxScope.EditMemoryDialog( actual fun BoxScope.EditMemoryDialog(
previousName: String, previousName: String,
previousDescription: String, previousDescription: String,
save: (name: String, description: String) -> Unit save: (name: String, description: String) -> Unit

2
examples/imageviewer/shared/src/iosMain/kotlin/example/imageviewer/view/LocationVisualizer.ios.kt

@ -11,7 +11,7 @@ import platform.MapKit.MKMapView
import platform.MapKit.MKPointAnnotation import platform.MapKit.MKPointAnnotation
@Composable @Composable
internal actual fun LocationVisualizer(modifier: Modifier, gps: GpsPosition, title: String) { actual fun LocationVisualizer(modifier: Modifier, gps: GpsPosition, title: String) {
val location = CLLocationCoordinate2DMake(gps.latitude, gps.longitude) val location = CLLocationCoordinate2DMake(gps.latitude, gps.longitude)
val annotation = remember { val annotation = remember {
MKPointAnnotation( MKPointAnnotation(

2
examples/imageviewer/shared/src/iosMain/kotlin/example/imageviewer/view/ScrollableColumn.ios.kt

@ -4,5 +4,5 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
@Composable @Composable
internal actual fun ScrollableColumn(modifier: Modifier, content: @Composable () -> Unit) = actual fun ScrollableColumn(modifier: Modifier, content: @Composable () -> Unit) =
TouchScrollableColumn(modifier, content) TouchScrollableColumn(modifier, content)

2
examples/imageviewer/shared/src/iosMain/kotlin/example/imageviewer/view/Tooltip.ios.kt

@ -3,7 +3,7 @@ package example.imageviewer.view
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
@Composable @Composable
internal actual fun Tooltip( actual fun Tooltip(
text: String, text: String,
content: @Composable () -> Unit content: @Composable () -> Unit
) { ) {

2
examples/imageviewer/shared/src/iosMain/kotlin/example/imageviewer/view/ZoomControllerView.ios.kt

@ -5,6 +5,6 @@ import androidx.compose.ui.Modifier
import example.imageviewer.model.ScalableState import example.imageviewer.model.ScalableState
@Composable @Composable
internal actual fun ZoomControllerView(modifier: Modifier, scalableState: ScalableState) { actual fun ZoomControllerView(modifier: Modifier, scalableState: ScalableState) {
// No need for additional ZoomControllerView for iOS // No need for additional ZoomControllerView for iOS
} }

4
examples/minesweeper/gradle.properties

@ -11,6 +11,6 @@ kotlin.native.useEmbeddableCompilerJar=true
kotlin.mpp.androidSourceSetLayoutVersion=2 kotlin.mpp.androidSourceSetLayoutVersion=2
# Enable kotlin/native experimental memory model # Enable kotlin/native experimental memory model
kotlin.native.binary.memoryModel=experimental kotlin.native.binary.memoryModel=experimental
kotlin.version=1.8.0 kotlin.version=1.8.20
agp.version=7.1.3 agp.version=7.1.3
compose.version=1.4.0-rc01 compose.version=1.4.0-rc03

2
examples/minesweeper/shared/src/commonMain/kotlin/BoardView.kt

@ -10,7 +10,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
@Composable @Composable
internal fun BoardView(game: GameController) = with(GameStyles) { fun BoardView(game: GameController) = with(GameStyles) {
Column { Column {
for (row in 0 until game.rows) { for (row in 0 until game.rows) {
Row(verticalAlignment = Alignment.CenterVertically) { Row(verticalAlignment = Alignment.CenterVertically) {

4
examples/minesweeper/shared/src/commonMain/kotlin/game.kt

@ -15,7 +15,7 @@ import kotlin.math.max
@OptIn(ExperimentalResourceApi::class) @OptIn(ExperimentalResourceApi::class)
@Composable @Composable
internal fun loadImage(res: String): Painter = painterResource(res) fun loadImage(res: String): Painter = painterResource(res)
expect fun hasRightClick(): Boolean expect fun hasRightClick(): Boolean
@ -39,7 +39,7 @@ object GameStyles {
} }
@Composable @Composable
internal fun Game(requestWindowSize: ((width: Dp, height: Dp) -> Unit)? = null) = MainLayout { fun Game(requestWindowSize: ((width: Dp, height: Dp) -> Unit)? = null) = MainLayout {
var message by remember { mutableStateOf<String?>(null) } var message by remember { mutableStateOf<String?>(null) }
val onWin = { message = "You win!" } val onWin = { message = "You win!" }

2
examples/minesweeper/shared/src/commonMain/kotlin/gameInteraction.kt

@ -6,7 +6,7 @@ import androidx.compose.ui.input.pointer.*
@OptIn(ExperimentalFoundationApi::class) @OptIn(ExperimentalFoundationApi::class)
@Composable @Composable
internal fun Modifier.gameInteraction(open: () -> Unit, flag: () -> Unit, seek: () -> Unit): Modifier = fun Modifier.gameInteraction(open: () -> Unit, flag: () -> Unit, seek: () -> Unit): Modifier =
if (!hasRightClick()) { if (!hasRightClick()) {
combinedClickable( combinedClickable(
onClick = { onClick = {

12
examples/minesweeper/shared/src/commonMain/kotlin/widgets.kt

@ -17,7 +17,7 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
@Composable @Composable
internal fun OpenedCell(cell: Cell) { fun OpenedCell(cell: Cell) {
Text( Text(
text = cell.bombsNear.toString(), text = cell.bombsNear.toString(),
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
@ -28,7 +28,7 @@ internal fun OpenedCell(cell: Cell) {
} }
@Composable @Composable
internal fun CellWithIcon(src: String, alt: String) { fun CellWithIcon(src: String, alt: String) {
Image( Image(
painter = loadImage(src), painter = loadImage(src),
contentDescription = alt, contentDescription = alt,
@ -37,17 +37,17 @@ internal fun CellWithIcon(src: String, alt: String) {
} }
@Composable @Composable
internal fun Mine() { fun Mine() {
CellWithIcon(src = "assets/mine.png", alt = "Bomb") CellWithIcon(src = "assets/mine.png", alt = "Bomb")
} }
@Composable @Composable
internal fun Flag() { fun Flag() {
CellWithIcon(src = "assets/flag.png", alt = "Flag") CellWithIcon(src = "assets/flag.png", alt = "Flag")
} }
@Composable @Composable
internal fun IndicatorWithIcon(iconPath: String, alt: String, value: Int) { fun IndicatorWithIcon(iconPath: String, alt: String, value: Int) {
Box(modifier = Modifier.background(Color(0x8e, 0x6e, 0x0e))) { Box(modifier = Modifier.background(Color(0x8e, 0x6e, 0x0e))) {
Row(verticalAlignment = Alignment.CenterVertically) { Row(verticalAlignment = Alignment.CenterVertically) {
Box(modifier = Modifier.size(40.dp, 40.dp)) { Box(modifier = Modifier.size(40.dp, 40.dp)) {
@ -66,7 +66,7 @@ internal fun IndicatorWithIcon(iconPath: String, alt: String, value: Int) {
} }
@Composable @Composable
internal fun NewGameButton(text: String, onClick: () -> Unit) { fun NewGameButton(text: String, onClick: () -> Unit) {
Box( Box(
Modifier Modifier
.background(color = Color(0x42, 0x8e, 0x04)) .background(color = Color(0x42, 0x8e, 0x04))

4
examples/todoapp-lite/gradle.properties

@ -11,6 +11,6 @@ kotlin.native.useEmbeddableCompilerJar=true
kotlin.mpp.androidSourceSetLayoutVersion=2 kotlin.mpp.androidSourceSetLayoutVersion=2
# Enable kotlin/native experimental memory model # Enable kotlin/native experimental memory model
kotlin.native.binary.memoryModel=experimental kotlin.native.binary.memoryModel=experimental
kotlin.version=1.8.0 kotlin.version=1.8.20
agp.version=7.1.3 agp.version=7.1.3
compose.version=1.4.0-rc01 compose.version=1.4.0-rc03

2
examples/todoapp-lite/shared/src/commonMain/kotlin/example/todoapp/lite/common/RootContent.kt

@ -6,7 +6,7 @@ import androidx.compose.ui.Modifier
import example.todoapp.lite.common.RootStore.RootState import example.todoapp.lite.common.RootStore.RootState
@Composable @Composable
internal fun RootContent(modifier: Modifier = Modifier) { fun RootContent(modifier: Modifier = Modifier) {
val model = remember { RootStore() } val model = remember { RootStore() }
val state = model.state val state = model.state

4
examples/visual-effects/gradle.properties

@ -11,6 +11,6 @@ kotlin.native.cacheKind=none
kotlin.native.useEmbeddableCompilerJar=true kotlin.native.useEmbeddableCompilerJar=true
# Enable kotlin/native experimental memory model # Enable kotlin/native experimental memory model
kotlin.native.binary.memoryModel=experimental kotlin.native.binary.memoryModel=experimental
kotlin.version=1.8.0 kotlin.version=1.8.20
agp.version=7.1.3 agp.version=7.1.3
compose.version=1.4.0-rc01 compose.version=1.4.0-rc03

6
examples/visual-effects/shared/src/commonMain/kotlin/AllSamlesView.kt

@ -14,7 +14,7 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
@Composable @Composable
internal fun SampleWithTopAppBar(sample: Screen, state: MutableState<Screen>, content: @Composable (PaddingValues) -> Unit) { fun SampleWithTopAppBar(sample: Screen, state: MutableState<Screen>, content: @Composable (PaddingValues) -> Unit) {
Box(modifier = Modifier.fillMaxSize()) { Box(modifier = Modifier.fillMaxSize()) {
Scaffold( Scaffold(
topBar = { topBar = {
@ -44,7 +44,7 @@ enum class Screen(val screen: String) {
} }
@Composable @Composable
internal fun MyButton(screenState: MutableState<Screen>, to: Screen) { fun MyButton(screenState: MutableState<Screen>, to: Screen) {
Button(onClick = { Button(onClick = {
screenState.value = to screenState.value = to
}) { }) {
@ -53,7 +53,7 @@ internal fun MyButton(screenState: MutableState<Screen>, to: Screen) {
} }
@Composable @Composable
internal fun AllSamplesView() { fun AllSamplesView() {
MaterialTheme { MaterialTheme {
val screenState: MutableState<Screen> = remember { mutableStateOf(Screen.CHOOSE_SAMPLE) } val screenState: MutableState<Screen> = remember { mutableStateOf(Screen.CHOOSE_SAMPLE) }
when (screenState.value) { when (screenState.value) {

18
examples/visual-effects/shared/src/commonMain/kotlin/HappyNY.kt

@ -110,7 +110,7 @@ class DoubleRocket(val particle: Particle) {
} }
@Composable @Composable
internal fun draw() { fun draw() {
if (state == rocket.STATE_ROCKET) { if (state == rocket.STATE_ROCKET) {
particle.draw() particle.draw()
} else { } else {
@ -163,7 +163,7 @@ class Rocket(val particle: Particle, val color: Color, val startTime: Long = 0)
} }
@Composable @Composable
internal fun draw() { fun draw() {
if (!exploded) { if (!exploded) {
particle.draw() particle.draw()
} else { } else {
@ -185,7 +185,7 @@ class Particle(var x: Double, var y: Double, var vx: Double, var vy: Double, val
} }
@Composable @Composable
internal fun draw() { fun draw() {
val alphaFactor = if (type == 0) 1.0f else 1 / (1 + abs(vy / 5)).toFloat() val alphaFactor = if (type == 0) 1.0f else 1 / (1 + abs(vy / 5)).toFloat()
Box(Modifier.size(5.dp).offset(x.dp, y.dp).alpha(alphaFactor).clip(CircleShape).background(color)) Box(Modifier.size(5.dp).offset(x.dp, y.dp).alpha(alphaFactor).clip(CircleShape).background(color))
for (i in 1..5) { for (i in 1..5) {
@ -229,7 +229,7 @@ fun prepareStarsAndSnowFlakes(stars: SnapshotStateList<Star>, snowFlakes: Snapsh
@OptIn(ExperimentalComposeUiApi::class) @OptIn(ExperimentalComposeUiApi::class)
@Composable @Composable
internal fun NYContent() { fun NYContent() {
var time by remember { mutableStateOf(nanoTime()) } var time by remember { mutableStateOf(nanoTime()) }
var started by remember { mutableStateOf(false) } var started by remember { mutableStateOf(false) }
var startTime = remember { nanoTime() } var startTime = remember { nanoTime() }
@ -371,20 +371,20 @@ fun flickeringAlpha(time: Long): Float {
@Composable @Composable
internal fun starrySky(stars: SnapshotStateList<Star>) { fun starrySky(stars: SnapshotStateList<Star>) {
stars.forEach { stars.forEach {
star(it.x, it.y, it.color, size = it.size) star(it.x, it.y, it.color, size = it.size)
} }
} }
@Composable @Composable
internal fun star(x: Dp, y: Dp, color: Color = Color.White, size: Dp) { fun star(x: Dp, y: Dp, color: Color = Color.White, size: Dp) {
Box(Modifier.offset(x, y).scale(1.0f, 0.2f).rotate(45f).size(size).background(color)) Box(Modifier.offset(x, y).scale(1.0f, 0.2f).rotate(45f).size(size).background(color))
Box(Modifier.offset(x, y).scale(0.2f, 1.0f).rotate(45f).size(size).background(color)) Box(Modifier.offset(x, y).scale(0.2f, 1.0f).rotate(45f).size(size).background(color))
} }
@Composable @Composable
internal fun snow(time: Long, prevTime: Long, snowFlakes: SnapshotStateList<SnowFlake>, startTime: Long) { fun snow(time: Long, prevTime: Long, snowFlakes: SnapshotStateList<SnowFlake>, startTime: Long) {
val deltaAngle = (time - startTime) / 100000000 val deltaAngle = (time - startTime) / 100000000
with(LocalDensity.current) { with(LocalDensity.current) {
snowFlakes.forEach { snowFlakes.forEach {
@ -400,7 +400,7 @@ internal fun snow(time: Long, prevTime: Long, snowFlakes: SnapshotStateList<Snow
} }
@Composable @Composable
internal fun snowFlake(modifier: Modifier, alpha: Float = 0.8f) { fun snowFlake(modifier: Modifier, alpha: Float = 0.8f) {
Box(modifier) { Box(modifier) {
snowFlakeInt(0, 0f, 30.dp, 0.dp, alpha) snowFlakeInt(0, 0f, 30.dp, 0.dp, alpha)
snowFlakeInt(0, 60f, 15.dp, 25.dp, alpha) snowFlakeInt(0, 60f, 15.dp, 25.dp, alpha)
@ -413,7 +413,7 @@ internal fun snowFlake(modifier: Modifier, alpha: Float = 0.8f) {
} }
@Composable @Composable
internal fun snowFlakeInt(level: Int, angle: Float, shiftX: Dp, shiftY: Dp, alpha: Float) { fun snowFlakeInt(level: Int, angle: Float, shiftX: Dp, shiftY: Dp, alpha: Float) {
if (level > 3) return if (level > 3) return
Box( Box(
Modifier.offset(shiftX, shiftY).rotate(angle).width(100.dp).height(10.dp).scale(0.6f).alpha(1f) Modifier.offset(shiftX, shiftY).rotate(angle).width(100.dp).height(10.dp).scale(0.6f).alpha(1f)

10
examples/visual-effects/shared/src/commonMain/kotlin/RotatingWords.kt

@ -25,7 +25,7 @@ import org.jetbrains.compose.resources.painterResource
@OptIn(ExperimentalResourceApi::class) @OptIn(ExperimentalResourceApi::class)
@Composable @Composable
internal fun Words() { fun Words() {
val duration = 5000 val duration = 5000
val infiniteTransition = rememberInfiniteTransition() val infiniteTransition = rememberInfiniteTransition()
@ -84,7 +84,7 @@ internal fun Words() {
} }
@Composable @Composable
internal fun Word(position: DpOffset, angle: Float, scale: Float, text: String, fun Word(position: DpOffset, angle: Float, scale: Float, text: String,
color: Color, alpha: Float = 0.8f) { color: Color, alpha: Float = 0.8f) {
Text( Text(
modifier = Modifier modifier = Modifier
@ -99,7 +99,7 @@ internal fun Word(position: DpOffset, angle: Float, scale: Float, text: String,
} }
@Composable @Composable
internal fun FallingSnow() { fun FallingSnow() {
BoxWithConstraints(Modifier.fillMaxSize()) { BoxWithConstraints(Modifier.fillMaxSize()) {
repeat(50) { repeat(50) {
val size = remember { 20.dp + 10.dp * random() } val size = remember { 20.dp + 10.dp * random() }
@ -134,14 +134,14 @@ internal fun FallingSnow() {
} }
@Composable @Composable
internal fun Background() = Box( fun Background() = Box(
Modifier Modifier
.fillMaxSize() .fillMaxSize()
.background(Color(0xFF6F97FF)) .background(Color(0xFF6F97FF))
) )
@Composable @Composable
internal fun RotatingWords() { fun RotatingWords() {
Background() Background()
FallingSnow() FallingSnow()
Words() Words()

6
examples/visual-effects/shared/src/commonMain/kotlin/WaveEffect.kt

@ -18,7 +18,7 @@ import kotlin.math.*
@OptIn(ExperimentalComposeUiApi::class) @OptIn(ExperimentalComposeUiApi::class)
@Composable @Composable
internal fun WaveEffectGrid() { fun WaveEffectGrid() {
var mouseX by remember { mutableStateOf(0) } var mouseX by remember { mutableStateOf(0) }
var mouseY by remember { mutableStateOf(0) } var mouseY by remember { mutableStateOf(0) }
var centerX by remember { mutableStateOf(1200) } var centerX by remember { mutableStateOf(1200) }
@ -93,7 +93,7 @@ internal fun WaveEffectGrid() {
} }
@Composable @Composable
internal fun HighPanel(mouseX: Int, mouseY: Int) { fun HighPanel(mouseX: Int, mouseY: Int) {
Text( Text(
"Compose", "Compose",
Modifier.offset(270.dp, 600.dp).scale(7.0f).alpha(alpha(mouseX, mouseY, 270, 700)), Modifier.offset(270.dp, 600.dp).scale(7.0f).alpha(alpha(mouseX, mouseY, 270, 700)),
@ -148,7 +148,7 @@ private fun distance(x1: Int, y1: Int, x2: Int, y2: Int): Double {
} }
@Composable @Composable
internal fun Dot(size: Int, modifier: Modifier, color: Color, time: Long) { fun Dot(size: Int, modifier: Modifier, color: Color, time: Long) {
Box( Box(
modifier.rotate(time.toFloat() / (15 * 10000000)).clip(RoundedCornerShape((3 + size / 20).dp)) modifier.rotate(time.toFloat() / (15 * 10000000)).clip(RoundedCornerShape((3 + size / 20).dp))
.size(width = size.dp, height = size.dp) .size(width = size.dp, height = size.dp)

4
examples/widgets-gallery/gradle.properties

@ -11,6 +11,6 @@ kotlin.native.useEmbeddableCompilerJar=true
kotlin.mpp.androidSourceSetLayoutVersion=2 kotlin.mpp.androidSourceSetLayoutVersion=2
# Enable kotlin/native experimental memory model # Enable kotlin/native experimental memory model
kotlin.native.binary.memoryModel=experimental kotlin.native.binary.memoryModel=experimental
kotlin.version=1.8.0 kotlin.version=1.8.20
agp.version=7.1.3 agp.version=7.1.3
compose.version=1.4.0-rc01 compose.version=1.4.0-rc03

4
examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/platform/Scrollbar.kt

@ -7,13 +7,13 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.Dp
@Composable @Composable
internal expect fun VerticalScrollbar( expect fun VerticalScrollbar(
modifier: Modifier, modifier: Modifier,
scrollState: ScrollState scrollState: ScrollState
) )
@Composable @Composable
internal expect fun VerticalScrollbar( expect fun VerticalScrollbar(
modifier: Modifier, modifier: Modifier,
scrollState: LazyListState, scrollState: LazyListState,
itemCount: Int, itemCount: Int,

2
examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/platform/System.kt

@ -1,3 +1,3 @@
package org.jetbrains.compose.demo.widgets.platform package org.jetbrains.compose.demo.widgets.platform
internal expect fun isSystemInDarkTheme(): Boolean expect fun isSystemInDarkTheme(): Boolean

2
examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/theme/Theme.kt

@ -115,7 +115,7 @@ enum class ColorPallet {
} }
@Composable @Composable
internal fun WidgetGalleryTheme( fun WidgetGalleryTheme(
darkTheme: Boolean = isSystemInDarkTheme(), darkTheme: Boolean = isSystemInDarkTheme(),
colorPallet: ColorPallet = GREEN, colorPallet: ColorPallet = GREEN,
content: @Composable() () -> Unit, content: @Composable() () -> Unit,

4
examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/ui/MainView.kt

@ -36,7 +36,7 @@ import org.jetbrains.compose.demo.widgets.ui.utils.VerticalSplittable
import org.jetbrains.compose.demo.widgets.ui.utils.withoutWidthConstraints import org.jetbrains.compose.demo.widgets.ui.utils.withoutWidthConstraints
@Composable @Composable
internal fun MainView() { fun MainView() {
WidgetGalleryTheme { WidgetGalleryTheme {
Surface { Surface {
WidgetsPanel() WidgetsPanel()
@ -45,7 +45,7 @@ internal fun MainView() {
} }
@Composable @Composable
internal fun WidgetsPanel() { fun WidgetsPanel() {
val widgetsTypeState = rememberSaveable { mutableStateOf(WidgetsType.sortedValues.first()) } val widgetsTypeState = rememberSaveable { mutableStateOf(WidgetsType.sortedValues.first()) }
val panelState = remember { PanelState() } val panelState = remember { PanelState() }

2
examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/ui/WidgetView.kt

@ -9,7 +9,7 @@ import androidx.compose.ui.Modifier
import org.jetbrains.compose.demo.widgets.ui.screens.* import org.jetbrains.compose.demo.widgets.ui.screens.*
@Composable @Composable
internal fun WidgetsView( fun WidgetsView(
widgetsTypeState: MutableState<WidgetsType>, widgetsTypeState: MutableState<WidgetsType>,
modifier: Modifier modifier: Modifier
) { ) {

2
examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/ui/screens/AppBars.kt

@ -23,7 +23,7 @@ import org.jetbrains.compose.demo.widgets.ui.utils.TitleText
import org.jetbrains.compose.resources.ExperimentalResourceApi import org.jetbrains.compose.resources.ExperimentalResourceApi
@Composable @Composable
internal fun AppBars() { fun AppBars() {
TopAppBarsDemo() TopAppBarsDemo()
BottomAppBarDemo() BottomAppBarDemo()
NavigationBarDemo() NavigationBarDemo()

2
examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/ui/screens/Buttons.kt

@ -20,7 +20,7 @@ import org.jetbrains.compose.demo.widgets.theme.purple200
import org.jetbrains.compose.demo.widgets.theme.typography import org.jetbrains.compose.demo.widgets.theme.typography
@Composable @Composable
internal fun Buttons() { fun Buttons() {
Column { Column {
Button(onClick = {}, modifier = Modifier.padding(8.dp)) { Button(onClick = {}, modifier = Modifier.padding(8.dp)) {
Text(text = "Main Button") Text(text = "Main Button")

2
examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/ui/screens/Chips.kt

@ -21,7 +21,7 @@ import org.jetbrains.compose.demo.widgets.ui.utils.SubtitleText
import org.jetbrains.compose.resources.ExperimentalResourceApi import org.jetbrains.compose.resources.ExperimentalResourceApi
@Composable @Composable
internal fun Chips() { fun Chips() {
// There is no in-built chips but you can make yours like below // There is no in-built chips but you can make yours like below
SubtitleText(subtitle = "Custom chips with surface") SubtitleText(subtitle = "Custom chips with surface")
Column(modifier = Modifier.padding(8.dp)) { Column(modifier = Modifier.padding(8.dp)) {

2
examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/ui/screens/Loaders.kt

@ -13,7 +13,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
@Composable @Composable
internal fun Loaders() { fun Loaders() {
AlignedColumn { AlignedColumn {
CircularProgressIndicator() CircularProgressIndicator()
} }

2
examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/ui/screens/SnackBars.kt

@ -10,7 +10,7 @@ import androidx.compose.ui.unit.dp
import org.jetbrains.compose.demo.widgets.theme.typography import org.jetbrains.compose.demo.widgets.theme.typography
@Composable @Composable
internal fun SnackBars() { fun SnackBars() {
Snackbar(modifier = Modifier.padding(4.dp)) { Snackbar(modifier = Modifier.padding(4.dp)) {
Text(text = "This is a basic snackbar") Text(text = "This is a basic snackbar")
} }

2
examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/ui/screens/TextInputs.kt

@ -19,7 +19,7 @@ import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
@Composable @Composable
internal fun TextInputs() { fun TextInputs() {
var text by remember { mutableStateOf(TextFieldValue("")) } var text by remember { mutableStateOf(TextFieldValue("")) }
// TODO Explore CoreTextField // TODO Explore CoreTextField

2
examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/ui/screens/Texts.kt

@ -14,7 +14,7 @@ import org.jetbrains.compose.demo.widgets.theme.typography
import org.jetbrains.compose.demo.widgets.ui.utils.SubtitleText import org.jetbrains.compose.demo.widgets.ui.utils.SubtitleText
@Composable @Composable
internal fun TextViews() { fun TextViews() {
Column { Column {
val textModifier = Modifier.padding(horizontal = 8.dp) val textModifier = Modifier.padding(horizontal = 8.dp)

2
examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/ui/screens/Toggles.kt

@ -12,7 +12,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
@Composable @Composable
internal fun Toggles() { fun Toggles() {
Column { Column {
var checked by remember { mutableStateOf(true) } var checked by remember { mutableStateOf(true) }
Checkbox( Checkbox(

2
examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/ui/screens/UICards.kt

@ -18,7 +18,7 @@ import org.jetbrains.compose.resources.ExperimentalResourceApi
@OptIn(ExperimentalMaterialApi::class, ExperimentalResourceApi::class) @OptIn(ExperimentalMaterialApi::class, ExperimentalResourceApi::class)
@Composable @Composable
internal fun UICards() { fun UICards() {
val item = remember { DemoDataProvider.item } val item = remember { DemoDataProvider.item }
Text( Text(

2
examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/ui/utils/ResizablePanel.kt

@ -34,7 +34,7 @@ class PanelState {
} }
@Composable @Composable
internal fun ResizablePanel( fun ResizablePanel(
modifier: Modifier, modifier: Modifier,
state: PanelState, state: PanelState,
title: String, title: String,

4
examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/ui/utils/Text.kt

@ -9,12 +9,12 @@ import androidx.compose.ui.unit.sp
import org.jetbrains.compose.demo.widgets.theme.typography import org.jetbrains.compose.demo.widgets.theme.typography
@Composable @Composable
internal fun SubtitleText(subtitle: String, modifier: Modifier = Modifier) { fun SubtitleText(subtitle: String, modifier: Modifier = Modifier) {
Text(text = subtitle, style = typography.subtitle2, modifier = modifier.padding(8.dp)) Text(text = subtitle, style = typography.subtitle2, modifier = modifier.padding(8.dp))
} }
@Composable @Composable
internal fun TitleText(title: String) { fun TitleText(title: String) {
Text( Text(
text = title, text = title,
style = typography.h6.copy(fontSize = 14.sp), style = typography.h6.copy(fontSize = 14.sp),

4
examples/widgets-gallery/shared/src/commonMain/kotlin/org/jetbrains/compose/demo/widgets/ui/utils/VerticalSplittable.kt

@ -26,7 +26,7 @@ class SplitterState {
} }
@Composable @Composable
internal fun VerticalSplittable( fun VerticalSplittable(
modifier: Modifier, modifier: Modifier,
splitterState: SplitterState, splitterState: SplitterState,
onResize: (delta: Dp) -> Unit, onResize: (delta: Dp) -> Unit,
@ -58,7 +58,7 @@ internal fun VerticalSplittable(
@Composable @Composable
internal fun VerticalSplitter( fun VerticalSplitter(
splitterState: SplitterState, splitterState: SplitterState,
onResize: (delta: Dp) -> Unit, onResize: (delta: Dp) -> Unit,
color: Color = Color.DarkGray color: Color = Color.DarkGray

4
examples/widgets-gallery/shared/src/iosMain/kotlin/org/jetbrains/compose/demo/widgets/platform/Scrollbar.kt

@ -7,13 +7,13 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.Dp
@Composable @Composable
internal actual fun VerticalScrollbar( actual fun VerticalScrollbar(
modifier: Modifier, modifier: Modifier,
scrollState: ScrollState scrollState: ScrollState
) = Unit ) = Unit
@Composable @Composable
internal actual fun VerticalScrollbar( actual fun VerticalScrollbar(
modifier: Modifier, modifier: Modifier,
scrollState: LazyListState, scrollState: LazyListState,
itemCount: Int, itemCount: Int,

2
examples/widgets-gallery/shared/src/iosMain/kotlin/org/jetbrains/compose/demo/widgets/platform/System.kt

@ -4,4 +4,4 @@ import androidx.compose.runtime.Composable
import org.jetbrains.skiko.SystemTheme import org.jetbrains.skiko.SystemTheme
@Composable @Composable
internal actual fun isSystemInDarkTheme(): Boolean = org.jetbrains.skiko.currentSystemTheme == SystemTheme.DARK actual fun isSystemInDarkTheme(): Boolean = org.jetbrains.skiko.currentSystemTheme == SystemTheme.DARK

Loading…
Cancel
Save