Browse Source

Migrate to 1.2.0-rc01 (#2382)

pull/2387/head
Igor Demin 2 years ago committed by GitHub
parent
commit
7ad4492f43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      ci/compose-uber-jar/gradle.properties
  2. 4
      components/gradle.properties
  3. 4
      examples/codeviewer/gradle.properties
  4. 4
      examples/falling-balls/gradle.properties
  5. 3
      examples/imageviewer/common/src/commonMain/kotlin/example/imageviewer/view/Draggable.kt
  6. 10
      examples/imageviewer/common/src/desktopMain/kotlin/example/imageviewer/model/DesktopContentState.kt
  7. 6
      examples/imageviewer/common/src/desktopMain/kotlin/example/imageviewer/view/MainScreen.kt
  8. 12
      examples/imageviewer/common/src/desktopMain/kotlin/example/imageviewer/view/Toast.kt
  9. 4
      examples/imageviewer/gradle.properties
  10. 4
      examples/intellij-plugin/gradle.properties
  11. 4
      examples/issues/gradle.properties
  12. 4
      examples/notepad/gradle.properties
  13. 4
      examples/todoapp-lite/gradle.properties
  14. 2
      examples/todoapp/common/compose-ui/src/commonMain/kotlin/example/todo/common/ui/TodoEditUi.kt
  15. 4
      examples/todoapp/desktop/src/jvmMain/kotlin/example/todo/desktop/Main.kt
  16. 4
      examples/todoapp/gradle.properties
  17. 4
      examples/visual-effects/gradle.properties
  18. 2
      examples/web-compose-bird/gradle.properties
  19. 2
      examples/web-compose-in-js/gradle.properties
  20. 2
      examples/web-landing/gradle.properties
  21. 2
      examples/web-with-react/gradle.properties
  22. 4
      examples/widgets-gallery/gradle.properties
  23. 2
      gradle-plugins/gradle.properties
  24. 4
      templates/desktop-template/gradle.properties
  25. 4
      templates/multiplatform-template/gradle.properties
  26. 2
      templates/web-template/gradle.properties
  27. 4
      tutorials/Getting_Started/README.md
  28. 2
      tutorials/Web/Getting_Started/README.md
  29. 2
      web/gradle.properties

2
ci/compose-uber-jar/gradle.properties

@ -1,2 +1,2 @@
compose.version=1.2.0-beta02
compose.version=1.2.0-rc01
kotlin.code.style=official

4
components/gradle.properties

@ -3,6 +3,6 @@ android.useAndroidX=true
android.enableJetifier=true
kotlin.code.style=official
# __KOTLIN_COMPOSE_VERSION__
kotlin.version=1.7.10
kotlin.version=1.7.20
# __LATEST_COMPOSE_RELEASE_VERSION__
compose.version=1.2.0-beta02
compose.version=1.2.0-rc01

4
examples/codeviewer/gradle.properties

@ -19,6 +19,6 @@ android.useAndroidX=true
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
kotlin.version=1.7.10
kotlin.version=1.7.20
agp.version=7.1.3
compose.version=1.2.0-beta02
compose.version=1.2.0-rc01

4
examples/falling-balls/gradle.properties

@ -1,3 +1,3 @@
kotlin.code.style=official
kotlin.version=1.7.10
compose.version=1.2.0-beta02
kotlin.version=1.7.20
compose.version=1.2.0-rc01

3
examples/imageviewer/common/src/commonMain/kotlin/example/imageviewer/view/Draggable.kt

@ -4,7 +4,6 @@ import androidx.compose.foundation.gestures.detectDragGestures
import androidx.compose.material.Surface
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.ui.input.pointer.consumePositionChange
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
@ -28,7 +27,7 @@ fun Draggable(
) { change, dragAmount ->
dragHandler.drag(dragAmount)
onUpdate?.invoke()
change.consumePositionChange()
change.consume()
}
}
) {

10
examples/imageviewer/common/src/desktopMain/kotlin/example/imageviewer/model/DesktopContentState.kt

@ -3,8 +3,8 @@ package example.imageviewer.model
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.mutableStateOf
import androidx.compose.ui.window.WindowState
import androidx.compose.ui.graphics.asImageBitmap
import androidx.compose.ui.graphics.ImageBitmap
import androidx.compose.ui.graphics.toComposeImageBitmap
import example.imageviewer.ResString
import example.imageviewer.core.FilterType
import example.imageviewer.model.filtration.FiltersManager
@ -18,13 +18,9 @@ import example.imageviewer.utils.cropBitmapByScale
import example.imageviewer.utils.toByteArray
import java.awt.image.BufferedImage
import java.io.File
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import org.jetbrains.skia.Image
object ContentState {
@ -250,7 +246,7 @@ object ContentState {
drag
)
)
).asImageBitmap()
).toComposeImageBitmap()
}
fun swipeNext() {
@ -358,7 +354,7 @@ private object MainImageWrapper {
}
private fun copy(bitmap: BufferedImage) : BufferedImage {
var result = BufferedImage(bitmap.width, bitmap.height, bitmap.type)
val result = BufferedImage(bitmap.width, bitmap.height, bitmap.type)
val graphics = result.createGraphics()
graphics.drawImage(bitmap, 0, 0, result.width, result.height, null)
return result

6
examples/imageviewer/common/src/desktopMain/kotlin/example/imageviewer/view/MainScreen.kt

@ -16,7 +16,6 @@ import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.interaction.collectIsHoveredAsState
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.Card
import androidx.compose.material.CircularProgressIndicator
import androidx.compose.material.Divider
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
@ -24,13 +23,12 @@ import androidx.compose.material.Text
import androidx.compose.material.TopAppBar
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.asImageBitmap
import androidx.compose.ui.graphics.painter.BitmapPainter
import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.graphics.toComposeImageBitmap
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.unit.dp
import example.imageviewer.ResString
@ -169,7 +167,7 @@ fun Miniature(
Image(
org.jetbrains.skia.Image.makeFromEncoded(
toByteArray(picture.image)
).asImageBitmap(),
).toComposeImageBitmap(),
contentDescription = null,
modifier = Modifier.height(70.dp)
.width(90.dp)

12
examples/imageviewer/common/src/desktopMain/kotlin/example/imageviewer/view/Toast.kt

@ -7,18 +7,13 @@ import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Surface
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import example.imageviewer.style.Foreground
import example.imageviewer.style.ToastBackground
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
enum class ToastDuration(val value: Int) {
Short(1000), Long(3000)
@ -53,14 +48,11 @@ fun Toast(
color = Foreground
)
}
DisposableEffect(Unit) {
GlobalScope.launch {
LaunchedEffect(Unit) {
delay(duration.value.toLong())
isShown = false
visibility.value = false
}
onDispose { }
}
}
}
}

4
examples/imageviewer/gradle.properties

@ -19,6 +19,6 @@ android.useAndroidX=true
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
kotlin.version=1.7.10
kotlin.version=1.7.20
agp.version=7.1.3
compose.version=1.2.0-beta02
compose.version=1.2.0-rc01

4
examples/intellij-plugin/gradle.properties

@ -1,3 +1,3 @@
kotlin.code.style=official
kotlin.version=1.7.10
compose.version=1.2.0-beta02
kotlin.version=1.7.20
compose.version=1.2.0-rc01

4
examples/issues/gradle.properties

@ -19,6 +19,6 @@ kotlin.code.style=official
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
kotlin.version=1.7.10
kotlin.version=1.7.20
agp.version=7.1.3
compose.version=1.2.0-beta02
compose.version=1.2.0-rc01

4
examples/notepad/gradle.properties

@ -1,4 +1,4 @@
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
kotlin.code.style=official
kotlin.version=1.7.10
compose.version=1.2.0-beta02
kotlin.version=1.7.20
compose.version=1.2.0-rc01

4
examples/todoapp-lite/gradle.properties

@ -19,6 +19,6 @@ android.useAndroidX=true
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
kotlin.version=1.7.10
kotlin.version=1.7.20
agp.version=7.1.3
compose.version=1.2.0-beta02
compose.version=1.2.0-rc01

2
examples/todoapp/common/compose-ui/src/commonMain/kotlin/example/todo/common/ui/TodoEditUi.kt

@ -46,7 +46,7 @@ fun TodoEditContent(component: TodoEdit) {
onValueChange = component::onTextChanged
)
Row(modifier = Modifier.padding(8.dp)) {
Row(modifier = Modifier.padding(8.dp), verticalAlignment = Alignment.CenterVertically) {
Text(text = "Completed")
Spacer(modifier = Modifier.width(8.dp))

4
examples/todoapp/desktop/src/jvmMain/kotlin/example/todo/desktop/Main.kt

@ -1,6 +1,5 @@
package example.todo.desktop
import androidx.compose.desktop.DesktopTheme
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
@ -11,7 +10,6 @@ import androidx.compose.ui.window.rememberWindowState
import com.arkivanov.decompose.ComponentContext
import com.arkivanov.decompose.DefaultComponentContext
import com.arkivanov.decompose.extensions.compose.jetbrains.lifecycle.LifecycleController
import com.arkivanov.decompose.extensions.compose.jetbrains.rememberRootComponent
import com.arkivanov.essenty.lifecycle.LifecycleRegistry
import com.arkivanov.mvikotlin.main.store.DefaultStoreFactory
import com.badoo.reaktive.coroutinesinterop.asScheduler
@ -40,13 +38,11 @@ fun main() {
) {
Surface(modifier = Modifier.fillMaxSize()) {
MaterialTheme {
DesktopTheme {
TodoRootContent(root)
}
}
}
}
}
}
private fun todoRoot(componentContext: ComponentContext): TodoRoot =

4
examples/todoapp/gradle.properties

@ -22,7 +22,5 @@ kotlin.code.style=official
org.gradle.parallel=true
org.gradle.caching=true
kotlin.native.disableCompilerDaemon=true
#todo remove -Pkotlin.version=1.6.20 from Xcode project, when stable version on Compose with Koltin 1.6.20 or later released
kotlin.version=1.7.10
compose.version=1.2.0-beta02
compose.version=1.2.0-rc01

4
examples/visual-effects/gradle.properties

@ -1,3 +1,3 @@
kotlin.code.style=official
kotlin.version=1.7.10
compose.version=1.2.0-beta02
kotlin.version=1.7.20
compose.version=1.2.0-rc01

2
examples/web-compose-bird/gradle.properties

@ -1,3 +1,3 @@
kotlin.code.style=official
kotlin.version=1.7.10
compose.version=1.2.0-beta02
compose.version=1.2.0-rc01

2
examples/web-compose-in-js/gradle.properties

@ -3,4 +3,4 @@ kotlin.mpp.enableGranularSourceSetsMetadata=true
kotlin.native.enableDependencyPropagation=false
kotlin.js.webpack.major.version=4
kotlin.version=1.7.10
compose.version=1.2.0-beta02
compose.version=1.2.0-rc01

2
examples/web-landing/gradle.properties

@ -1,3 +1,3 @@
kotlin.code.style=official
kotlin.version=1.7.10
compose.version=1.2.0-beta02
compose.version=1.2.0-rc01

2
examples/web-with-react/gradle.properties

@ -1,3 +1,3 @@
kotlin.code.style=official
kotlin.version=1.7.10
compose.version=1.2.0-beta02
compose.version=1.2.0-rc01

4
examples/widgets-gallery/gradle.properties

@ -19,6 +19,6 @@ android.useAndroidX=true
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
kotlin.version=1.7.10
compose.version=1.2.0-beta02
kotlin.version=1.7.20
compose.version=1.2.0-rc01
agp.version=7.1.3

2
gradle-plugins/gradle.properties

@ -2,7 +2,7 @@ org.gradle.parallel=true
kotlin.code.style=official
# Default version of Compose Libraries used by Gradle plugin
compose.version=1.2.0-beta02
compose.version=1.2.0-rc01
# The latest version of Compose Compiler used by Gradle plugin. Used only in tests.
compose.tests.compiler.version=1.3.2
# The latest version of Kotlin compatible with compose.tests.compiler.version. Used only in tests.

4
templates/desktop-template/gradle.properties

@ -1,4 +1,4 @@
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
kotlin.code.style=official
kotlin.version=1.7.10
compose.version=1.2.0-beta02
kotlin.version=1.7.20
compose.version=1.2.0-rc01

4
templates/multiplatform-template/gradle.properties

@ -2,6 +2,6 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
android.useAndroidX=true
android.enableJetifier=true
kotlin.code.style=official
kotlin.version=1.7.10
kotlin.version=1.7.20
agp.version=7.1.3
compose.version=1.2.0-beta02
compose.version=1.2.0-rc01

2
templates/web-template/gradle.properties

@ -1,4 +1,4 @@
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
kotlin.code.style=official
kotlin.version=1.7.10
compose.version=1.2.0-beta02
compose.version=1.2.0-rc01

4
tutorials/Getting_Started/README.md

@ -45,7 +45,7 @@ For the latest versions, see the [latest versions](https://github.com/JetBrains/
```
plugins {
kotlin("jvm") version "1.6.10"
id("org.jetbrains.compose") version "1.2.0-beta02"
id("org.jetbrains.compose") version "1.2.0-rc01"
}
```
@ -81,7 +81,7 @@ import org.jetbrains.compose.compose
plugins {
kotlin("jvm") version "1.6.10"
id("org.jetbrains.compose") version "1.2.0-beta02"
id("org.jetbrains.compose") version "1.2.0-rc01"
}
repositories {

2
tutorials/Web/Getting_Started/README.md

@ -39,7 +39,7 @@ pluginManagement {
// Add compose gradle plugin
plugins {
kotlin("multiplatform") version "1.6.10"
id("org.jetbrains.compose") version "1.2.0-beta02"
id("org.jetbrains.compose") version "1.2.0-rc01"
}
// Add maven repositories

2
web/gradle.properties

@ -1,4 +1,4 @@
compose.version=1.2.0-beta02
compose.version=1.2.0-rc01
compose.web.buildSamples=false
compose.web.tests.integration.withFirefox
compose.web.tests.skip.benchmarks=false

Loading…
Cancel
Save