Skip to content

Conversation

@tomaszrybakiewicz
Copy link
Contributor

Closes NAVAND-923

Description

  • Increased InfoPanel bottom guideline max pos to 50% of the NavigationView height and made it customizable via ViewStyleCustomization.infoPanelGuidelineMaxPosPercent

…View height and made it customizable via ViewStyleCustomization.infoPanelGuidelineMaxPosPercent.
@tomaszrybakiewicz tomaszrybakiewicz added the UI Work related to visual components, Android Auto, Camera, 3D, voice, etc. label Jan 6, 2023
@codecov
Copy link

codecov bot commented Jan 6, 2023

Codecov Report

Merging #6792 (19454ce) into main (1419bb1) will decrease coverage by 0.00%.
The diff coverage is 73.68%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #6792      +/-   ##
============================================
- Coverage     72.64%   72.64%   -0.01%     
- Complexity     5566     5569       +3     
============================================
  Files           780      780              
  Lines         30091    30104      +13     
  Branches       3551     3553       +2     
============================================
+ Hits          21860    21869       +9     
- Misses         6805     6808       +3     
- Partials       1426     1427       +1     
Impacted Files Coverage Δ
...avigation/dropin/infopanel/InfoPanelCoordinator.kt 68.69% <54.54%> (-2.22%) ⬇️
...mapbox/navigation/dropin/ViewStyleCustomization.kt 100.00% <100.00%> (ø)
...tion/dropin/navigationview/NavigationViewStyles.kt 100.00% <100.00%> (ø)

val maxPos = (parentHeight * GUIDELINE_MAX_POSITION_PERCENT).toInt()
val pos = parentHeight - infoPanelTop - systemBarsInsets.bottom
guidelineBottom.setGuidelineEnd(pos.coerceIn(0, maxPos))
val maxPos = (parentHeight * maxPosPercent).toInt() - systemBarsInsets.bottom
Copy link
Contributor

Choose a reason for hiding this comment

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

You didn't subtract systemBarsInsets.bottom for maxPos before. Is this behaviour change intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes

context.systemBarsInsets.collect { updateGuidelinePosition(systemBarsInsets = it) }
}
coroutineScope.launch {
context.styles.infoPanelGuidelineMaxPosPercent.collect {
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't you want to test it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried, but unfortunately, Robolectric was throwing exceptions when I tried to layout the view (parentLayout.layout(0, 0, 200, 300)) to get concrete measurements in tests. After fighting with this for over 4 hrs I had to throw the towel.

@tomaszrybakiewicz tomaszrybakiewicz merged commit 61415ea into main Jan 10, 2023
@tomaszrybakiewicz tomaszrybakiewicz deleted the NAVAND-923_tr-drop-in_road_name_label_fix branch January 10, 2023 14:42
tomaszrybakiewicz added a commit that referenced this pull request Jan 10, 2023
* Increased InfoPanel bottom guideline max pos to 50% of the NavigationView height and made it customizable via ViewStyleCustomization.infoPanelGuidelineMaxPosPercent.

* CHANGELOG entry

* Rename changelog files

Co-authored-by: runner <runner@fv-az465-655>
abhishek1508 pushed a commit that referenced this pull request Jan 12, 2023
* Increased InfoPanel bottom guideline max pos to 50% of the NavigationView height and made it customizable via ViewStyleCustomization.infoPanelGuidelineMaxPosPercent.

* CHANGELOG entry

* Rename changelog files

Co-authored-by: runner <runner@fv-az465-655>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

UI Work related to visual components, Android Auto, Camera, 3D, voice, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants