Zoltan Demant
10/05/2021, 5:22 AMAnimatedContent
? 🧵👀Ink
10/05/2021, 6:04 AMTolriq
10/05/2021, 8:57 AMAlex
10/05/2021, 9:38 AMComposeView
to show a composable. Is there a way for the ComposeView
to receive a callback when the content is recomposed?Alex
10/05/2021, 10:09 AMChris Miller
10/05/2021, 11:23 AMLazyColumn
that displays a mutableStateListOf(items)
. There are about 100 items in the list and once populated (loaded from a server) the list doesn't change. Individual items do sometimes mutate however (by making a mutated copy of the item and replacing the previous instance of it in the list). This all works as expected.
I now want to add a search/filter TextField, that reduces the items displayed to just those where item.name.contains(searchText)
. I'm not sure what the best approach to implementing this is:
1. Create a new mutableStateListOf()
list that contains just the filtered items, clearing and repopulating it from the full list each time the search text changes. It seems tricky to deal with mutating items using this approach though (both lists will need updating).
2. Similar to 1, but convert to a mutableStateOf(List<Item>)
and create a new list (from the separate full list) each time the search text changes or an item is mutated.
3. Leave things as they are, but make the item @Composable take the search text as a parameter, and display nothing if contains()
returns false. This seems easy, but also hacky.
4. Something else?bodo
10/05/2021, 1:36 PM@Composable
fun Screen() {
val screenViewModel: ScreenViewModel = hiltViewModel()
val pages by screenViewModel.pages.collectAsState()
val pagerState = rememberPagerState(pageCount = pages.size)
HorizontalPager(state = pagerState) { index ->
Column(modifier = Modifier.fillMaxWidth()) {
// this viewmodel should be created with data from the page object (e.g. id)
val pagerViewModel: PagerViewModel = hiltViewModel() // actual: same viewmodel on every page -> expected: every page get´s its own viewmodel
...
}
}
}
Is it possible to get a ViewModel per page via hilt or should i use a complete different approach than ViewModels in this case?Sergey Y.
10/05/2021, 1:37 PMNew public API: androidx.compose.ui.renderComposeScene - renders UI into an image1839133: Desktop. WithComposeScene, deprecate TestComposeWindow | https://android-review.googlesource.com/c/platform/frameworks/support/+/1839133
Brian G
10/05/2021, 7:51 PMaddOnLayoutChangeListener
? Specifically, I'd like to know what x/y/width/height was chosen for a given composable.Florian
10/05/2021, 8:03 PMLocalContext.current
be of type ContextWrapper
rather than Activity
?saket
10/05/2021, 10:11 PMAbstractComposeView
to our app, I’m noticing that my states aren’t getting saved (using rememberSaveable
) when the view is detached from window. I’m trying to investigate this for some time but I haven’t reached anywhere. How can I investigate what might be happening?Fabio
10/05/2021, 11:03 PMColton Idle
10/05/2021, 11:37 PMms
10/06/2021, 4:21 AMVipulyaara
10/06/2021, 5:14 AMIntrinsicSize
does not wrap the content and truncates the height of the composable. Code and screenshots in thread ->Ernestas
10/06/2021, 6:09 AMModifier.background()
it looks like it just draws other shape on top of current menu container. Adding a screenshot on what I mean. Is there anything I missing? Or should I choose other option on creating DropdownMenus? 🤔Michael Bichlmeier
10/06/2021, 8:30 AMandroid:background="?selectableItemBackground"
on Text
or ClickableText
elements for example?Stefano Sansone
10/06/2021, 9:15 AMAlertDialog()
between title and text ?Stefano Sansone
10/06/2021, 9:15 AMTolriq
10/06/2021, 9:24 AMPaul Woitaschek
10/06/2021, 9:55 AMvar a: Boolean by remember { mutableStateOf(false) }
var b: Boolean = remember { false }
julioromano
10/06/2021, 3:14 PMandrew
10/06/2021, 3:42 PMChris Miller
10/06/2021, 4:35 PMScaffold
with a TopAppBar
, BottomNavigation
and the content is a Column
containing a LazyColumn
plus a TextField
. When the onscreen keyboard is displayed, I want the TopAppBar
and LazyColumn
to stay where they are, the TextField
to be pushed up to just above the keyboard, and the BottomNavigation
to be hidden. I'm trying to achieve this with accompanist-insets-ui, but haven't been able to figure out how. navigationBarsWithImePadding()
comes close, but results in extra whitespace between the TextField and the keyboard, due to the TextField not being located right at the bottom of the screen when there's no keyboard showing. Any ideas on how I can solve this?andrew
10/06/2021, 6:29 PMbrabo-hi
10/07/2021, 12:05 AMbottomSheet
from accompagnist
how can we set or control the default modalSheetValue
??mattinger
10/07/2021, 3:40 AMColton Idle
10/07/2021, 4:19 AMslartus
10/07/2021, 6:03 AMKenneth Leong
10/07/2021, 6:13 AMdimensionResource
inside a constrainScope
for setting constraint margins?Kenneth Leong
10/07/2021, 6:13 AMdimensionResource
inside a constrainScope
for setting constraint margins?Csaba Kozák
10/07/2021, 7:15 AMconstrainScope
lambda is not @Composable
. You have to save the dimens to variable in @Composable
context, and access that in the constraintScope
.Kenneth Leong
10/07/2021, 7:18 AMCsaba Kozák
10/07/2021, 7:19 AM