Skip to content

bugfix (Explore Dash): expanded bottom sheet in details mode - #837

Merged
HashEngineering merged 1 commit into
feature-explore-dashfrom
bugfix-explore-dash
Dec 21, 2021
Merged

HashEngineering merged 1 commit into
feature-explore-dashfrom
bugfix-explore-dash

Conversation

@Syn-McJ

@Syn-McJ Syn-McJ commented Dec 16, 2021

Copy link
Copy Markdown
Member

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 setBottomSheetState method 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?

  • QA (Mobile Team)

Checklist:

  • I have performed a self-review of my own code and added comments where necessary
  • I have added or updated relevant unit/integration/functional/e2e tests

@Syn-McJ Syn-McJ self-assigned this 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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the item is of Both type, we treat it like Online if it is opened from the Online tab.

BottomSheetBehavior.STATE_EXPANDED
} else {
BottomSheetBehavior.STATE_HALF_EXPANDED
private fun setBottomSheetState(forceExpand: Boolean = false): Int {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for multiple forcing conditions.

forceExpand -> BottomSheetBehavior.STATE_EXPANDED
isDetails -> BottomSheetBehavior.STATE_HALF_EXPANDED
nearbySearch -> BottomSheetBehavior.STATE_HALF_EXPANDED
else -> BottomSheetBehavior.STATE_EXPANDED

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed if to when - hopefully, it makes this check clearer.

@ClaudeHangui ClaudeHangui left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok by me
thanks for the simplification of the setBottomSheetState method !

@HashEngineering
HashEngineering merged commit cc728e2 into feature-explore-dash Dec 21, 2021
@Syn-McJ
Syn-McJ deleted the bugfix-explore-dash branch December 23, 2021 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants