Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/support/1.5.0' into release/1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
igordmn committed Aug 15, 2023
2 parents 950d5a9 + 72cccc6 commit c76448b
Show file tree
Hide file tree
Showing 31 changed files with 94 additions and 90 deletions.
55 changes: 55 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,58 @@
# 1.5.0-beta02 (August 2023)

## Common

### Features
- [`androidx.compose.material.DropdownMenu` is available to use from common source set](https://github.com/JetBrains/compose-multiplatform-core/pull/738)
- [`androidx.compose.material3.DropdownMenu` is available to use from common source set](https://github.com/JetBrains/compose-multiplatform-core/pull/737)
- [`androidx.compose.material.AlertDialog` is available to use from common source set](https://github.com/JetBrains/compose-multiplatform-core/pull/708)
- [`androidx.compose.material3.AlertDialog` is available to use from common source set](https://github.com/JetBrains/compose-multiplatform-core/pull/710)
- [Add `PopupProperties.clippingEnabled` setting](https://github.com/JetBrains/compose-multiplatform-core/pull/740)
- material3. Support [`DatePicker`](https://github.com/JetBrains/compose-multiplatform-core/pull/717), [`DatePickerDialog`](https://github.com/JetBrains/compose-multiplatform-core/pull/745) and `TimePicker`

### API Changes
- [Change the default layout behavior of `AlertDialog`](https://github.com/JetBrains/compose-multiplatform-core/pull/708)

## iOS

### Features
- [Support singleLine and `KeyboardAction`](https://github.com/JetBrains/compose-multiplatform-core/pull/699)

### Fixes
- [Fix memory leak in `ComposeUIViewController`](https://github.com/JetBrains/compose-multiplatform/issues/3201)
- [Manage Kotlin native cache kind automatically based on Kotlin version](https://github.com/JetBrains/compose-multiplatform/pull/3477) (`kotlin.native.cacheKind=none` is no longer needed)
- [Limit max `Dialog` and `Popup` size by safe area on iOS](https://github.com/JetBrains/compose-multiplatform-core/pull/732)
- [`TextField`, Korean characters are not normally entered](https://github.com/JetBrains/compose-multiplatform/issues/3101)
- [`ColorMatrix` value range for 5th column was incorrect on Skiko backed platforms](https://github.com/JetBrains/compose-multiplatform/issues/3461)
- [`isSystemDarkTheme` now automatically react to the system theme changes](https://github.com/JetBrains/compose-multiplatform-core/pull/715)

### API Changes
- [`ComposeUIViewController`. Dispose composition on `viewDidDisappear`](https://github.com/JetBrains/compose-multiplatform-core/pull/747)

## Web

### Features
- [Make `CanvasBasedWindow` apply default styles, set title](https://github.com/JetBrains/compose-multiplatform-core/pull/722)

## Gradle Plugin

### Features
- [Add `runtimeSaveable` to Dependencies in compose gradle plugin](https://github.com/JetBrains/compose-multiplatform/pull/3449)

### API Changes
- [Raise error when Homebrew JDK is used for packaging](https://github.com/JetBrains/compose-multiplatform/pull/3451/files)

## Dependencies

This version of Compose Multiplatform is based on the next Jetpack Compose libraries:

- [Compiler 1.5.0](https://developer.android.com/jetpack/androidx/releases/compose-compiler#1.5.0)
- [Runtime 1.5.0](https://developer.android.com/jetpack/androidx/releases/compose-runtime#1.5.0)
- [UI 1.5.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.5.0)
- [Foundation 1.5.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.5.0)
- [Material 1.5.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.5.0)
- [Material3 1.1.1](https://developer.android.com/jetpack/androidx/releases/compose-material3#1.1.1)

# 1.5.0-beta01 (July 2023)

## Common
Expand Down
3 changes: 1 addition & 2 deletions examples/chat/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ org.gradle.jvmargs=-Xmx3g
org.jetbrains.compose.experimental.jscanvas.enabled=true
org.jetbrains.compose.experimental.macos.enabled=true
org.jetbrains.compose.experimental.uikit.enabled=true
kotlin.native.cacheKind=none
kotlin.native.useEmbeddableCompilerJar=true
kotlin.mpp.androidSourceSetLayoutVersion=2
# Enable kotlin/native experimental memory model
kotlin.native.binary.memoryModel=experimental
kotlin.version=1.9.0
agp.version=7.1.3
compose.version=1.4.3
compose.version=1.5.0-beta02
1 change: 0 additions & 1 deletion examples/chat/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ kotlin {
baseName = "shared"
isStatic = true
}
extraSpecAttributes["resources"] = "['src/commonMain/resources/**', 'src/iosMain/resources/**']"
}

sourceSets {
Expand Down
3 changes: 1 addition & 2 deletions examples/codeviewer/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ org.gradle.jvmargs=-Xmx3g
org.jetbrains.compose.experimental.jscanvas.enabled=true
org.jetbrains.compose.experimental.macos.enabled=true
org.jetbrains.compose.experimental.uikit.enabled=true
kotlin.native.cacheKind=none
kotlin.native.useEmbeddableCompilerJar=true
kotlin.mpp.androidSourceSetLayoutVersion=2
# Enable kotlin/native experimental memory model
kotlin.native.binary.memoryModel=experimental
kotlin.version=1.9.0
agp.version=7.1.3
compose.version=1.4.3
compose.version=1.5.0-beta02
1 change: 0 additions & 1 deletion examples/codeviewer/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ kotlin {
baseName = "shared"
isStatic = true
}
extraSpecAttributes["resources"] = "['src/commonMain/resources/**', 'src/iosMain/resources/**']"
}

sourceSets {
Expand Down
3 changes: 1 addition & 2 deletions examples/falling-balls/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ org.gradle.jvmargs=-Xmx3g
org.jetbrains.compose.experimental.jscanvas.enabled=true
org.jetbrains.compose.experimental.macos.enabled=true
org.jetbrains.compose.experimental.uikit.enabled=true
kotlin.native.cacheKind=none
kotlin.native.useEmbeddableCompilerJar=true
kotlin.mpp.androidSourceSetLayoutVersion=2
# Enable kotlin/native experimental memory model
kotlin.native.binary.memoryModel=experimental
kotlin.version=1.9.0
agp.version=7.1.3
compose.version=1.4.3
compose.version=1.5.0-beta02
1 change: 0 additions & 1 deletion examples/falling-balls/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ kotlin {
baseName = "shared"
isStatic = true
}
extraSpecAttributes["resources"] = "['src/commonMain/resources/**', 'src/iosMain/resources/**']"
}

sourceSets {
Expand Down
3 changes: 3 additions & 0 deletions examples/imageviewer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ To setup the environment, please consult these [instructions](https://github.com

## How to run

If you already runned this sample before, then you need to execute command at least once:
`/gradlew podInstall`

Choose a run configuration for an appropriate target in IDE and run it.

![run-configurations.png](screenshots/run-configurations.png)
Expand Down
3 changes: 1 addition & 2 deletions examples/imageviewer/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ org.gradle.jvmargs=-Xmx3g
org.jetbrains.compose.experimental.jscanvas.enabled=true
org.jetbrains.compose.experimental.macos.enabled=true
org.jetbrains.compose.experimental.uikit.enabled=true
kotlin.native.cacheKind=none
kotlin.mpp.androidSourceSetLayoutVersion=2
kotlin.native.useEmbeddableCompilerJar=true
# Enable kotlin/native experimental memory model
kotlin.native.binary.memoryModel=experimental
kotlin.version=1.9.0
agp.version=7.1.3
compose.version=1.4.3
compose.version=1.5.0-beta02
2 changes: 0 additions & 2 deletions examples/imageviewer/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ kotlin {
baseName = "shared"
isStatic = true
}
extraSpecAttributes["resources"] = "['src/commonMain/resources/**', 'src/iosMain/resources/**']"

}

sourceSets {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import androidx.compose.ui.graphics.vector.ImageVector
import kotlinx.coroutines.Dispatchers
import java.util.UUID

actual fun Modifier.notchPadding(): Modifier = this.displayCutoutPadding().statusBarsPadding()

class AndroidStorableImage(
val imageBitmap: ImageBitmap
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector
import kotlinx.coroutines.CoroutineDispatcher

expect fun Modifier.notchPadding(): Modifier

expect class PlatformStorableImage

expect fun createUUID(): String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ fun GalleryScreen(
val imageProvider = LocalImageProvider.current
val viewScope = rememberCoroutineScope()

val pagerState = rememberPagerState(initialPage = selectedPictureIndex.value)
val pagerState = rememberPagerState(
initialPage = selectedPictureIndex.value,
initialPageOffsetFraction = 0f,
pageCount = { pictures.size },
)
LaunchedEffect(pagerState) {
// Subscribe to page changes
snapshotFlow { pagerState.currentPage }.collect { page ->
Expand Down Expand Up @@ -116,7 +120,7 @@ fun GalleryScreen(
onClickPreviewPicture(pagerState.currentPage)
}
) {
HorizontalPager(pictures.size, state = pagerState) { index ->
HorizontalPager(state = pagerState) { index ->
val picture = pictures[index]
var image: ImageBitmap? by remember(picture) { mutableStateOf(null) }
LaunchedEffect(picture) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ package example.imageviewer.view

import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.systemBars
import androidx.compose.foundation.layout.windowInsetsPadding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import example.imageviewer.notchPadding

@Composable
fun TopLayout(
Expand All @@ -18,7 +20,7 @@ fun TopLayout(
Box(
Modifier
.fillMaxWidth()
.notchPadding()
.windowInsetsPadding(WindowInsets.systemBars)
.padding(12.dp)
) {
Row(Modifier.align(Alignment.CenterStart)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import androidx.compose.ui.unit.dp
import kotlinx.coroutines.Dispatchers
import java.util.UUID

actual fun Modifier.notchPadding(): Modifier = Modifier.padding(top = 12.dp)

class DesktopStorableImage(
val imageBitmap: ImageBitmap
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,41 +1,15 @@
package example.imageviewer

import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.windowInsetsPadding
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.LayoutDirection
import example.imageviewer.icon.IconIosShare
import kotlinx.cinterop.useContents
import kotlinx.cinterop.ExperimentalForeignApi
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.IO
import platform.CoreFoundation.CFUUIDCreate
import platform.CoreFoundation.CFUUIDCreateString
import platform.Foundation.CFBridgingRelease
import platform.UIKit.UIApplication
import platform.UIKit.UIImage

private val iosNotchInset = object : WindowInsets {
override fun getTop(density: Density): Int {
val safeAreaInsets = UIApplication.sharedApplication.keyWindow?.safeAreaInsets
return if (safeAreaInsets != null) {
val topInset = safeAreaInsets.useContents { this.top }
(topInset * density.density).toInt()
} else {
0
}
}

override fun getLeft(density: Density, layoutDirection: LayoutDirection): Int = 0
override fun getRight(density: Density, layoutDirection: LayoutDirection): Int = 0
override fun getBottom(density: Density): Int = 0
}

actual fun Modifier.notchPadding(): Modifier =
this.windowInsetsPadding(iosNotchInset)

class IosStorableImage(
val rawValue: UIImage
)
Expand Down
3 changes: 1 addition & 2 deletions examples/minesweeper/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ org.gradle.jvmargs=-Xmx3g
org.jetbrains.compose.experimental.jscanvas.enabled=true
org.jetbrains.compose.experimental.macos.enabled=true
org.jetbrains.compose.experimental.uikit.enabled=true
kotlin.native.cacheKind=none
kotlin.native.useEmbeddableCompilerJar=true
kotlin.mpp.androidSourceSetLayoutVersion=2
# Enable kotlin/native experimental memory model
kotlin.native.binary.memoryModel=experimental
kotlin.version=1.9.0
agp.version=7.1.3
compose.version=1.4.3
compose.version=1.5.0-beta02
12 changes: 1 addition & 11 deletions examples/minesweeper/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,7 @@ kotlin {
jvm("desktop")

ios()
iosSimulatorArm64() {
// TODO: remove after 1.5 release
binaries.forEach {
it.freeCompilerArgs += listOf(
"-linker-option", "-framework", "-linker-option", "Metal",
"-linker-option", "-framework", "-linker-option", "CoreText",
"-linker-option", "-framework", "-linker-option", "CoreGraphics",
)
}
}
iosSimulatorArm64()

js(IR) {
browser()
Expand Down Expand Up @@ -54,7 +45,6 @@ kotlin {
baseName = "shared"
isStatic = true
}
extraSpecAttributes["resources"] = "['src/commonMain/resources/**', 'src/iosMain/resources/**']"
}

sourceSets {
Expand Down
3 changes: 1 addition & 2 deletions examples/todoapp-lite/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ org.gradle.jvmargs=-Xmx3g
org.jetbrains.compose.experimental.jscanvas.enabled=true
org.jetbrains.compose.experimental.macos.enabled=true
org.jetbrains.compose.experimental.uikit.enabled=true
kotlin.native.cacheKind=none
kotlin.native.useEmbeddableCompilerJar=true
kotlin.mpp.androidSourceSetLayoutVersion=2
# Enable kotlin/native experimental memory model
kotlin.native.binary.memoryModel=experimental
kotlin.version=1.9.0
agp.version=7.1.3
compose.version=1.4.3
compose.version=1.5.0-beta02
1 change: 0 additions & 1 deletion examples/todoapp-lite/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ kotlin {
baseName = "shared"
isStatic = true
}
extraSpecAttributes["resources"] = "['src/commonMain/resources/**', 'src/iosMain/resources/**']"
}

sourceSets {
Expand Down
2 changes: 1 addition & 1 deletion examples/validateExamples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ runGradle() {

runGradle chat packageDistributionForCurrentOS
runGradle codeviewer packageDistributionForCurrentOS
#runGradle imageviewer packageDistributionForCurrentOS
runGradle imageviewer packageDistributionForCurrentOS
runGradle issues packageDistributionForCurrentOS
runGradle notepad packageDistributionForCurrentOS
runGradle todoapp-lite packageDistributionForCurrentOS
Expand Down
2 changes: 1 addition & 1 deletion examples/validateExamplesAndroid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ runGradle() {
# requires an emulator running or an Android device to be connected
runGradle chat installDebug
runGradle codeviewer installDebug
#runGradle imageviewer installDebug
runGradle imageviewer installDebug
runGradle issues installDebug
runGradle minesweeper installDebug
runGradle todoapp-lite installDebug
Expand Down
2 changes: 1 addition & 1 deletion examples/validateExamplesIos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ runGradle() {
runGradle chat
runGradle codeviewer
runGradle falling-balls
# runGradle imageviewer
runGradle imageviewer
runGradle todoapp-lite
runGradle visual-effects
runGradle widgets-gallery
Expand Down
3 changes: 1 addition & 2 deletions examples/visual-effects/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ org.jetbrains.compose.experimental.jscanvas.enabled=true
org.jetbrains.compose.experimental.macos.enabled=true
org.jetbrains.compose.experimental.uikit.enabled=true
kotlin.mpp.androidSourceSetLayoutVersion=2
kotlin.native.cacheKind=none
kotlin.native.useEmbeddableCompilerJar=true
# Enable kotlin/native experimental memory model
kotlin.native.binary.memoryModel=experimental
kotlin.version=1.9.0
agp.version=7.1.3
compose.version=1.4.3
compose.version=1.5.0-beta02
1 change: 0 additions & 1 deletion examples/visual-effects/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ kotlin {
baseName = "shared"
isStatic = true
}
extraSpecAttributes["resources"] = "['src/commonMain/resources/**', 'src/iosMain/resources/**']"
}

sourceSets {
Expand Down
3 changes: 1 addition & 2 deletions examples/widgets-gallery/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ org.gradle.jvmargs=-Xmx3g
org.jetbrains.compose.experimental.jscanvas.enabled=true
org.jetbrains.compose.experimental.macos.enabled=true
org.jetbrains.compose.experimental.uikit.enabled=true
kotlin.native.cacheKind=none
kotlin.native.useEmbeddableCompilerJar=true
kotlin.mpp.androidSourceSetLayoutVersion=2
# Enable kotlin/native experimental memory model
kotlin.native.binary.memoryModel=experimental
kotlin.version=1.9.0
agp.version=7.1.3
compose.version=1.4.3
compose.version=1.5.0-beta02
1 change: 0 additions & 1 deletion examples/widgets-gallery/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ kotlin {
baseName = "shared"
isStatic = true
}
extraSpecAttributes["resources"] = "['src/commonMain/resources/**', 'src/iosMain/resources/**']"
}

sourceSets {
Expand Down
Loading

0 comments on commit c76448b

Please sign in to comment.