Robert Jaros
03/13/2024, 9:51 AMSujit Panda
03/13/2024, 11:06 AMKeyboardWrapper.switchToKeyboard():654 switchToKeyboard(): type=symbol, status=1
Daniele B
03/13/2024, 1:16 PMtylerwilson
03/13/2024, 4:08 PMDivyansh Kushwaha
03/13/2024, 5:38 PMalorma
03/13/2024, 7:17 PM@PreviewDynamicColors
with no success... Always show the same primary color from my theme definition...
Is there any examples of that feature?
As for example, following code:
@PreviewDynamicColors
@Composable
fun test() {
AppTheme(useDynamicTheme = true) {
Surface(
) {
Box(
modifier = Modifier
.padding(16.dp)
.size(20.dp)
.background(color = MaterialTheme.colorScheme.primary),
)
}
}
}
With theme:
@Composable
fun AppTheme(
useDynamicTheme: Boolean = true,
useDarkTheme: Boolean = isSystemInDarkTheme(),
content: @Composable () -> Unit
) {
val colorScheme = when {
useDynamicTheme -> {
val context = LocalContext.current
if (useDarkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
}
useDarkTheme -> DarkColors
else -> LightColors
}
MaterialTheme(
colorScheme = colorScheme,
content = content
)
}
Generates the following preview:Md Sadique Inam
03/14/2024, 6:03 AMDaniele B
03/14/2024, 8:40 AMremember { filters.toMutableStateList() }
fun Filter(filters: List<String>) {
val filterValues = remember { filters.toMutableStateList() }
...BEGIN for loop....
BasicTextField(
value = filterValues[index],
onValueChange = {
filterValues[index] = it
filterListFunction(filterValues)
})
...END for loop....
}
What is the idiomatic way in BasicTextField2?dhia chemingui
03/14/2024, 9:53 AMDaria Voronina [JB]
03/14/2024, 11:45 AMLucas Kivi
03/14/2024, 9:54 PMBottomSheetDialogFragment
. If I have TalkBack enabled, every time the BottomSheetDialogFragment
with the compose screen is opened, the app label is announced. For my similar screens that are entirely XML based, this issue does not occur. I cannot migrate away from the BottomSheetDialogFragment
as of yet. Does anyone have any wisdom concerning avoiding this extra announcement of the app label?Dusty
03/15/2024, 10:27 AMHasan Tunçay
03/15/2024, 12:19 PMHasan Tunçay
03/15/2024, 1:47 PMHasan Tunçay
03/15/2024, 1:50 PMNick Rout
03/15/2024, 2:11 PMEsther Carrelle
03/15/2024, 3:09 PMStylianos Gakis
03/16/2024, 9:46 AM@Composable
fun Foo(someParameter: String) {
// Option #1
val myFunction: () -> Unit = remember(someParameter) {
{
doSomething(someParameter)
}
}
// Option #2
fun myFunction {
doSomething(someParameter)
}
// Usage of #1
OtherComposable(callback = myFunction)
// Usage of #2
OtherComposable(callback = ::myFunction)
}
@Composable
fun OtherComposable(callBack: () -> Unit) { ... }
Kyant
03/16/2024, 1:59 PMLazyHorizontalPager
is only 200 lines (including PagerState
). There is a bug in the official `HorizontalPager`: when you scroll to fling, then touch screen, it will transform touch event into small scroll event... so the users can't click and have to wait for the animation finished. In terms of performance, to optmize it will take complex measures, such as using custom Layout
, Modifier.Node
to cahce something, and make the recomposition less. If you animate the TextStyle
in Text
, it will recompose on every frame and very laggy, I have to create a custom Modifier.Node
to make it not to recompose. So the work amount is indeed increasing. I am tired of writing compose now, it makes me headache.Pablo
03/17/2024, 3:56 PMPablo
03/17/2024, 4:37 PMmohamed rejeb
03/17/2024, 10:23 PMTextMeasurer
measure
method on a background thread? I tried running it inside a LaunchedEffect
on Dispatchers.Default
but it keeps blocking the main thread.Kisses
03/18/2024, 5:44 AMZoltan Demant
03/18/2024, 8:26 AMVlad
03/18/2024, 9:05 AMWindowWidthSizeClass.Expanded -> // orientation is landscape in most devices including foldables (width 840dp+)
WindowWidthSizeClass.Medium -> // Most tablets are in landscape, larger unfolded inner displays in portrait (width 600dp+)
WindowWidthSizeClass.Compact -> // Most phones in portrait
?Dmitriy Tarasevich
03/18/2024, 12:30 PMColorDodge
effect to work without strange artifacts. I get this flash of Gray on the shape before the blend mode is applied. There is the code that I am using
fun Modifier.dodge(
cornerRadius: Dp = 16.dp,
shapeColor: DodgeColor = DodgeColor.GRAY1,
): Modifier {
return composed {
this
.drawWithContent {
drawRoundRect(
cornerRadius = CornerRadius(cornerRadius.toPx()),
color = Color(parseColor(shapeColor.color)),
blendMode = BlendMode.ColorDodge,
)
drawContent()
}
}
}
And an example of what the issue isJosh Pollock
03/18/2024, 4:45 PMJosh Eldridge
03/19/2024, 2:47 AMHorizontalPager
? I've been trying to figure out how to deal with height changes between items as it doesn't seem to consistently adjust the height of the current screen. Take this calendar view for example. Using layout inspector I can see there are 2 items pre-loaded on the sides and october is taking the smaller size and properly wrapping it's height. But sometimes like the second image, it takes the height of the largest side-loaded element.Fin
03/19/2024, 3:20 AMFlowRow
, the property verticalArrangement
states
> The vertical arrangement of the layout’s virtual rows.
but children are still rendered at the top and in order to align a children vertical-centered, I need to add align
to each children.
The API sounds a bit confusing, can someone explain how verticalArrangement
is meant to be used?
Thank you 🙏Ume Channel
03/19/2024, 5:53 AM