Browse Source

Move inteliJPlagin to 0.0.0-vsync-build30

pull/305/head
Roman Sedaikin 4 years ago
parent
commit
f1164d9cb1
  1. 4
      examples/intelliJPlugin/build.gradle.kts
  2. 12
      examples/intelliJPlugin/src/main/kotlin/com/jetbrains/compose/widgets/Buttons.kt
  3. 12
      examples/intelliJPlugin/src/main/kotlin/com/jetbrains/compose/widgets/LazyScrollable.kt
  4. 4
      examples/intelliJPlugin/src/main/kotlin/com/jetbrains/compose/widgets/Toggles.kt

4
examples/intelliJPlugin/build.gradle.kts

@ -3,8 +3,8 @@ import org.jetbrains.compose.compose
plugins {
id("org.jetbrains.intellij") version "0.6.5"
java
kotlin("jvm") version "1.4.21"
id("org.jetbrains.compose") version "0.3.0-build139"
kotlin("jvm") version "1.4.21-2"
id("org.jetbrains.compose") version "0.0.0-vsync-build30"
}
group = "org.example"

12
examples/intelliJPlugin/src/main/kotlin/com/jetbrains/compose/widgets/Buttons.kt

@ -25,7 +25,11 @@ fun Buttons() {
modifier = Modifier.padding(8.dp),
enabled = btnEnabled.value
) {
Icon(Icons.Default.FavoriteBorder, modifier = Modifier.padding(end = 4.dp))
Icon(
imageVector = Icons.Default.FavoriteBorder,
contentDescription = "FavoriteBorder",
modifier = Modifier.padding(end = 4.dp)
)
Text(text = "Button")
}
val btnTextEnabled = remember { mutableStateOf(true) }
@ -43,7 +47,11 @@ fun Buttons() {
},
modifier = Modifier.padding(8.dp)
) {
Icon(Icons.Default.Refresh, modifier = Modifier.padding(0.dp))
Icon(
imageVector = Icons.Default.Refresh,
contentDescription = "Refresh",
modifier = Modifier.padding(0.dp)
)
}
}
}

12
examples/intelliJPlugin/src/main/kotlin/com/jetbrains/compose/widgets/LazyScrollable.kt

@ -5,11 +5,17 @@ import androidx.compose.foundation.background
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.rememberScrollbarAdapter
import androidx.compose.foundation.Text
import androidx.compose.foundation.VerticalScrollbar
import androidx.compose.material.Text
import androidx.compose.material.MaterialTheme
import androidx.compose.foundation.layout.*
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.graphics.Color
@ -31,7 +37,7 @@ fun LazyScrollable() {
val itemCount = 100
LazyColumn(Modifier.fillMaxSize().padding(end = 12.dp), state) {
items((1..itemCount).toList()) { x ->
items(itemCount) { x ->
TextBox("Item in ScrollableColumn #$x")
Spacer(modifier = Modifier.height(5.dp))
}

4
examples/intelliJPlugin/src/main/kotlin/com/jetbrains/compose/widgets/Toggles.kt

@ -11,7 +11,7 @@ import androidx.compose.material.MaterialTheme
import androidx.compose.material.RadioButton
import androidx.compose.material.Slider
import androidx.compose.material.Switch
import androidx.compose.material.SwitchConstants
import androidx.compose.material.SwitchDefaults
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
@ -37,7 +37,7 @@ fun Toggles() {
var switched by remember { mutableStateOf(true) }
Switch(
checked = switched,
colors = SwitchConstants.defaultColors(checkedThumbColor = MaterialTheme.colors.primary),
colors = SwitchDefaults.colors(checkedThumbColor = MaterialTheme.colors.primary),
modifier = Modifier.padding(8.dp),
onCheckedChange = { switched = it }
)

Loading…
Cancel
Save