Skip to content

[Drop-In UI] Moved CameraModeButtonComponent outside Drop-In UI#6202

Merged
tomaszrybakiewicz merged 4 commits intomainfrom
tr-dropin_extract-component-camera-mode
Aug 24, 2022
Merged

[Drop-In UI] Moved CameraModeButtonComponent outside Drop-In UI#6202
tomaszrybakiewicz merged 4 commits intomainfrom
tr-dropin_extract-component-camera-mode

Conversation

@tomaszrybakiewicz
Copy link
Copy Markdown
Contributor

Part of https://github.com/mapbox/navigation-sdks/issues/1780

TL;DR

This PR adds two new ComponentInstallers: navigationCamera() that simplifies integration of NavigationCamera and cameraModeButton() that toggles between NavigationCameraState.FOLLOWING and NavigationCameraState.OVERVIEW on button press.

MapboxNavigationApp.installComponents(/* LifecycleOwner */ this) {
    cameraModeButton(binding.cameraModeButton)
    navigationCamera(binding.mapView)
}

Description

  • moved CameraModeButtonComponent to libnavui-maps module
  • decoupled CameraModeButtonComponent from the Storeby introducing CameraModeButtonComponentContract
  • added both default and dropin-ui CameraModeButtonComponentContract implementations
  • introduced NavigationCameraComponent that simplifies MapboxNavigationViewportDataSource and NavigaitonCamera integration
  • introduced NavigationCameraGestureComponent that registers NavigationBasicGesturesHandler when attached (NavigationBasicGesturesHandler updates NavigationCamera to IDLE when map gesture is detected)

@tomaszrybakiewicz tomaszrybakiewicz added the UI Work related to visual components, Android Auto, Camera, 3D, voice, etc. label Aug 18, 2022
@tomaszrybakiewicz tomaszrybakiewicz requested a review from a team as a code owner August 18, 2022 18:09
@tomaszrybakiewicz tomaszrybakiewicz changed the title [Drop-In UI] Moved RecenterButtonComponent outside Drop-In UI [Drop-In UI] Moved CameraModeButtonComponent outside Drop-In UI Aug 18, 2022
@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 18, 2022

Codecov Report

Merging #6202 (0b5aad6) into main (61b030e) will decrease coverage by 0.06%.
The diff coverage is 50.90%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #6202      +/-   ##
============================================
- Coverage     68.81%   68.74%   -0.07%     
- Complexity     4300     4308       +8     
============================================
  Files           646      649       +3     
  Lines         25927    26010      +83     
  Branches       3041     3054      +13     
============================================
+ Hits          17841    17881      +40     
- Misses         6931     6969      +38     
- Partials       1155     1160       +5     
Impacted Files Coverage Δ
...box/navigation/dropin/binder/ActionButtonBinder.kt 62.50% <0.00%> (ø)
...navigation/ui/maps/installer/ComponentInstaller.kt 9.37% <0.00%> (-9.98%) ⬇️
...navigation/ui/base/installer/ComponentInstaller.kt 86.66% <33.33%> (-13.34%) ⬇️
...n/ui/maps/internal/ui/CameraModeButtonComponent.kt 63.63% <63.63%> (ø)
...ps/internal/ui/NavigationCameraGestureComponent.kt 70.00% <70.00%> (ø)
...ameramode/CameraModeButtonComponentContractImpl.kt 100.00% <100.00%> (ø)
...n/ui/maps/internal/ui/NavigationCameraComponent.kt 100.00% <100.00%> (ø)
.../navigation/ui/maps/view/MapboxCameraModeButton.kt 92.10% <0.00%> (+9.21%) ⬆️

Copy link
Copy Markdown
Contributor

@abhishek1508 abhishek1508 left a comment

Choose a reason for hiding this comment

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

LGTM. static analysis and unit-tests-core are failing.

@tomaszrybakiewicz

@tomaszrybakiewicz tomaszrybakiewicz force-pushed the tr-dropin_extract-component-camera-mode branch from 5441406 to 847e5b4 Compare August 23, 2022 19:02
@tomaszrybakiewicz
Copy link
Copy Markdown
Contributor Author

@abhishek1508 I fixed the static-analysis problems. Not sure why the changelog-verification check is failing now. CHANGELOG does have the entries that reference this PR.

@dzinad
Copy link
Copy Markdown
Contributor

dzinad commented Aug 24, 2022

Not sure why the changelog-verification check is failing now. CHANGELOG does have the entries that reference this PR.

I think it does not like the empty line... Will fix: #6221

@abhishek1508
Copy link
Copy Markdown
Contributor

@abhishek1508 I fixed the static-analysis problems. Not sure why the changelog-verification check is failing now. CHANGELOG does have the entries that reference this PR.

We are seeing similar issues in android-auto and ticket has been created. Let us merge this PR. @tomaszrybakiewicz

@tomaszrybakiewicz tomaszrybakiewicz merged commit 0fbbe37 into main Aug 24, 2022
@tomaszrybakiewicz tomaszrybakiewicz deleted the tr-dropin_extract-component-camera-mode branch August 24, 2022 13:21
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