accompanist icon indicating copy to clipboard operation
accompanist copied to clipboard

[navigation-material] expose sheetGesturesEnabled flag

Open amanv8060 opened this issue 1 year ago • 9 comments

Fixes #730

Expose sheetGesturesEnabled Flag

amanv8060 avatar May 29 '23 02:05 amanv8060

Similar to the comment on #1342, we'd want to make this available on a per destination level, not a global flag.

This may be easier said than done given the current state of ModalBottomSheetLayout (also as explained in that comment), but if it is possible, we'd be happy to merge a destination level flag in if you'd like to put up a new patch set.

ianhanniballake avatar May 30 '23 00:05 ianhanniballake

Will give it a try, although it doesn't look easily possible.

amanv8060 avatar May 30 '23 07:05 amanv8060

@ianhanniballake, I have added a destination-level flag and updated the bottom sheet sample to demonstrate the same. I am a little unsure about the performance implications of this approach.

Can you take a look and let me know what you think?

If this looks good, I can try adding tests for this.

amanv8060 avatar May 31 '23 07:05 amanv8060

@amanv8060, thanks for the PR!

I'd be interested to see if tests for the following scenarios (see the comment Ian linked) would pass:

The concerns are about recreating the state in time when the value changes as the destination changes, but maybe it'd work. We'd want some good test coverage that tests

Navigating from a skipHalfExpanded = false to a skipHalfExpanded = false destination Navigating from a skipHalfExpanded = false to a skipHalfExpanded = true destination Navigating from a skipHalfExpanded = true to a skipHalfExpanded = false destination and ensures that the sheet opens up to the correct state.

If yes, we can look at performance a bit more. What concerns do you have here?

jossiwolf avatar Jun 12 '23 14:06 jossiwolf

I will try adding tests for these cases.

amanv8060 avatar Jun 13 '23 04:06 amanv8060

@jossiwolf I have added basic tests, I can't test the sheet state like in the case of skipHalfExpanded( since this value isn't stored in sheetstate) so I have added tests to ensure that the stateflow is indeed emitting correct values in all the mentioned cases.

amanv8060 avatar Jun 13 '23 22:06 amanv8060

cc/ @jossiwolf In case you missed it.

amanv8060 avatar Jun 26 '23 06:06 amanv8060

Would love to see this merged ✌️

akashnimare avatar Jul 13 '23 14:07 akashnimare

Would love to see this merged ✌️

VahidGarousi avatar Oct 09 '23 07:10 VahidGarousi

With the release of Compose Material 1.7.0-alpha04, the Material team has added a new artifact: androidx.compose.material:material-navigation, which fully replaces Accompanist Navigation Material.

As such, we are closing all PRs here on Accompanist.

ianhanniballake avatar Mar 08 '24 07:03 ianhanniballake