Repository navigation
bugfix (Explore Dash): expanded bottom sheet in details mode - #837
Merged
Merged
Conversation
Syn-McJ
commented
Dec 16, 2021
| val item = viewModel.selectedItem.value ?: return | ||
| val isOnline = item.type == MerchantType.ONLINE | ||
| val isOnline = viewModel.filterMode.value == FilterMode.Online || | ||
| item.type == MerchantType.ONLINE |
Member
Author
There was a problem hiding this comment.
When the item is of Both type, we treat it like Online if it is opened from the Online tab.
Syn-McJ
commented
Dec 16, 2021
| BottomSheetBehavior.STATE_EXPANDED | ||
| } else { | ||
| BottomSheetBehavior.STATE_HALF_EXPANDED | ||
| private fun setBottomSheetState(forceExpand: Boolean = false): Int { |
Member
Author
There was a problem hiding this comment.
No need for multiple forcing conditions.
Syn-McJ
commented
Dec 16, 2021
| forceExpand -> BottomSheetBehavior.STATE_EXPANDED | ||
| isDetails -> BottomSheetBehavior.STATE_HALF_EXPANDED | ||
| nearbySearch -> BottomSheetBehavior.STATE_HALF_EXPANDED | ||
| else -> BottomSheetBehavior.STATE_EXPANDED |
Member
Author
There was a problem hiding this comment.
Changed if to when - hopefully, it makes this check clearer.
ClaudeHangui
approved these changes
Dec 16, 2021
ClaudeHangui
left a comment
Contributor
There was a problem hiding this comment.
Ok by me
thanks for the simplification of the setBottomSheetState method !
HashEngineering
approved these changes
Dec 20, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There is a problem I missed with #835: if we select a territory, the bottom sheet stays expanded for physical locations. This shouldn't be the case, we should always show the map for a point with coordinates (unless opened from the Online tab).
Issue being fixed or feature implemented
Changed the
setBottomSheetStatemethod and simplified conditions check to make it more clear.The logic that we have for the bottom sheet and some other components in explore-dash got quite complicated and not too intuitive, as evident from difficulties other developers have while changing it. This is the result of having multiple different logical screens that live in a single physical one. I have some ideas for refactoring this to make it less convoluted, but for now, we just need a fix for the existing problem.
Related PR's and Dependencies
Screenshots / Videos
How Has This Been Tested?
Checklist: