Philip S
07/06/2021, 6:57 AMrememberLauncherForActivityResult
in Compose? With registerForActivityResult
you could send in a registry
parameter to prevent the real implementation from being called in UI-tests. However this is missing for the Compose equivalent.nitrog42
07/06/2021, 7:36 AMnitrog42
07/06/2021, 7:36 AMComposenow provides a@Preview
that allows you to preview Composables that use APIs likeLocalActivityResultRegistryOwner
that depend on that owner existing. (Ib13d1, b/185693006)rememberLauncherForActivityResult()
nitrog42
07/06/2021, 7:37 AMIan Lake
07/06/2021, 3:10 PMLocalActivittResultRegistryOwner
Philip S
07/07/2021, 6:44 AMval registry = registryWrapper.activityResultRegistry
if (registry != null) {
LocalActivityResultRegistryOwner.provides {
registry
}
}
val current = LocalActivityResultRegistryOwner.current?.activityResultRegistry
require(registry == current)
where registry is my mocked registry (i debugged to check that it is not null). rememberLauncherForActivityResult
Will still not take my mocked registry and calling .current
does not return my mocked registryIan Lake
07/07/2021, 7:49 PMIan Lake
07/07/2021, 7:49 PMIan Lake
07/07/2021, 7:50 PMPhilip S
07/08/2021, 5:57 AM