andrew
03/22/2023, 8:20 PMBen Trengrove [G]
03/22/2023, 9:36 PMStylianos Gakis
03/22/2023, 10:40 PMresources()
marked as internal in androidx.compose.ui.res ?
I am in a place where I need to decide on a string to be used inside my ViewModel. As described here, I am only exposing the StringRes Int from there, and I need to then resolve that string inside my composable. Specifically, I am outside of a composable context since I am resolving it inside a lambda, so I can’t just use the stringResource()
function which uses this function internally.
So it turns out I need to do what stringResource()
does interally myself, which is
LocalConfiguration.current
return LocalContext.current.resources
So that I make sure I read LocalConfig in order to make sure I do not grab stale data.
resources()
already exists and does this exact thing, but it’s marked as internal, shouldn’t that just be a public function?jayjiang
03/23/2023, 8:08 AMStylianos Gakis
03/23/2023, 11:19 AMColumn {
Stuff()
AnimatedVisibility(shouldShow) {
Column {
Text()
Spacer(Modifier.width(8.dp))
Icon()
}
}
}
But when doing this with CompositionLocalProvider like this:
Column {
Stuff()
CompositionLocalProvider(LocalContentColor provides LocalContentColor.current.copy(alpha = ContentAlpha.medium)) {
Text()
Spacer(Modifier.width(8.dp))
Icon()
}
}
You don’t need to do this, it just works.
Why is this the case? CompositionLocalProvider
isn’t even inline or something like that, nor is it an extension on ColumnScope for it to work due to that. So how does it work? What am I missing here?myanmarking
03/23/2023, 12:04 PMUmar Saidu
03/23/2023, 12:04 PMElio Maroun
03/23/2023, 2:20 PMmattinger
03/23/2023, 2:51 PMvide
03/23/2023, 3:28 PME java.lang.IllegalStateException: Check failed.
[Full trace in thread]
at androidx.compose.ui.focus.FocusOwnerImpl.moveFocus-3ESFkO8(FocusOwnerImpl.kt:150)
at androidx.compose.ui.platform.AndroidComposeView$keyInputModifier$1.invoke-ZmokQxo(AndroidComposeView.android.kt:212)
Colton Idle
03/23/2023, 4:51 PMDateRangePicker
to allow selecting a range with the same date for its start and end. (I16529, b/272882497)
• Text fields now properly position their text elements when font size is smaller than expected. This may result in a few pixels change in your apps based on font settings and script. (I8b8d0)
• Add layout type param to TimePicker
composable. It allows to use different layouts, depending on the screen configuration (Ia0e16)
• Added shadow elevation to BottomSheetScaffold
(I94e0f)
• Added support for displaying the date pickers without the header part
And first releases of 1.5.0 (alpha 01)
• AnimatedContent
APIs are now stable AnimatedContentScope
has been renamed to AnimatedContentTransitionScope
. scaleIn
and scaleOut
are now stable APIs. (Iaf54e)
• Text and BasicText
is refactored to use the new modifier system. This leads to substantial performance improvements in many cases. No changes should be visible. (If1d17, b/246961435)
• Added the PerformImeAction
semantics action to invoke the IME action on text editor nodes. (IDK what this does, but sounds sorta importatnt?)
• Add a chipgroup reflow sample. Update the horizontal padding in between child chips in the single line chipgroup sample to match spec. (I3b155)
• Fixed an issue where ModalBottomSheetLayout
would crash in an edge case on orientation change. Layout animations (e.g. Modifier.animateContentSize
) in/on the sheet content now work smoothly. (I2f981, b/266780234)
• Adds Modifier.Node#coroutineScope
to allow Modifier.Nodes
to launch coroutines (I76ef9)
• Allow Modifier.Nodes
to read CompositionLocals
by implementing the CompositionLocalConsumerModifierNode
interface. (Ib44df)
• LookaheadLayout has been replaced by LookaheadScope, which is no longer a Layout. This allows chid content in a LookaheadScope to be directly controlled by parent's MeasurePolicy. (Ibe2e5)dorche
03/23/2023, 4:52 PMBottomSheetScaffold
has had a regression - it used to work fine with a LazyColumn but now the dragging of the sheet is broken if you do it in the bounds of the LazyColumn. Min repro in 🧵Landry Norris
03/23/2023, 6:45 PMCRamsan
03/23/2023, 7:01 PMOmkar Amberkar
03/23/2023, 7:35 PMLucca Beurmann
03/23/2023, 7:56 PMSergio
03/23/2023, 9:03 PMjava.lang.IllegalStateException: Reading a state that was created after the snapshot was taken or in a snapshot that has not yet been applied
for this composable when doing a state read in the layout scope. The problem doesn't occur when I change using graphicsLayer
from the lambda style (layout layer update) to the parameters arguments one (composition layer)eygraber
03/24/2023, 2:22 AM@ReadOnlyComposable
if the function only reads a State
value?chanjungskim
03/24/2023, 3:55 AMInputFilter
something like this:
val limitSizeInputFilter = arrayOf<InputFilter>(ByteLengthFilter(100, "UTF-8"))
binding.nsetName.filters = limitSizeInputFilter
Is there any equivalent to it in compose?Stylianos Gakis
03/24/2023, 9:34 AMandroidx.compose.material.icons.Icons.Default.ArrowForward
as a placeholder for my Coil AsyncImage, but it only takes in a @DrawableRes
or a Drawable
.
Looking for if I am missing some way to do ImageVector -> Drawable before I opt to use the SubComposeAsyncImage instead.Tung97 Hl
03/24/2023, 10:01 AMYariv Ziporin
03/24/2023, 10:49 AMStylianos Gakis
03/24/2023, 11:49 AMandroidx.compose.material:material-icons-extended
I don’t see any such configuration being possible. None of the options Filled, Outlined, Rounded, Sharp and TwoTone
seem to be doing this. Is there something I am missing or is this simply not possible at the moment?alaershov
03/24/2023, 11:51 AMPeter Mandeljc
03/24/2023, 12:04 PMChachako
03/24/2023, 12:24 PMstate
at compile time and records them, followed by inserting logic to update these composables after the corresponding “state operation”? Wouldn’t this approach effectively reduce the runtime overhead associated with recomposition?Stylianos Gakis
03/24/2023, 12:28 PMTextStyle()
which internally does not specify the font size and so on, they are set as TextUnit.Unspecified
.
How do I know which typography value from the material3 typography is used by default if I simply call material3.Text("blahblah")
without specifying the text myself?
I know if I am in a contained which internally has set ProvideTextStyle
it will be that, but what if I am not inside such a contained which has set that composition local?
Couldn’t find anything in the m3 docs either for this.Zaki Shaikh
03/24/2023, 2:22 PMTijs Gobbens
03/24/2023, 4:06 PMjava.util.NoSuchElementException: ArrayDeque is empty.
at kotlin.collections.ArrayDeque.removeLast(ArrayDeque.kt:163)
at androidx.navigation.NavController.launchSingleTopInternal(NavController.kt:1850)
vide
03/24/2023, 4:10 PM.bringIntoView()
before but this seems to break after 1.4.0-alpha03
. 🧵vide
03/24/2023, 4:10 PM.bringIntoView()
before but this seems to break after 1.4.0-alpha03
. 🧵1.4.0
.border(2.dp, Color.Black)
.bringIntoViewRequester(bringIntoViewRequester)
.focusProperties { canFocus = false }
.onFocusChanged {
if (it.isFocused) {
scope.launch {
bringIntoViewRequester.bringIntoView(
Rect(-200F, -200F, 200F, 200F)
)
}
}
}
.focusTarget()