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. 18
      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. 6
      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 kotlin.code.style=official

4
components/gradle.properties

@ -3,6 +3,6 @@ android.useAndroidX=true
android.enableJetifier=true android.enableJetifier=true
kotlin.code.style=official kotlin.code.style=official
# __KOTLIN_COMPOSE_VERSION__ # __KOTLIN_COMPOSE_VERSION__
kotlin.version=1.7.10 kotlin.version=1.7.20
# __LATEST_COMPOSE_RELEASE_VERSION__ # __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 android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete": # Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official kotlin.code.style=official
kotlin.version=1.7.10 kotlin.version=1.7.20
agp.version=7.1.3 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.code.style=official
kotlin.version=1.7.10 kotlin.version=1.7.20
compose.version=1.2.0-beta02 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.material.Surface
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.mutableStateOf
import androidx.compose.ui.input.pointer.consumePositionChange
import androidx.compose.ui.input.pointer.pointerInput import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset import androidx.compose.ui.geometry.Offset
@ -28,7 +27,7 @@ fun Draggable(
) { change, dragAmount -> ) { change, dragAmount ->
dragHandler.drag(dragAmount) dragHandler.drag(dragAmount)
onUpdate?.invoke() 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.MutableState
import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.mutableStateOf
import androidx.compose.ui.window.WindowState import androidx.compose.ui.window.WindowState
import androidx.compose.ui.graphics.asImageBitmap
import androidx.compose.ui.graphics.ImageBitmap import androidx.compose.ui.graphics.ImageBitmap
import androidx.compose.ui.graphics.toComposeImageBitmap
import example.imageviewer.ResString import example.imageviewer.ResString
import example.imageviewer.core.FilterType import example.imageviewer.core.FilterType
import example.imageviewer.model.filtration.FiltersManager import example.imageviewer.model.filtration.FiltersManager
@ -18,13 +18,9 @@ import example.imageviewer.utils.cropBitmapByScale
import example.imageviewer.utils.toByteArray import example.imageviewer.utils.toByteArray
import java.awt.image.BufferedImage import java.awt.image.BufferedImage
import java.io.File import java.io.File
import java.util.concurrent.ExecutorService
import java.util.concurrent.Executors
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import org.jetbrains.skia.Image import org.jetbrains.skia.Image
object ContentState { object ContentState {
@ -250,7 +246,7 @@ object ContentState {
drag drag
) )
) )
).asImageBitmap() ).toComposeImageBitmap()
} }
fun swipeNext() { fun swipeNext() {
@ -358,7 +354,7 @@ private object MainImageWrapper {
} }
private fun copy(bitmap: BufferedImage) : BufferedImage { 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() val graphics = result.createGraphics()
graphics.drawImage(bitmap, 0, 0, result.width, result.height, null) graphics.drawImage(bitmap, 0, 0, result.width, result.height, null)
return result 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.interaction.collectIsHoveredAsState
import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.Card import androidx.compose.material.Card
import androidx.compose.material.CircularProgressIndicator
import androidx.compose.material.Divider import androidx.compose.material.Divider
import androidx.compose.material.MaterialTheme import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface import androidx.compose.material.Surface
@ -24,13 +23,12 @@ import androidx.compose.material.Text
import androidx.compose.material.TopAppBar import androidx.compose.material.TopAppBar
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.asImageBitmap
import androidx.compose.ui.graphics.painter.BitmapPainter import androidx.compose.ui.graphics.painter.BitmapPainter
import androidx.compose.ui.graphics.RectangleShape import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.graphics.toComposeImageBitmap
import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import example.imageviewer.ResString import example.imageviewer.ResString
@ -169,7 +167,7 @@ fun Miniature(
Image( Image(
org.jetbrains.skia.Image.makeFromEncoded( org.jetbrains.skia.Image.makeFromEncoded(
toByteArray(picture.image) toByteArray(picture.image)
).asImageBitmap(), ).toComposeImageBitmap(),
contentDescription = null, contentDescription = null,
modifier = Modifier.height(70.dp) modifier = Modifier.height(70.dp)
.width(90.dp) .width(90.dp)

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

4
examples/imageviewer/gradle.properties

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

4
examples/issues/gradle.properties

@ -19,6 +19,6 @@ kotlin.code.style=official
android.useAndroidX=true android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX # Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true android.enableJetifier=true
kotlin.version=1.7.10 kotlin.version=1.7.20
agp.version=7.1.3 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 org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
kotlin.code.style=official kotlin.code.style=official
kotlin.version=1.7.10 kotlin.version=1.7.20
compose.version=1.2.0-beta02 compose.version=1.2.0-rc01

4
examples/todoapp-lite/gradle.properties

@ -19,6 +19,6 @@ android.useAndroidX=true
android.enableJetifier=true android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete": # Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official kotlin.code.style=official
kotlin.version=1.7.10 kotlin.version=1.7.20
agp.version=7.1.3 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 onValueChange = component::onTextChanged
) )
Row(modifier = Modifier.padding(8.dp)) { Row(modifier = Modifier.padding(8.dp), verticalAlignment = Alignment.CenterVertically) {
Text(text = "Completed") Text(text = "Completed")
Spacer(modifier = Modifier.width(8.dp)) Spacer(modifier = Modifier.width(8.dp))

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

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

4
examples/todoapp/gradle.properties

@ -22,7 +22,5 @@ kotlin.code.style=official
org.gradle.parallel=true org.gradle.parallel=true
org.gradle.caching=true org.gradle.caching=true
kotlin.native.disableCompilerDaemon=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 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.code.style=official
kotlin.version=1.7.10 kotlin.version=1.7.20
compose.version=1.2.0-beta02 compose.version=1.2.0-rc01

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

@ -1,3 +1,3 @@
kotlin.code.style=official kotlin.code.style=official
kotlin.version=1.7.10 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.native.enableDependencyPropagation=false
kotlin.js.webpack.major.version=4 kotlin.js.webpack.major.version=4
kotlin.version=1.7.10 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.code.style=official
kotlin.version=1.7.10 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.code.style=official
kotlin.version=1.7.10 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 android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete": # Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official kotlin.code.style=official
kotlin.version=1.7.10 kotlin.version=1.7.20
compose.version=1.2.0-beta02 compose.version=1.2.0-rc01
agp.version=7.1.3 agp.version=7.1.3

2
gradle-plugins/gradle.properties

@ -2,7 +2,7 @@ org.gradle.parallel=true
kotlin.code.style=official kotlin.code.style=official
# Default version of Compose Libraries used by Gradle plugin # 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. # The latest version of Compose Compiler used by Gradle plugin. Used only in tests.
compose.tests.compiler.version=1.3.2 compose.tests.compiler.version=1.3.2
# The latest version of Kotlin compatible with compose.tests.compiler.version. Used only in tests. # 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 org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
kotlin.code.style=official kotlin.code.style=official
kotlin.version=1.7.10 kotlin.version=1.7.20
compose.version=1.2.0-beta02 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.useAndroidX=true
android.enableJetifier=true android.enableJetifier=true
kotlin.code.style=official kotlin.code.style=official
kotlin.version=1.7.10 kotlin.version=1.7.20
agp.version=7.1.3 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 org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
kotlin.code.style=official kotlin.code.style=official
kotlin.version=1.7.10 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 { plugins {
kotlin("jvm") version "1.6.10" 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 { plugins {
kotlin("jvm") version "1.6.10" 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 { repositories {

2
tutorials/Web/Getting_Started/README.md

@ -39,7 +39,7 @@ pluginManagement {
// Add compose gradle plugin // Add compose gradle plugin
plugins { plugins {
kotlin("multiplatform") version "1.6.10" 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 // 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.buildSamples=false
compose.web.tests.integration.withFirefox compose.web.tests.integration.withFirefox
compose.web.tests.skip.benchmarks=false compose.web.tests.skip.benchmarks=false

Loading…
Cancel
Save