Browse Source

Move to build 0.3.1.

pull/455/head 0.4.0-build171
Nikolay Igotti 4 years ago
parent
commit
1999f58e75
  1. 2
      ci/compose-uber-jar/gradle.properties
  2. 7
      components/SplitPane/common/src/commonMain/kotlin/org/jetbrains/compose/splitpane/SplitPaneDSL.kt
  3. 9
      components/SplitPane/common/src/commonMain/kotlin/org/jetbrains/compose/splitpane/SplitPaneState.kt
  4. 6
      components/VideoPlayer/common/src/desktopMain/kotlin/org/jetbrains/compose/videoplayer/DesktopVideoPlayer.kt
  5. 2
      components/build.gradle.kts
  6. 2
      examples/codeviewer/common/build.gradle.kts
  7. 2
      examples/imageviewer/common/build.gradle.kts
  8. 2
      examples/intelliJPlugin/build.gradle.kts
  9. 2
      examples/issues/common/build.gradle.kts
  10. 4
      examples/todoapp/buildSrc/buildSrc/src/main/kotlin/Deps.kt
  11. 2
      examples/todoapp/buildSrc/src/main/kotlin/multiplatform-compose-setup.gradle.kts
  12. 2
      examples/widgetsgallery/common/build.gradle.kts
  13. 2
      gradle-plugins/gradle.properties
  14. 2
      templates/desktop-template/build.gradle.kts
  15. 2
      templates/multiplatform-template/build.gradle.kts
  16. 2
      templates/multiplatform-template/common/build.gradle.kts
  17. 12
      tools/replace.sh

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

@ -1,3 +1,3 @@
# __LATEST_COMPOSE_RELEASE_VERSION__
compose.version=0.3.0
compose.version=0.3.1
kotlin.code.style=official

7
components/SplitPane/common/src/commonMain/kotlin/org/jetbrains/compose/splitpane/SplitPaneDSL.kt

@ -1,6 +1,5 @@
package org.jetbrains.compose.splitpane
import androidx.compose.foundation.InteractionState
import androidx.compose.foundation.gestures.detectDragGestures
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
@ -178,14 +177,12 @@ internal class SplitPaneScopeImpl(
@Composable
fun rememberSplitPaneState(
initialPositionPercentage: Float = 0f,
moveEnabled: Boolean = true,
interactionState: InteractionState = remember { InteractionState() }
moveEnabled: Boolean = true
): SplitPaneState {
return remember {
SplitPaneState(
moveEnabled = moveEnabled,
initialPositionPercentage = initialPositionPercentage,
interactionState = interactionState
initialPositionPercentage = initialPositionPercentage
)
}
}

9
components/SplitPane/common/src/commonMain/kotlin/org/jetbrains/compose/splitpane/SplitPaneState.kt

@ -1,7 +1,9 @@
package org.jetbrains.compose.splitpane
import androidx.compose.foundation.Interaction
import androidx.compose.foundation.InteractionState
import androidx.compose.foundation.interaction.Interaction
import androidx.compose.foundation.interaction.InteractionSource
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.interaction.collectIsDraggedAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
@ -10,7 +12,6 @@ import androidx.compose.runtime.setValue
class SplitPaneState(
initialPositionPercentage: Float,
moveEnabled: Boolean,
private val interactionState: InteractionState
) {
var moveEnabled by mutableStateOf(moveEnabled)
@ -24,13 +25,11 @@ class SplitPaneState(
internal var maxPosition: Float = Float.POSITIVE_INFINITY
fun dispatchRawMovement(delta: Float) {
interactionState.addInteraction(Interaction.Dragged)
val movableArea = maxPosition - minPosition
if (movableArea > 0) {
positionPercentage =
((movableArea * positionPercentage) + delta).coerceIn(minPosition, maxPosition) / movableArea
}
interactionState.removeInteraction(Interaction.Dragged)
}
}

6
components/VideoPlayer/common/src/desktopMain/kotlin/org/jetbrains/compose/videoplayer/DesktopVideoPlayer.kt

@ -4,6 +4,8 @@ import androidx.compose.desktop.SwingPanel
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
import androidx.compose.runtime.SideEffect
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCompositionContext
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import uk.co.caprica.vlcj.factory.discovery.NativeDiscovery
@ -14,7 +16,7 @@ internal actual fun VideoPlayerImpl(url: String, width: Int, height: Int) {
println("Video player for $url")
NativeDiscovery().discover()
// Doesn't work on macOS, see https://github.com/caprica/vlcj/issues/887 for suggestions.
val mediaPlayerComponent = EmbeddedMediaPlayerComponent()
val mediaPlayerComponent = remember { EmbeddedMediaPlayerComponent() }
SideEffect {
val ok = mediaPlayerComponent.mediaPlayer().media().play(url)
println("play gave $ok")
@ -22,7 +24,7 @@ internal actual fun VideoPlayerImpl(url: String, width: Int, height: Int) {
return SwingPanel(
background = Color.Transparent,
modifier = Modifier.fillMaxSize(),
componentBlock = {
factory = {
mediaPlayerComponent
}
)

2
components/build.gradle.kts

@ -1,6 +1,6 @@
buildscript {
// __LATEST_COMPOSE_RELEASE_VERSION__
val composeVersion = System.getenv("COMPOSE_RELEASE_VERSION") ?: "0.3.0-build150"
val composeVersion = System.getenv("COMPOSE_RELEASE_VERSION") ?: "0.3.1"
repositories {
google()

2
examples/codeviewer/common/build.gradle.kts

@ -22,7 +22,7 @@ kotlin {
named("androidMain") {
kotlin.srcDirs("src/jvmMain/kotlin")
dependencies {
api("androidx.appcompat:appcompat:1.1.0")
api("androidx.appcompat:appcompat:1.3.0-beta01")
api("androidx.core:core-ktx:1.3.1")
}
}

2
examples/imageviewer/common/build.gradle.kts

@ -20,7 +20,7 @@ kotlin {
}
named("androidMain") {
dependencies {
api("androidx.appcompat:appcompat:1.1.0")
api("androidx.appcompat:appcompat:1.3.0-beta01")
api("androidx.core:core-ktx:1.3.1")
implementation("io.ktor:ktor-client-cio:1.4.1")
}

2
examples/intelliJPlugin/build.gradle.kts

@ -5,7 +5,7 @@ plugins {
java
kotlin("jvm") version "1.4.30"
// __LATEST_COMPOSE_RELEASE_VERSION__
id("org.jetbrains.compose") version "0.3.0"
id("org.jetbrains.compose") version "0.3.1"
}
group = "org.example"

2
examples/issues/common/build.gradle.kts

@ -24,7 +24,7 @@ kotlin {
named("androidMain") {
kotlin.srcDirs("src/jvmAndAndroidMain/kotlin")
dependencies {
api("androidx.appcompat:appcompat:1.1.0")
api("androidx.appcompat:appcompat:1.3.0-beta01")
api("androidx.core:core-ktx:1.3.1")
}
}

4
examples/todoapp/buildSrc/buildSrc/src/main/kotlin/Deps.kt

@ -12,7 +12,7 @@ object Deps {
object Compose {
// __LATEST_COMPOSE_RELEASE_VERSION__
private const val VERSION = "0.4.0-build168"
private const val VERSION = "0.3.1"
const val gradlePlugin = "org.jetbrains.compose:compose-gradle-plugin:$VERSION"
}
}
@ -27,7 +27,7 @@ object Deps {
object AndroidX {
object AppCompat {
const val appCompat = "androidx.appcompat:appcompat:1.1.0"
const val appCompat = "androidx.appcompat:appcompat:1.3.0-beta01"
}
object Activity {

2
examples/todoapp/buildSrc/src/main/kotlin/multiplatform-compose-setup.gradle.kts

@ -21,7 +21,7 @@ kotlin {
named("androidMain") {
dependencies {
implementation("androidx.appcompat:appcompat:1.1.0")
implementation("androidx.appcompat:appcompat:1.3.0-beta01")
implementation("androidx.core:core-ktx:1.3.1")
}
}

2
examples/widgetsgallery/common/build.gradle.kts

@ -22,7 +22,7 @@ kotlin {
named("androidMain") {
kotlin.srcDirs("src/jvmMain/kotlin")
dependencies {
api("androidx.appcompat:appcompat:1.1.0")
api("androidx.appcompat:appcompat:1.3.0-beta01")
api("androidx.core:core-ktx:1.3.1")
}
}

2
gradle-plugins/gradle.properties

@ -6,7 +6,7 @@ kotlin.code.style=official
# unless overridden by COMPOSE_GRADLE_PLUGIN_COMPOSE_VERSION env var.
#
# __LATEST_COMPOSE_RELEASE_VERSION__
compose.version=0.3.0
compose.version=0.3.1
# A version of Gradle plugin, that will be published,
# unless overridden by COMPOSE_GRADLE_PLUGIN_VERSION env var.

2
templates/desktop-template/build.gradle.kts

@ -5,7 +5,7 @@ plugins {
// __KOTLIN_COMPOSE_VERSION__
kotlin("jvm") version "1.4.30"
// __LATEST_COMPOSE_RELEASE_VERSION__
id("org.jetbrains.compose") version (System.getenv("COMPOSE_TEMPLATE_COMPOSE_VERSION") ?: "0.3.0")
id("org.jetbrains.compose") version (System.getenv("COMPOSE_TEMPLATE_COMPOSE_VERSION") ?: "0.3.1")
}
repositories {

2
templates/multiplatform-template/build.gradle.kts

@ -1,6 +1,6 @@
buildscript {
// __LATEST_COMPOSE_RELEASE_VERSION__
val composeVersion = System.getenv("COMPOSE_TEMPLATE_COMPOSE_VERSION") ?: "0.3.0"
val composeVersion = System.getenv("COMPOSE_TEMPLATE_COMPOSE_VERSION") ?: "0.3.1"
repositories {
// TODO: remove after new build is published

2
templates/multiplatform-template/common/build.gradle.kts

@ -20,7 +20,7 @@ kotlin {
}
named("androidMain") {
dependencies {
api("androidx.appcompat:appcompat:1.1.0")
api("androidx.appcompat:appcompat:1.3.0-beta01")
api("androidx.core:core-ktx:1.3.1")
}
}

12
tools/replace.sh

@ -1,3 +1,9 @@
OLDVER=0.3.0-rc1
NEWVER=0.3.0
find -E ../ -regex '.*\.(kts|properties|kt)' -exec sed -i '' -e "s/$OLDVER/$NEWVER/g" {} \;
#!/bin/bash
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/..
COMPOSE_OLDVER=0.3.0
COMPOSE_NEWVER=0.3.1
find -E $ROOT -regex '.*\.(kts|properties|kt)' -exec sed -i '' -e "s/$COMPOSE_OLDVER/$COMPOSE_NEWVER/g" {} \;
APPCOMPAT_OLDVER=1.1.0
APPCOMPAT_NEWVER=1.3.0-beta01
find -E $ROOT -regex '.*\.(kts|properties|kt)' -exec sed -i '' -e "s/$APPCOMPAT_OLDVER/$APPCOMPAT_NEWVER/g" {} \;

Loading…
Cancel
Save