tcracknell
05/14/2020, 6:48 PMsindrenm
05/14/2020, 8:19 PM@Preview
already has a fair amount of options. Aer there any plans for having orientation be one of them? So one can preview one's component both in portrait and landscape? That'd be pretty dope. 😎Gabriel Feo
05/14/2020, 9:02 PMThe CL adds a padding(horizontal, vertical) overload which adds
symmetric padding. The CL also cleans up the padding-related deprecated
API.
romainguy
05/14/2020, 9:05 PMromainguy
05/14/2020, 9:05 PMromainguy
05/14/2020, 9:05 PMcaelum19
05/14/2020, 9:49 PMZach Klippenstein (he/him) [MOD]
05/15/2020, 10:56 AMjim
05/15/2020, 11:32 AM.drawBookAsSearchResult()
and .drawBookAsAdminModeBookEditor()
or something. You're forcing the noun form into a verb, which begs the question: why?
Ultimately, it's just kotlin, and maybe you will discover a pattern that is better than what we've come up with. Feel free to share what you find/think!jim
05/15/2020, 12:46 PMjim
05/18/2020, 5:45 PMAdam Powell
05/21/2020, 7:00 PMZach Klippenstein (he/him) [MOD]
05/21/2020, 8:20 PMshikasd
05/22/2020, 10:36 PMzalewski.se
05/23/2020, 2:58 PM0.1.0-dev08
to 0.1.0-dev11
and I’m getting an IllegalStateException exception when I try to build the project. I’m using Android Studio 4.1 Canary 9, Kotlin version 1.3.72
. I set my build.gradle for compose:
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerVersion = "1.3.70-dev-withExperimentalGoogleExtensions-20200424"
kotlinCompilerExtensionVersion = AndroidX.Versions.compose
}
And my gradle properties looks like this:
# Gradle
org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=2g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.parallel=false
# Kotlin
kotlin.incremental.multiplatform=true
<http://kotlin.parallel.tasks.in|kotlin.parallel.tasks.in>.project=true
kotlin.code.style=official
# Android
android.useAndroidX=true
android.enableJetifier=true
Did I miss anything? 🤔camkadev
05/23/2020, 5:45 PMdev10
i have used Draw
after migrate to dev11
i can’t find them, what should i do?Kazemihabib1996
05/25/2020, 6:41 AMinside
or outside
isn't just about the order of padding
and preferredSize
modifiers?
IMHO these padding parameters implies that the Box
is different from other layout composables.Leland Richardson [G]
05/25/2020, 2:27 PMcamkadev
05/25/2020, 6:36 PMpavi2410
05/27/2020, 7:20 PMromainguy
05/27/2020, 9:44 PMhenrikhorbovyi
05/27/2020, 9:56 PMhenrikhorbovyi
05/27/2020, 9:56 PMjim
05/27/2020, 10:04 PMval context = ContextAmbient.current
and then use the context
variable instead of reading from the ambient inside the onClick handler.
But know that every time you read from an Ambient, I cry a little inside. Please don't structure your code that way. Not only are you depending on an API that makes your widget impossible to unit-test, but you're also depending on ambients for something that isn't actually ubiquitous, which is an antipattern IMO, and you're baking implicit app knowledge into your widgets.
Instead, pass a handler down into whichever composable is rendering your list item, and have the lambda contain a reference to the Context which was passed down from the current Activity. It's hard to be more specific, because I can't see the rest of your code, but basically your composable functions should ideally know nothing about Context, and just call a function handler that was passed in when a relevant event occur. Widgets should generally accept lambdas instead of "knowing how to perform bespoke actions, like launching a specific activity".Mohamed Ibrahim
05/28/2020, 11:37 AMhenrikhorbovyi
05/28/2020, 10:37 PMkenkyee
05/29/2020, 2:20 AMZach Klippenstein (he/him) [MOD]
05/31/2020, 7:14 PMLinkageError: loader constraint violation
error in previews with dev12 and coroutines 1.3.6 in Android Studio canary 8. Do we need to use a newer version of AS? I’m still on canary 8.allan.conda
06/02/2020, 9:43 AMzalewski.se
06/02/2020, 3:29 PM