Skip to content

Commit

Permalink
Compose 1.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Foso committed Sep 7, 2024
1 parent d464740 commit bd90acd
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 39 deletions.
23 changes: 12 additions & 11 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ tasks.withType<KotlinCompile>().configureEach {
)
}
}
val compose_version = "1.6.7"
val compose_version = libs.versions.compose.version.get()

dependencies {
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
implementation("androidx.activity:activity-compose:1.9.0")
implementation("androidx.activity:activity-compose:1.9.2")
implementation("androidx.appcompat:appcompat:1.7.0")
implementation("androidx.compose.animation:animation-core:$compose_version")
implementation("androidx.compose.animation:animation:$compose_version")
Expand All @@ -75,7 +76,7 @@ dependencies {
implementation("androidx.compose.ui:ui-tooling:$compose_version")
implementation("androidx.compose.ui:ui:$compose_version")
implementation("androidx.core:core-ktx:1.13.1")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.1")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.5")
implementation("com.google.android.material:material:1.12.0")
implementation("androidx.compose.ui:ui-viewbinding:$compose_version")
implementation("androidx.compose.ui:ui-text:$compose_version")
Expand All @@ -84,17 +85,17 @@ dependencies {
implementation("androidx.constraintlayout:constraintlayout-compose:1.0.1")

testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
androidTestImplementation("androidx.test:runner:1.5.2")
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
androidTestImplementation("androidx.test:runner:1.6.2")
androidTestImplementation("androidx.compose.ui:ui-test-junit4:$compose_version")
androidTestImplementation("androidx.compose.ui:ui-test:$compose_version")
androidTestImplementation("androidx.test.espresso:espresso-intents:3.5.1")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test:core:1.5.0")
androidTestImplementation("androidx.test:rules:1.5.0")
androidTestImplementation("androidx.test:runner:1.5.2")
androidTestImplementation("androidx.test.espresso:espresso-intents:3.6.1")
androidTestImplementation("androidx.test.ext:junit:1.2.1")
androidTestImplementation("androidx.test:core:1.6.1")
androidTestImplementation("androidx.test:rules:1.6.1")
androidTestImplementation("androidx.test:runner:1.6.2")
androidTestImplementation("com.android.support.test.espresso:espresso-core:3.0.2")
androidTestImplementation("org.mockito:mockito-core:5.3.1")
androidTestImplementation("org.mockito:mockito-core:5.12.0")
debugImplementation("androidx.compose.ui:ui-test-manifest:$compose_version")

androidTestImplementation("com.adevinta.android:barista:4.3.0") {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package de.jensklingenberg.jetpackcomposeplayground.mysamples.github.foundation.basictextfield

import androidx.activity.compose.BackHandler
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.text.BasicTextField
import androidx.compose.material.Text
import androidx.compose.runtime.*
import androidx.compose.ui.text.input.TextFieldValue

//# --8<-- [start:func]
@Composable
fun BasicTextFieldDemo() {
var textState by remember { mutableStateOf(TextFieldValue("Hello World")) }
Expand All @@ -15,4 +17,5 @@ fun BasicTextFieldDemo() {
})
Text("The textfield has this text: " + textState.text)
}
}
}
//# --8<-- [end:func]
14 changes: 3 additions & 11 deletions build.gradle → build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.


buildscript {
ext {
compose_version = '1.6.7'
kotlin_version = "2.0.0"
}

repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.0.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath("com.android.tools.build:gradle:8.6.0")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${libs.versions.kotlin.get()}")

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

tasks.register('clean', Delete) {
delete rootProject.buildDir
}

11 changes: 1 addition & 10 deletions docs/foundation/basictextfield.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,7 @@ BasicTextField can be used to insert text. See [TextField](../material/textfield
</p>

```kotlin
@Composable
fun BasicTextFieldDemo() {
var textState by remember { mutableStateOf(TextFieldValue("Hello World")) }
Column {
BasicTextField(value = textState, onValueChange = {
textState = it
})
Text("The textfield has this text: " + textState.text)
}
}
--8<-- "foundation/basictextfield/BasicTextFieldDemo.kt:func"
```

-------------
Expand Down
10 changes: 4 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
[versions]
kotlin = "2.0.0"
compose_version = "1.6.7"
[plugins]
org-jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }

kotlin = "2.0.20"
compose_version = "1.7.0"

compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
[plugins]
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }

0 comments on commit bd90acd

Please sign in to comment.