Zach Klippenstein (he/him) [MOD]
10/03/2020, 5:44 AMAlignment
implementation that just takes a fraction and aligns to that fraction of the parent. The initial alignment is calculated correctly, but when the fraction changes in subsequent compositions, the composable’s position doesn’t change.
Will file soon.Vinay Gaba
10/03/2020, 6:32 AMcomposeTestRule.onNodeWithText("Title").assertExists()
Kyant
10/03/2020, 6:35 AMwebContext.goBack()
to handle back press in WebView.
java.lang.IllegalStateException: KeyEvent can't be processed because this key input node is not active.
at androidx.compose.ui.input.key.KeyInputModifier.processKeyInput(KeyInputModifier.kt:62)
at androidx.compose.ui.platform.AndroidComposeView.sendKeyEvent(AndroidComposeView.kt:196)
at androidx.compose.ui.platform.AndroidComposeView.dispatchKeyEvent(AndroidComposeView.kt:200)
Is something wrong? I remember it won't crash before.Davide Giuseppe Farella
10/03/2020, 6:57 AMModifier.align
on alpha 4?Michal Harakal
10/03/2020, 6:20 PMpardom
10/04/2020, 12:38 AMpavi2410
10/04/2020, 8:16 AMnlindberg
10/04/2020, 11:04 AMjava.lang.IllegalStateException: Reading a state that was created after the snapshot was taken or in a snapshot that has not yet been applied
Nat Strangerweather
10/04/2020, 2:35 PM@Composable
fun PriorityOptions() {
ScrollableColumn(
modifier = Modifier.fillMaxWidth()
.fillMaxHeight()
.padding(start = 20.dp, end = 20.dp),
) {
Spacer(Modifier.preferredHeight(50.dp))
Text(text = "Priority Options", style = typography.h1)
Spacer(Modifier.preferredHeight(50.dp))
Row(horizontalArrangement = Arrangement.SpaceBetween) {
Text("Start")
Text("End")
}
}
zoha131
10/04/2020, 4:28 PMThiago
10/04/2020, 8:35 PMThiago
10/04/2020, 8:47 PMDenis Sakhapov
10/05/2020, 3:43 AM//Unresolved: androidx.compose. …
https://developer.android.com/reference/kotlin/androidx/compose/animation/package-summary#animateSam
10/05/2020, 7:51 AMArchie
10/05/2020, 11:09 AMText
composable when not placed in a Surface
seem to not apply Material Theme
correctly. So when I do:
Column {
Text() // This text color is black in both light and dark theme
}
It seems that ContentAmbientColor
is not properly set for onBackgroundColor
(composables not part of a surface). Its really hard to trace what exactly is the problem though, as routing to sources in the IDE is currently broken.Prashant Priyadarshi
10/05/2020, 11:37 AMzoha131
10/05/2020, 12:02 PMFlow
from ViewModel
as state
and it’s multiple children also collect the same flow as state then would it hamper the performance? I have TextFields in different layer. So passing state would make the code messy. Thats why wanted to collect the same flow from multiple Composables.Prashant Priyadarshi
10/05/2020, 12:51 PMExecution failed for task ':app:prepareDebugKotlinCompileTask'.
> Could not resolve all files for configuration ':app:kotlin-extension'.
> Could not find androidx.compose:compose-compiler:1.0.0-alpha04.
ppvi
10/05/2020, 12:54 PMDaniele B
10/05/2020, 1:14 PMLazyColumnFor
issue about remembering the scrolling position was fixed. But I just checked and it’s not, at least not automatically.
My use case is very simple:
a list of elements; click on one element to display the detail page; going back to the list; the position is reset to the top, and not kept
So, do we need to explicitly set that it should be remembered? And How?
I mean that would be strange, as in the normal Android view system, the list scroll position is remebered when you go back to the list screen.allan.conda
10/05/2020, 1:57 PMitem{}
multiple times, since it says
Adds a single item to the scope.
in the doc.
LazyColumn {
item { Text("Title") }
item { Header() }
items(items) { ... }
}
// or
LazyColumn {
item {
Text("Title)
Header()
}
items { ... }
}
Robert Menke
10/05/2020, 3:10 PM@Composable
fun EmailTextField() {
val viewModel = viewModel<AuthenticationViewModel>()
val text: String by viewModel.email.observeAsState("")
TextField(
value = text,
onValueChange = viewModel::setEmail,
label = { Text(text = "What's your email address?") },
placeholder = { Text(text = "<mailto:jane.doe@gmail.com|jane.doe@gmail.com>") },
keyboardType = KeyboardType.Email,
modifier = frameFillWidth(60.dp)
)
}
The context it’s called in is this:
@Composable
fun SignInEmailView() {
SingleInputLayout(
onBackClicked = {},
onNextClicked = {},
children = {
EmailTextField()
}
)
}
and I get the error:
e: java.lang.IllegalArgumentException: Unbound type parameters are forbidden: [Unbound private symbol org.jetbrains.kotlin.ir.symbols.impl.IrTypeParameterSymbolImpl@124a0920, Unbound private symbol org.jetbrains.kotlin.ir.symbols.impl.IrTypeParameterSymbolImpl@6e295b2d]
I’ve been able to isolate this error to the EmailTextField
view and when I comment it out the error goes away. I’ve tried reproducing in a sample project but have been unable to do so. Does anything in the example I’ve provided seem off?
compose: 1.0.0-alpha04
kotlin: 1.4.10Robert Menke
10/05/2020, 6:10 PMSergey Y.
10/05/2020, 10:30 PMBrett Best
10/06/2020, 3:51 AMJamie Craane
10/06/2020, 6:40 AMclass MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
var deleted by mutableStateOf(false)
val x = mutableStateOf(0f)
val y = mutableStateOf(0f)
val colors = listOf(Color.Green, Color.Gray, Color.Blue)
setContent {
DragAndDropTestTheme {
Surface(color = MaterialTheme.colors.background) {
Column() {
// This row contains potential drop targets
Row(
modifier = Modifier
.height(150.dp)
.fillMaxWidth()) {
colors.map {
Box(
modifier = Modifier.background(it).weight(1f).fillMaxHeight()
)
}
}
Box(
modifier = Modifier.fillMaxWidth().fillMaxHeight()
.background(Color.Magenta)
) {
if (!deleted) {
Box(
modifier = Modifier
.offsetPx(x, y)
.background(Color.Cyan).width(75.dp).height(75.dp)
.dragGestureFilter(object : DragObserver {
override fun onDrag(dragDistance: Offset): Offset {
val newY = y.value + dragDistance.y
x.value = x.value + dragDistance.x
y.value = newY
return dragDistance
}
override fun onStop(velocity: Offset) {
// Todo what is the best method of determining what box the component is dragged on
}
})
) {
Text(text = "Dragme", modifier = Modifier.align(Alignment.Center))
}
}
}
}
}
}
}
}
}
Manuel Lorenzo
10/06/2020, 7:01 AMKyant
10/06/2020, 11:40 AMDialog
(not AlertDialog
) full width?Ash
10/06/2020, 3:37 PMDavide Giuseppe Farella
10/06/2020, 4:31 PMColumn {
Text(...)
Image(...)
}
which is the best way to let the the Text.width to be at most as Image.width?
I don’t want the Text to exceed the Image sizeDavide Giuseppe Farella
10/06/2020, 4:31 PMColumn {
Text(...)
Image(...)
}
which is the best way to let the the Text.width to be at most as Image.width?
I don’t want the Text to exceed the Image sizeZach Klippenstein (he/him) [MOD]
10/06/2020, 4:48 PMDavide Giuseppe Farella
10/06/2020, 4:52 PMmattinger
10/06/2020, 5:16 PMZach Klippenstein (he/him) [MOD]
10/06/2020, 5:29 PMDavide Giuseppe Farella
10/06/2020, 5:53 PMZach Klippenstein (he/him) [MOD]
10/06/2020, 6:30 PMLayout
that knows it only has two children, and what those children are, and can explicitly size itself appropriately. Making custom layouts is pretty easy with compose, so that might actually be easier/more readable/maintainable than using intrinsics depending how confusing they are.