Billy Newman
11/14/2022, 9:57 PMCarlos Muñoz
11/15/2022, 12:18 AMClickableText + AnnotatedString
(Following this approach from the docs) to render a text with several clickable sections. Is there a simple way to have some pressed state when one of the clickable sections is clicked?Colton Idle
11/15/2022, 3:20 AMZoltan Demant
11/15/2022, 6:04 AMLocalSaveableStateRegistry.current.registerProvider(..)
eventually leads to TransactionTooLargeException
. Given that rememberSaveable
uses it under the hood, is there another way to store state in compose that is immune to this crash? Im looking to store a `Map<String, Parcelable>`that represents the entire apps navigation state.Pedro Alberto
11/15/2022, 11:01 AMMediumTopAppBar
is collapsed ?
I'm currently using this val scrollBehavior = TopAppBarDefaults.enterAlwaysScrollBehavior(topAppBarState)oday
11/15/2022, 12:18 PMprivate val categoryFilter = BrowseEventsFilter.CategoryFilter(category = MutableStateFlow(Category.All))
private val locationFilter = BrowseEventsFilter.LocationFilter(location = MutableStateFlow(null))
private val periodFilter = BrowseEventsFilter.PeriodFilter(
period = MutableStateFlow(Period.Any),
dateRange = MutableStateFlow(null)
)
and then you change them
var filtersState = MutableStateFlow(listOf(locationFilter, periodFilter, categoryFilter)) // collectAsState in the activity
// how they change
filterState?.enabled?.value = ChipStatus.ENABLED
filterState?.period?.value = period
filterState?.dateRange?.value = null
and then observe them
flowOf(periodFilter.period?.value,
periodFilter.dateRange?.value,
categoryFilter.category.value,
locationFilter.location.value
).collect {
// do something everytime their values change
}
K Merle
11/15/2022, 1:00 PMbrandonmcansh
11/15/2022, 3:49 PMStephen Vinouze
11/15/2022, 4:49 PMBackHandler
inside the composables don’t get called 🤔Colton Idle
11/15/2022, 6:11 PMclass VM : ViewModel() {
val text = MutableStateFlow("")
val dbText = text.debounce(2000).distinctUntilChanged().flatMapLatest { (it) }
private fun queryFromDb(query: String): Flow<String> {
...
}
}
Tash
11/15/2022, 7:20 PMjava.lang.IllegalStateException: Unsupported concurrent change during composition. A state object was modified by composition as well as being modified outside composition.
We don’t seem to be creating `mutableStateOf`s explicitly at all, much less modifying them on both sides of Composition boundaries…Any tips on where to start looking? Any help is much appreciated! 🙏🏼
More in 🧵PHondogo
11/15/2022, 8:07 PMZsolt.bertalan
11/15/2022, 10:04 PMzt
11/15/2022, 10:38 PMval transformableState = rememberTransformableState { zoomChange, offsetChange, _ ->
scale *= zoomChange
offset += offsetChange
}
Loney Chou
11/16/2022, 12:17 AMState.getValue
and MutableState.setValue
?Tower Guidev2
11/16/2022, 7:09 AMcom.google.accompanist.web.WebView
in my current android compose project. I am trying capture when the user clicks on
the webview to trigger a new page loaded, then i wish to show the next web page on the devices chrome browser and not in the accompanist webviewalvr
11/16/2022, 8:50 AMCarl Benson
11/16/2022, 9:19 AMTower Guidev2
11/16/2022, 9:25 AMAlex
11/16/2022, 10:13 AM.onKeyPressed(…)
Modifier
which works fine for the software keyboard, but the key events do not work when using scrcpy
and entering things with the hardware keyboard.. is there something I need to check or enable first?Hasan Nagizade
11/16/2022, 10:19 AMPedro Alberto
11/16/2022, 3:01 PMmiqbaldc
11/16/2022, 3:20 PMLazy*
when scrolling?
so in the red rectangle, the content border still shown, not truncated (due to padding in theI”m not sure what to search the right keyword for this in SO questions 🙏)Lazy*
PHondogo
11/16/2022, 3:57 PMJohn O'Reilly
11/16/2022, 4:32 PMsuppressKotlinVersionCompatibilityCheck=1.8.0-Beta
fwiwCarl Benson
11/16/2022, 4:44 PMcomposable
, dialog
and dialog<F: Fragment>
destinations
so I construct my navController like
val context = LocalContext.current
val fragmentManager = LocalFragmentManager.current
val dialogFragmentNavigator = remember(
context,
fragmentManager
) { DialogFragmentNavigator(context, fragmentManager) }
val navController = rememberNavController(dialogFragmentNavigator)
but if I add a regular composable dialog
destination to the graph, it will crash with
java.lang.ClassCastException: androidx.navigation.compose.DialogNavigator cannot be cast to androidx.navigation.fragment.DialogFragmentNavigator
nlindberg
11/16/2022, 4:59 PMJan
11/16/2022, 6:52 PMLazyList
.
The default implementation of SwipeToDismiss
will lead to accidental horizontal scrolling while trying to scroll vertically leading to accidental swipe to dismiss events.
In vanilla android view world I’d set a touch listener and check against x > y touch event distance before starting swipe to dismiss. However in Jetpack Compose I don’t know how.
I tried pointerInput
modifier, however it disabled vertical scrolling completely.
I’m aware of dismissThresholds
but that does only handle invoking the dissmissState
change.Sky
11/16/2022, 6:57 PMMaterialTheme.colors.primarySurface
in an Activity …when i try to use it
example:
systemUiController.setNavigationBarColor(color = MaterialTheme.colors.primarySurface)
i get the error @Composable invocations can only happen from the context of a @Composable functionJeff Jackson
11/16/2022, 8:07 PMBottomSheetBehavior
(collapsed, expanded, half-expanded, and hidden). Is there any chance that the standard Jetpack Compose bottom sheet will eventually support the other states?