Browse Source

Move ImageViewer to build149 and Kotlin 1.4.30.

pull/351/head
Roman Sedaikin 4 years ago
parent
commit
11e153736c
  1. 4
      examples/imageviewer/build.gradle.kts
  2. 7
      examples/imageviewer/common/src/desktopMain/kotlin/example/imageviewer/view/FullImageScreen.kt
  3. 6
      examples/imageviewer/common/src/desktopMain/kotlin/example/imageviewer/view/MainScreen.kt

4
examples/imageviewer/build.gradle.kts

@ -11,10 +11,10 @@ buildscript {
dependencies {
// __LATEST_COMPOSE_RELEASE_VERSION__
classpath("org.jetbrains.compose:compose-gradle-plugin:0.3.0-build146")
classpath("org.jetbrains.compose:compose-gradle-plugin:0.3.0-build149")
classpath("com.android.tools.build:gradle:4.0.1")
// __KOTLIN_COMPOSE_VERSION__
classpath(kotlin("gradle-plugin", version = "1.4.21-2"))
classpath(kotlin("gradle-plugin", version = "1.4.30"))
}
}

7
examples/imageviewer/common/src/desktopMain/kotlin/example/imageviewer/view/FullImageScreen.kt

@ -1,8 +1,8 @@
package example.imageviewer.view
import androidx.compose.foundation.Image
import androidx.compose.foundation.ScrollableRow
import androidx.compose.foundation.background
import androidx.compose.foundation.horizontalScroll
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
@ -12,6 +12,8 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.preferredHeight
import androidx.compose.foundation.layout.preferredSize
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.ScrollState
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.CircularProgressIndicator
import androidx.compose.material.MaterialTheme
@ -142,7 +144,8 @@ fun setToolBar(
.align(Alignment.CenterVertically),
shape = CircleShape
) {
ScrollableRow {
val state = rememberScrollState(0f)
Row(modifier = Modifier.horizontalScroll(state)) {
Row {
for (type in FilterType.values()) {
FilterButton(content, type)

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

@ -1,7 +1,6 @@
package example.imageviewer.view
import androidx.compose.foundation.Image
import androidx.compose.foundation.ScrollableColumn
import androidx.compose.foundation.VerticalScrollbar
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
@ -20,7 +19,10 @@ import androidx.compose.foundation.layout.preferredSize
import androidx.compose.foundation.layout.preferredWidth
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.rememberScrollbarAdapter
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.ScrollState
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.Card
import androidx.compose.material.CircularProgressIndicator
import androidx.compose.material.Divider
@ -269,7 +271,7 @@ fun setScrollableArea(content: ContentState) {
.padding(end = 8.dp)
) {
val stateVertical = rememberScrollState(0f)
ScrollableColumn(scrollState = stateVertical) {
Column(modifier = Modifier.verticalScroll(stateVertical)) {
var index = 1
Column {
for (picture in content.getMiniatures()) {

Loading…
Cancel
Save