chansek
03/22/2022, 7:30 PM2.4.0-alpha04
Whenever I do navController.popBackStack()
, I see the behavior attached in the video. For now the fix is by downgrading the navigation version.
"androidx.navigation:navigation-compose:2.4.0-alpha04" // Working fine
vs
"androidx.navigation:navigation-compose:2.4.0-alpha05" or above // Doesn't work
Is there any way to fix it up or I have to wait until it is being fixed by Google?
This behavior is found till 2.5.0-alpha03
Looks like this commit caused the issue:
https://android-review.googlesource.com/c/platform/frameworks/support/+/1750073
Chris Johnson
03/22/2022, 10:45 PMscrollState.isScrollInProgress
changes from false to true or true to false. I don't want to use a LaunchedEffect with a key to avoid creating a new CoroutineScope everytime someone starts/stops scrolling.iamraghavawasthi
03/23/2022, 5:39 AMritesh
03/23/2022, 6:56 AMsealed
class ?
sealed class MyClass {
object A : MyClass()
data class SomeClass(val value:String): MyClass()
}
Benjamin Deroche
03/23/2022, 9:44 AMCanvas
function drawCircle
? If I draw a circle with a radius of 72 and a FloatingActionButton
with a size of 72.dp
the circle end up bigger than the button.
Box(
modifier = Modifier.size(120.dp).align(Alignment.TopCenter)
) {
Canvas(
modifier = Modifier.align(Alignment.Center)
) {
drawCircle(
color = MaterialColor.Red400,
radius = 72f,
)
}
FloatingActionButton(
modifier = Modifier
.align(Alignment.Center)
.size(72.dp),
backgroundColor = MaterialColor.Orange400,
onClick = {}
) {
Icon(
imageVector = Icons.Default.ArrowUpward,
contentDescription = "!"
)
}
}
Tobias Gronbach
03/23/2022, 10:24 AMOrhan Tozan
03/23/2022, 12:13 PMFrancois Morvillier
03/23/2022, 3:21 PMgpaligot
03/23/2022, 4:39 PMmyanmarking
03/23/2022, 6:06 PMbackground(
brush = brush
).graphicsLayer(
shape = shape,
clip = true
)
It only works when i move the shape to be a background param. Why ? I need a dynamic shape. Graphics Layer better suitedjulioromano
03/23/2022, 6:21 PMVinay Gaba
03/23/2022, 8:17 PMLayout
and noticed that modifiers like weight weren't being propagated through the constraints inside the MeasurePolicy
. I'm wondering what's the best way to handle this so I don't have to manually hardcode weight calculations when I place my composables there. Adding a code snippet in the thread.Colton Idle
03/23/2022, 9:11 PMADJUST_RESIZE
. WOOOOOOOOOOOOOOOOOO Thanks @Zach Klippenstein (he/him) [MOD] 😄
• Added RequestFocus
semantics action to request focus on the focusable target.
• FocusOrder
has now been merged into FocusProperties
and focusProperties()
now has all the capabilities of focusOrder()
. FocusOrder
and focusOrder()
have been deprecated. focusOrder()
that accepts a focusRequester
should be replaced with a focusRequester()
modifier in combination with focusProperties()
. This allows the modifiers to have a stronger separation of concerns.
• WindowInsets.asPaddingValues(Density)
was added to allow developers to do the conversion without needing to be in composition.
• Updated parsing of vector drawables to support auto mirroring to flip the content of a VectorPainter
if the current layout direction is RTL.
• Scroll modifiers (Modifier.verticalScroll()
,Modifier.horizontalScroll()
, and Modifier.scrollable()
) will now scroll to keep the focused composable visible if the scroll area is resized and the focused composable was previously visible.
• Upgrading both RecyclerView
and Compose
will now result in much better scrolling performance for RecyclerViews with Compose views as children.
• Reference devices added to the Devices list for @Preview (I071c9)
• compose-ui: Add ambientShadowColor
and spotShadowColor
properties to GraphicsLayerScope
(I1ba1a, b/160665122)
• Plural resources are now supported via the pluralStringResource
functions. (Ib2f23, b/191375123)
• Material3 - Added support for Material 3 text fields. (I795cc, b/199377790)Thomas Dougherty
03/23/2022, 9:21 PMConstraintLayout(
constraintSet = constraints,
modifier = Modifier
.fillMaxWidth()
.height(90.dp)
.clearAndSetSemantics {
set(SemanticsProperties.ContentDescription, listOf(contentDescriptionText))
}
.clickable(onClick = onClick)
.border(
width = 6.dp,
color = Color.Green,
shape = RoundedCornerShape(topStart = 6.dp, topEnd = 6.dp, bottomEnd = 6.dp, bottomStart = 6.dp)
)
) {
Tim Malseed
03/24/2022, 2:16 AMSrSouza
03/24/2022, 2:34 AM@Composable
no problem problem building it. but I'm having runtime exception: java.lang.NoSuchMethodError: No virtual method getValue-0d7_KjU(Ljava/lang/Object;Lkotlin/reflect/KProperty;)J
Does @Composable
support delegate property?
Example:
@Composable
public operator fun getValue(thisRef: Any?, property: KProperty<*>): Color {
return animateColorAsState(targetValue = state).value
}
Colton Idle
03/24/2022, 5:00 AMCard
My code
Card(
modifier = modifier,
backgroundColor = color,
onClick = onClick ?: {},
indication = if (onClick == null) null else LocalIndication.current,
) { content() }
if I use the alt+enter helper it removes the indication =...
. How can I set an indication on the card now though?Android75
03/24/2022, 7:11 AMUtkarsh Tiwari
03/24/2022, 7:15 AMColumn {
TextField() // Let's call it A
TextField() // Let's call it B
}
If I use FocusDirection.Down
when A
is focused, the focus moves down to the B
item below it which is an expected behavior.
However, when I use FocusDirection.Next
, nothing happens.
The documentation of FocusDirection.Next
says:
Direction used in FocusManager.moveFocus
to indicate that you are searching for the next focusable item.
and I believe that the next focusable item in the above column when A
is in focus should be the B
but it doesn’t seem to work. Am I missing something? 😕K Merle
03/24/2022, 7:21 AMgalex
03/24/2022, 10:23 AMonGloballyPositioned
inside Modifier.composed
?
That inside modifier doesn’t seem to be called!
fun Modifier.tooltip(
scope: CoroutineScope,
tooltipHostState: TooltipHostState,
text: String
) = composed {
var layoutCoordinates by remember { mutableStateOf<LayoutCoordinates?>(null) }
onGloballyPositioned {
layoutCoordinates = it
logger().d("tooltip", "onGloballyPositioned = $layoutCoordinates")
}
LaunchedEffect(layoutCoordinates) {
logger().d("tooltip", "LaunchedEffect = $layoutCoordinates")
scope.launch {
tooltipHostState.showTooltip(text)
}
}
return@composed this
}
What I am trying to do is to launch only once (LaunchedEffect) when onGloballyPositioned
is called 🤔Tomas Gordian
03/24/2022, 12:00 PMFilip Wiesner
03/24/2022, 12:01 PMzoomable
modifier which contains a pointerInput
with detectTransformGestures
. It works all fine but now I have to use this modifier
on items inside HorizontalPager
and because (I presume) the pointerInput
consumes all the events, I cannot move the pager.
What I've tried is to dispatch the unused offset (pan with one finger) as a scroll to the pager but I don't know how to handle the fling after the scroll. Is there some way to handle my own fling? Or is there some more simple way to achieve this that I am missing?Mantas Varnagiris
03/24/2022, 1:02 PMlhwdev
03/24/2022, 1:22 PMActivity
. (there is DialogWindowProvider for this purpose?)Shaheer Muzammil
03/24/2022, 1:26 PMStylianos Gakis
03/24/2022, 1:44 PMLayout
, how it’s used in the implementation of Column|Row measure policy and in a codelab. More in thread 🧵julioromano
03/24/2022, 2:20 PMdisabled
?
Maybe something with CompositionLocals?
(what I’m trying to achieve is to have an entire screen to be disabled under certain conditions)natario1
03/24/2022, 4:25 PM1.2.0-alpha04
? We have a couple of components that look completely messed up in 04 (but worked well before). I’m going through the changelog but I can’t find any hintTobias Gronbach
03/24/2022, 4:26 PMTobias Gronbach
03/24/2022, 4:26 PMThomas Dougherty
03/24/2022, 6:17 PMTobias Gronbach
03/24/2022, 6:22 PMThomas Dougherty
03/24/2022, 6:25 PMLazyColumn {
// Add a single item
item {
Text(text = "Header")
}
// Add first filters list
items(firstFiltersList) { filter ->
Text(text = "Filter: $filter")
}
// Add another single item
item {
Text(text = "Another Header")
}
// Add second filters list
items(secondFiltersList) { filter ->
Text(text = "Filter: $filter")
}
}
Tobias Gronbach
03/24/2022, 6:29 PM