amar_1995
08/21/2020, 2:53 PMonCommit
completes. What is the suggested ways to do this ?Zhelyazko Atanasov
08/22/2020, 11:11 AMAndroid Studio 4.2 Canary 7
Build #AI-201.7846.76.42.6720134, built on July 30, 2020
Runtime version: 1.8.0_242-release-1644-b3-6222593 x86_64
with Gradle 6.6
, Android build tools 4.2.0-alpha07
, Kotlin 1.4.0
and Compose 0.1.0-dev17
. When I rebuild the project, the Preview doesn't show anything. It's a brand new project created using the "Compose Activity" template in AS and the Preview was working before updating to the latest dependencies (the template in AS was using Compose 0.1.0-dev13
).Archie
08/22/2020, 6:44 PM.fillMaxSize()
to setPrefferedSize(someValue, someValue)
?Vinay Gaba
08/22/2020, 8:08 PMAnimatedVisibility
. Really like how simple the API is and fits really well to a host of different use cases. Here is what I implemented to demonstrate list deletion with animation. Thanks for your work on this @Doris Liu 👏🏼
Here is the code with comments if anyone is interested - https://github.com/vinaygaba/Learn-Jetpack-Compose-By-Example/blob/master/app/src/main/java/com/example/jetpackcompose/animation/ListAnimationActivity.kt#L53dimsuz
08/22/2020, 11:06 PMdp
to pixels for Offsets? It's OK but I get a feeling that's a bit verbose.
drawLine(
color,
size.bottomLeft(Offset(1.dp.toPx().value, -1.dp.toPx().value)),
size.topLeft(Offset(0f, 1.dp.toPx().value)),
Stroke(width = 2.dp.toPx().value)
)
dimsuz
08/22/2020, 11:55 PMdev13
, does anyone by chance know if its fixed, or should I report it?
Asking because upgrading to later versions could require some effort.
Button(
modifier = if (enabled || MaterialTheme.colors.isLight) borderModifier else Modifier
)
Reversing the order of condition operands fixes compilation. This compiles OK:
Button(
modifier = if (MaterialTheme.colors.isLight || enabled) borderModifier else Modifier
)
I will post a reported exception in the thread >>dimsuz
08/23/2020, 11:50 AMdev17
and 4.2 Canary 7
and preview doesn't render anything. Running on emulator renders just fine. Is this a known issue? (Invalidate caches didn't help either)amar_1995
08/23/2020, 2:10 PMProvidableAmbient
to pass data from screen1 to screen2. How to update data in screen2 and return back to screen1 ?tjohnn
08/23/2020, 2:44 PMremember { state }
rather than just state
? I have tried and my app works thesame way.caelum19
08/23/2020, 3:39 PMZach Klippenstein (he/him) [MOD]
08/23/2020, 5:17 PMYamila Gammeri
08/24/2020, 12:22 AMReprator
08/24/2020, 2:04 AMTextField(
value = textValue,
keyboardType = KeyboardType.Phone,
imeAction = ImeAction.Done,
onValueChange = { textValue = it },
label = { Text("Enter Your Phone Number") },
placeholder = { Text(text = "904353455") },
onImeActionPerformed = { imeAction: ImeAction, softwareKeyboardController: SoftwareKeyboardController? ->
if (imeAction == ImeAction.Done) {
if(textValue.text.isEmpty()){
return@TextField
}
}
},
modifier = Modifier.fillMaxWidth()
)
I want to set error on this text field for phone number, but i don't find any errortext, please let me know how can i set the error on textfieldQuentin Dommerc
08/24/2020, 7:52 AMGuy Bieber
08/24/2020, 6:16 PMGuy Bieber
08/25/2020, 12:27 AMval mDataModel = remember {dataModel}
ui.TextLabelStyled(
text = "%.1f".format(mDataModel.value),
color = mDataModel.targetColor,
fontSize = valueFontSize,
modifier = Modifier
)
Is there a workaround?brandonmcansh
08/25/2020, 3:11 AMReprator
08/25/2020, 5:40 AMMaik
08/25/2020, 9:11 AMHalil Ozercan
08/25/2020, 10:29 AMjava.lang.IllegalArgumentException: LayoutNode@bc99a9c children: 2 measureBlocks: androidx.compose.ui.LayoutKt$measureBlocksOf$1@3018c67 is not ready. layoutState is NeedsRelayout
There is no mention of my code in the stacktrace. I assume it is related to LazyColumnFor
. I will update this message once I have more information.
Edit: Looks like it is related to usage of new background
modifier. It was used on a column with dynamic height which is calculated after a image load request.Halil Ozercan
08/25/2020, 2:50 PMDavid Odari
08/25/2020, 7:21 PM0.1.0-dev17
and Kotlin version to 1.4.0 as well as the compose Kotlin compiler.
This are the dependencies in the dependencies block
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.1'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.0'
implementation "androidx.compose.foundation:foundation:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.animation:animation:$compose_version"
//For @Preview
implementation "androidx.ui:ui-tooling:$compose_version"
The issue I have is on the @Preview
annotation claiming it works on composable functions and my function is a composable function .Is there something I am missing?🤔
👇Guy Bieber
08/25/2020, 8:12 PMmanueldidonna
08/25/2020, 10:34 PM// fetch all the items when the inventory change
launchInComposition(inventory) {
val currentInventory = inventory.value
withContext(<http://Dispatchers.IO|Dispatchers.IO>) {
// fetchAllItems() update the state
currentInventory.fetchAllItems()
}
}
amar_1995
08/26/2020, 5:44 AMFilledTextField
and OutlinedTextField
in dev17?
And is there any easy way to resolve all the issue while moving from one release version to another 😅. I am moving from dev14 to dev17.Wajahat Karim
08/26/2020, 10:29 AMDraw
composable. I can see in previous early versions like dev07 or dev08, there used to be a Draw
composable through which we could render other composables on Canvas. I want to rotate a @Composable()
method. Old code is like this:
@Composable
fun Rotate(degree: Float, children: @Composable() () -> Unit) {
Draw(children = children) { canvas, parent ->
val halfWidth = parent.width.value / 2
val halfHeight = parent.height.value / 2
canvas.save()
canvas.translate(halfWidth, halfHeight)
canvas.rotate(degree)
canvas.translate(-halfWidth, -halfHeight)
drawChildren()
canvas.restore()
}
}
Vinay Gaba
08/26/2020, 4:19 PMDavide Giuseppe Farella
08/26/2020, 4:25 PMText(text = myCustomText)
, where myCustomText: Flow<String>
, what is the cleanest way to deal with that?tcracknell
08/26/2020, 5:04 PMZach Klippenstein (he/him) [MOD]
08/26/2020, 5:19 PM