gpt4 book ai didi

android - 编写 : beta08 breaks clickable

转载 作者:行者123 更新时间:2023-12-04 01:02:10 25 4
gpt4 key购买 nike

<分区>

我有一个带有可扩展卡片 View 的可组合项。

@Composable
fun ItemCard() {
var isExpanded by remember { mutableStateOf(false) }
Card(modifier = Modifier.clickable {
isExpanded = !isExpanded
Log.d(TAG, "Expanded set to $isExpanded")
}) {
// regular card segment goes here
AnimatedVisibility (isExpanded) {
// expanded card segment goes here
}
}
}

因此,我将 compose 更新为 1.0.0-beta08 并且 Modifier.clickable 停止工作。

这里是依赖项:

implementation 'androidx.core:core-ktx:1.5.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.3.0'
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui-tooling:$compose_version"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
implementation 'androidx.activity:activity-compose:1.3.0-alpha08'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
implementation "androidx.navigation:navigation-compose:2.4.0-alpha01"
implementation "androidx.constraintlayout:constraintlayout-compose:1.0.0-alpha07"
implementation 'androidx.room:room-common:2.3.0'
implementation 'androidx.room:room-ktx:2.3.0'
implementation "androidx.room:room-runtime:2.3.0"
kapt "androidx.room:room-compiler:2.3.0"
implementation "androidx.compose.runtime:runtime-livedata:$compose_version"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.3.1"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.32"
api "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9"
api "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9"
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.5")

我所做的更改是将 compose 从 1.0.0-beta07 更改为 1.0.0-beta08 并且(根据 compose 更新的要求)更改 classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.32"classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.10"

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com