Ash
03/28/2020, 12:15 AMPierfrancesco Gulinelli
03/29/2020, 11:29 AMbuildFeatures {
compose true
}
composeOptions {
kotlinCompilerVersion "1.3.61-dev-withExperimentalGoogleExtensions-20200129"
kotlinCompilerExtensionVersion "0.1.0-dev07"
}
on every module.
But when i try to run the project, it appears
Execution failed for task ':app:prepareDebugKotlinCompileTask'.
> org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions.setUseIR(Z)V
Zach Klippenstein (he/him) [MOD]
03/29/2020, 8:32 PMfindByText
and friends), but even really simple assertions fail unexpectedly. Are there any limitations around what the semantics/testing infra can handle? More in thread.Ash
03/29/2020, 11:24 PMclass ComposeFragment : Fragment() {
This worked in Dev05
(fragmentView as ViewGroup).setContent {
Greeting("hji", breatheData)
//materialContent()
}
@Composable
fun Greeting(name: String, BDdatat: MyData) {...}
I have spent the entire day making sure my build.gradle(s) are correct but I still get java.lang.NoSuchMethodError: No static method setContent(Landroid/view/ViewGroup;Lkotlin/jvm/functions/Function0;)Landroidx/compose/Composition; in class Landroidx/ui/core/WrapperKt; or its super classes (declaration of 'androidx.ui.core.WrapperKt
I did follow https://stackoverflow.com/questions/60615308/jetpack-compose-dev06-setcontent-doesnt-work but I am at my wit's end. Any suggestions?Kevin Hester
03/30/2020, 4:38 AMBrian Gardner
03/30/2020, 1:30 PMModalDrawerLayout
. I added it to my sample project and it is getting drawn under the TopAppBar
I have in the bodyContent
of the drawer. I thought it was just clipping to that size but once I added some content to the drawer and had it fit the width and height it’s clear the drawer is just being drawn under the app bar. This seems like a bug since it goes agains the material design spec but I just wanted to make sure I wasn’t doing anything silly. Screenshots in threadMikael Ohlson
03/31/2020, 10:26 PMmolikto
04/01/2020, 3:03 AMKevin Hester
04/01/2020, 7:35 PMsemoro
04/01/2020, 8:51 PMContentGravity.TopStart
, so it’s text became not centred properlySiyamed
04/01/2020, 8:53 PMVal Salamakha
04/01/2020, 11:16 PMKlaas Kabini
04/02/2020, 12:36 PMtypealias ComposableFunction = @Composable() () -> Unit
instead of just doing this. But the AS does not allow this
typealias ComposableFunction = @Composable () -> Unit
Klaas Kabini
04/02/2020, 12:54 PMKazemihabib1996
04/02/2020, 4:29 PMSurface(color = Color.Green) {
Row(modifier = Modifier.fillMaxWidth().gravity(RowAlign.Center)) {
Text("More", style = TextStyle(fontSize = 30.sp, color = Color(0xFFC7C7C7)))
Icon(Icons.Filled.ArrowForward, tint = Color(0xFFC7C7C7))
}
}
molikto
04/03/2020, 8:24 AMval s = state { 1 }
Text(s.value.toString())
remember {
s.value = s.value + 1
}
it seems on dev08, updating a mutable state in the same frame will not triger recomposition? Is this a bug? (expected text should be "2")Kazemihabib1996
04/03/2020, 12:19 PMBox(modifier = modifier.drawShadow(shape = RoundedCornerShape(5.dp), elevation = 1.dp), padding = 16.dp) {
Row(Modifier.fillMaxWidth()) {
TextField(value = model.text, onValueChange = { data -> model.text = data }, modifier = Modifier.weight(1f))
Icon(Icons.Filled.Search, tint = Color.Red)
}
}
Akram
04/03/2020, 5:41 PM@Composable
fun TravelPlaceCard(place:Place , modifier: Modifier = Modifier.None){
Column (modifier = modifier.preferredWidthIn(maxWidth = 150.dp)){
val imageModifier = Modifier.preferredHeight(180.dp).preferredWidth(150.dp).clip(RoundedCornerShape(4.dp))
Image(asset = place.image , modifier = imageModifier , scaleFit = ScaleFit.FillWidth)
Spacer(modifier = Modifier.preferredHeight(3.dp))
val emphasisLevels = EmphasisAmbient.current
ProvideEmphasis(emphasis = emphasisLevels.high) {
Text(text = place.name , style = MaterialTheme.typography.subtitle1 , modifier = Modifier.fillMaxWidth(), maxLines = 2 )
}
ProvideEmphasis(emphasis = emphasisLevels.medium) {
Text(text = place.location , style = MaterialTheme.typography.subtitle2 )
}
}
}
here is the resultSheroz Nazhmudinov
04/03/2020, 7:45 PMRow(modifier = Modifier.fillMaxHeight() + Modifier.fillMaxWidth()) {
if (stateChecked.value) {
VectorPainter(asset = vectorResource(id = R.drawable.ic_checkbox_on))
} else {
VectorPainter(asset = vectorResource(id = R.drawable.ic_checkbox_off))
}
}
However, it doesn’t show anything on the screen. Is that approach correct, at all?Kismet
04/04/2020, 2:32 AMjava.lang.NoSuchMethodError: No static method setContent(Landroid/app/Activity;Lkotlin/jvm/functions/Function0;)Landroidx/compose/Composition; in class Landroidx/ui/core/WrapperKt; or its super classes
I'd like to use 0.1.0-dev08
to play with AdapterList
.Joao Goes
04/04/2020, 2:48 AMBottomSheetDialogFragment
using compose. That dialog has a TextField
. When click in the TextField
, the keyboard appears and the dialog move to top of keyboard (The expected behavior) but if I press any letter of keyboard, the dialog move to bottom of screen, behind of the keyboard. Code on thread.Davide Giuseppe Farella
04/04/2020, 3:57 PMCould not find method buildFeatures() for arguments [build_dhfnkoskcgih70k6vzgxvfowr$_run_closure1$_closure3@32cc0cee] on extension 'android' of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension.
I’m on AS 4.1 canary 4, AGP 4.1 alpha 4, tried bot with Kotlin 1.3.61 and .60-eap76Bacho Kurtanidze
04/04/2020, 4:58 PMSheroz Nazhmudinov
04/04/2020, 6:49 PMstate {…}
? Is it smth that’s used to control the state of the UI? If possible with an example, pls.
AFAIK, the source of truth for the UI should be a model class (Model annotated class). Correct me if I’m wrong here.Val Salamakha
04/05/2020, 5:05 AMVlad Gorbunov
04/05/2020, 10:50 AMCard
inside AdapterList
For example this code:
@Composable
fun ArticleAdapterList(data: List<Article>) {
AdapterList(data = data) { item ->
Column {
Column {
Text(text = item.title)
Text(text = item.content.take(200))
}
}
}
}
works just fine, but once i change it to:
@Composable
fun ArticleAdapterList(data: List<Article>) {
AdapterList(data = data) { item ->
Card(shape = RoundedCornerShape(8.dp), elevation = 4.dp, modifier = Modifier.fillMaxWidth() + Modifier.padding(8.dp)) {
Column {
Text(text = item.title)
Text(text = item.content.take(200))
}
}
}
}
i am getting java.lang.IllegalStateException: Node should be attached to an owner
once i start scrolling
anyone with similar issue? ThanxKismet
04/05/2020, 2:20 PMjava.lang.IllegalStateException: Unable to fetch data. No fetcher supports:
at coil.ComponentRegistry.requireFetcher(ComponentRegistry.kt:70)
at coil.RealImageLoader$execute$2$deferred$1.invokeSuspend(RealImageLoader.kt:193)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:313)
at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:35)
at kotlinx.coroutines.LazyDeferredCoroutine.onStart(Builders.common.kt:112)
at kotlinx.coroutines.AbstractCoroutine.onStartInternal$kotlinx_coroutines_core(AbstractCoroutine.kt:75)
at kotlinx.coroutines.JobSupport.startInternal(JobSupport.kt:400)
at kotlinx.coroutines.JobSupport.awaitInternal$kotlinx_coroutines_core(JobSupport.kt:1217)
at kotlinx.coroutines.DeferredCoroutine.await$suspendImpl(Builders.common.kt:99)
at kotlinx.coroutines.DeferredCoroutine.await(Unknown Source:0)
at coil.RealImageLoader$execute$2.invokeSuspend(RealImageLoader.kt:258)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Akram
04/05/2020, 4:39 PMVinay Gaba
04/05/2020, 11:31 PMdagomni
04/06/2020, 6:45 AMstate.width(if (constraints.hasBoundedWidth) {
Dimension.Fixed(constraints.maxWidth.value)
} else {
Dimension.Wrap()
})
I'm guessing it would have to call Dimension.spread() in order for it to work in my case or am I wrong?dagomni
04/06/2020, 6:45 AMstate.width(if (constraints.hasBoundedWidth) {
Dimension.Fixed(constraints.maxWidth.value)
} else {
Dimension.Wrap()
})
I'm guessing it would have to call Dimension.spread() in order for it to work in my case or am I wrong?maciejciemiega
04/06/2020, 7:00 AMbottomNavigation constrainHorizontallyTo parent
inside a ConstraintSet
dagomni
04/06/2020, 7:03 AMval constraintSet = ConstraintSet {
val bottomNavTag = tag(bottomNav)
val viewsContainerTag = tag(viewsContainer)
<http://viewsContainerTag.top|viewsContainerTag.top> constrainTo <http://parent.top|parent.top>
viewsContainerTag.bottom constrainTo <http://bottomNavTag.top|bottomNavTag.top>
viewsContainerTag constrainHorizontallyTo parent
bottomNavTag.bottom constrainTo parent.bottom
bottomNavTag constrainHorizontallyTo parent
}
maciejciemiega
04/06/2020, 7:05 AMdagomni
04/06/2020, 8:29 AMMihai Popa
04/06/2020, 11:02 AM