Zach Klippenstein (he/him) [MOD]
01/05/2023, 12:24 AMYariv Ziporin
01/05/2023, 4:53 AMJohannes Prüller
01/05/2023, 8:04 AMModalBottomSheetLayout
with a nested LazyColumn
. I followed the docs how to implement this, but as it turns out there is a strange behaviour randomly happening, which causes that the list cannot be scrolled down further and also the end of list animation is shown. Does anyone know what’s causing this?KotlinLeaner
01/05/2023, 9:21 AMColumn
inside that there are few items. Some of the item are hidden and visible on some condition. There is one Nested Column
which is adding item and auto scrolling which is done with the help of this post. Item adding will done through Add Me
CTA. Main problem comes here, when I was added more than 10 item and then we click on Show Banner
CTA, AnimatedVisibility
condition will true and display the view and Nested Column
will shifted the few items downward. I don't won't like this, instead I wan't to calculate the whole column height and always show the last item. Same as done through in the answer gif.oday
01/05/2023, 10:04 AM.value
stuff inside a when
, which yes is technically not inside a Composable, and I’m being allowed to do so, but there is a big warning about it of course
how do I avoid that?
LazyRow(
contentPadding = PaddingValues(16.dp)
) {
items(
items = listItems.value,
key = { it.type },
itemContent = { item ->
val label = when (item) {
is BrowseEventsFilter.PeriodFilter -> {
when {
item.period.value != Period.Any -> {
item.enabled.value = ChipStatus.ENABLED
stringResource(id = item.period.value.label())
}
...............etc
svenjacobs
01/05/2023, 10:15 AMmain
module, but then I would have a tight coupling of main and the feature.
Is this even possible, a composable some layers down in the hierarchy rendering above all other composables?chanjungskim
01/05/2023, 12:52 PMchanjungskim
01/05/2023, 3:31 PM@Composable
fun MyView(){
// fixed content.
}
Nebil
01/05/2023, 5:34 PMJustin Yue
01/06/2023, 12:08 AMAndroidView
, but when I run my app, my custom view does not appear. I was thinking perhaps passing in null for the root
paramater might be problematic for LayoutInflater.from(context).finflate(R.layout.view_visualization, null, false)
. Normally, I would call rootView
instead, but that just returns my custom view. Is there a way to instead have the root be the composable that calls this custom view?Yingding Wang
01/06/2023, 1:31 AMandroid:fillColor
in compose?
`painterResource`seems to override these fillColor with Theme Colors.mattinger
01/06/2023, 1:55 AMdata class Foo(values: List<String>)
AmrJyniat
01/06/2023, 8:51 AMTextField
with validations, I want to show error(make isError
property equals to true) only after losing the TextField's focus, not on the initial composition, how I can accomplish that?Elio Maroun
01/06/2023, 9:13 AMHasan Nagizade
01/06/2023, 9:13 AModay
01/06/2023, 11:19 AMTgo1014
01/06/2023, 12:54 PMclickable
is not being applied anymore. What's the proper way to handle dynamic modifiers?
val localModifier = Modifier
.fillMaxWidth()
.height(IntrinsicSize.Max)
.apply {
if (!disableClick) {
this.clickable {
Timber.w("Music CLicked")
onMusicClick.invoke(music)
}
}
}
.padding(8.dp)
Nat Strangerweather
01/06/2023, 2:12 PMPullRefreshIndicator
; it stays stuck half-way down the screen and does not refresh anything. Here is my code: 🧵ursus
01/06/2023, 2:28 PMwhen
in every branch, vs. producing a value with the when
and calling the composable with the result?
Former seems to lag the scrolling, while latter doesn’t
Code in thread`
Nat Strangerweather
01/06/2023, 2:37 PMPullRefreshIndicator
which stays stuck halfway down the screen and does not execute the function. Please see code in thread.Landry Norris
01/06/2023, 2:39 PMprivate fun SemanticsNodeInteraction
.twoFingerGesture(offset1, offset2) {
performTouchInput {
down(0, offset1)
down(1, offset2)
up(0)
up(1)
}
}
When I put logs in forEachGesture, it seems like the pointer id is set to 2 for all 4 events, and the event.changes size is always 1, instead of (1, 2, 2, 1) like when I do the same gesture manually. Is there something I’m doing wrong in my code?Tariyel Islami
01/06/2023, 4:33 PMAkash Khatkale
01/06/2023, 6:59 PMNicolai
01/06/2023, 8:27 PMvide
01/07/2023, 6:54 PMrestartable skippable scheme("[androidx.compose.ui.UiComposable]") fun MenuButton(
stable menuOpen: Boolean = @dynamic LiveLiterals$NavBarKt.Boolean$param-menuOpen$fun-MenuButton()
stable setMenuOpen: Function1<Boolean, Unit>
defaultFocusRequester: FocusRequester
stable onWidthChange: Function1<Dp, Unit>
)
The problem goes away from defaultFocusRequested is removed from the parameters, so it's definitely related to that. The object that is passed is the same on every recomposition, but it never skips. Is there a bug in compose metrics reporting the function as skippable? 🤔mgrazianodecastro
01/07/2023, 9:48 PMMiguel Kano
01/07/2023, 10:39 PMNavController.currentBackStackEntryAsState()
to mutate the top bar based on the current screen. This means the root Scaffold owns the declaration of the top bar. It works fine for simple cases like just toggling the visibility of the top bar or controlling the bottom bar, but I find it not very practical in the following aspects. I've searched around on this slack, but couldn't find an answer that feels satisfying.
Scaffolder(
topBar = {
if (current screen is "xyz") show this else that...
},
...
) {
NavHost {...}
}
1: How would the currently displayed composable screen receive the click event on the action items? Pushing the event down is discouraged. I found this post from Ian, but I don't get it
2: If which action items should display depends on the logic/data fetched from the current screen, how should that be communicated to the root Scaffold?
3: In reality with large apps, I would want to define/encapsulate such logic and click event handling closer to the actual feature rather than defining all variations of them at the root level.Puskal
01/08/2023, 5:31 PMFrancesc
01/08/2023, 8:35 PMNat Strangerweather
01/08/2023, 9:38 PMitems(state.newsFeedItems) { item ->
ResultsChip(item, navController)
}
The newsFeedItems
come from a room database. When I click on a ResultsChip
I get the corresponding items in my next screen. When I navigate back and click on another ResultsChip
for some reason I get the items of the first chip in my next screen. Is there something when navigating back that remembers
the previous items? Why does clicking on a second chip not yield the second chip items but the first ones?Nat Strangerweather
01/08/2023, 9:38 PMitems(state.newsFeedItems) { item ->
ResultsChip(item, navController)
}
The newsFeedItems
come from a room database. When I click on a ResultsChip
I get the corresponding items in my next screen. When I navigate back and click on another ResultsChip
for some reason I get the items of the first chip in my next screen. Is there something when navigating back that remembers
the previous items? Why does clicking on a second chip not yield the second chip items but the first ones?zt
01/09/2023, 6:15 AMNat Strangerweather
01/09/2023, 9:12 AM