Skip to content

Commit 65c74ce

Browse files
tomaszrybakiewiczabhishek1508
authored andcommitted
CHANGELOG entry + KDocs updates
1 parent 57ed0da commit 65c74ce

File tree

4 files changed

+42
-34
lines changed

4 files changed

+42
-34
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Mapbox welcomes participation and contributions from everyone.
44

55
## Unreleased
66
#### Features
7+
- Added `ViewBinderCustomization.actionCompassButtonBinder`, `ViewBinderCustomization.actionCameraModeButtonBinder`, `ViewBinderCustomization.actionToggleAudioButtonBinder` and `ViewBinderCustomization.actionRecenterButtonBinder` that allows injection of a custom Compass, Camera Mode, Toggle Voice Instructions and Camera Recenter Buttons in `NavigationView`. [#6490](https://github.com/mapbox/mapbox-navigation-android/pull/6490)
8+
- Introduced `ActionButtonsBinder` base `UIBinder` class, that allows use of a custom action buttons layout with default action buttons in `NavigationView`. [#6490](https://github.com/mapbox/mapbox-navigation-android/pull/6490)
79
#### Bug fixes and improvements
810
- Improved precision of congestion visualization and independent leg styling transitions, especially for long routes. [#6476](https://github.com/mapbox/mapbox-navigation-android/pull/6476)
911
- Fixed an issue with congestion visualization on the route line that occurred during route refreshes. [#6476](https://github.com/mapbox/mapbox-navigation-android/pull/6476)

libnavui-dropin/src/main/java/com/mapbox/navigation/dropin/ViewBinderCustomization.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,28 +119,28 @@ class ViewBinderCustomization {
119119

120120
/**
121121
* Customize the Compass Action Button by providing your own [UIBinder]
122-
* when using [actionButtonsBinder] with [ActionButtonsBinder] implementation.
122+
* when using [actionButtonsBinder] with [ActionButtonsBinder.defaultBinder] implementation.
123123
* Use [UIBinder.USE_DEFAULT] to reset to default.
124124
*/
125125
var actionCompassButtonBinder: UIBinder? = null
126126

127127
/**
128128
* Customize the Camera Mode Action Button by providing your own [UIBinder]
129-
* when using [actionButtonsBinder] with [ActionButtonsBinder] implementation.
129+
* when using [actionButtonsBinder] with [ActionButtonsBinder.defaultBinder] implementation.
130130
* Use [UIBinder.USE_DEFAULT] to reset to default.
131131
*/
132132
var actionCameraModeButtonBinder: UIBinder? = null
133133

134134
/**
135135
* Customize the Toggle Audio Guidance Action Button by providing your own [UIBinder]
136-
* when using [actionButtonsBinder] with [ActionButtonsBinder] implementation.
136+
* when using [actionButtonsBinder] with [ActionButtonsBinder.defaultBinder] implementation.
137137
* Use [UIBinder.USE_DEFAULT] to reset to default.
138138
*/
139139
var actionToggleAudioButtonBinder: UIBinder? = null
140140

141141
/**
142142
* Customize the Recenter Camera Action Button by providing your own [UIBinder]
143-
* when using [actionButtonsBinder] with [ActionButtonsBinder] implementation.
143+
* when using [actionButtonsBinder] with [ActionButtonsBinder.defaultBinder] implementation.
144144
* Use [UIBinder.USE_DEFAULT] to reset to default.
145145
*/
146146
var actionRecenterButtonBinder: UIBinder? = null

libnavui-dropin/src/main/java/com/mapbox/navigation/dropin/actionbutton/ActionButtonsBinder.kt

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ abstract class ActionButtonsBinder : UIBinder {
3535
* @param layoutInflater The LayoutInflater service.
3636
* @param root Parent view that provides a set of LayoutParams values for root of the returned hierarchy.
3737
*
38-
* @return ViewGroup that can host both header and content layouts.
38+
* @return ViewGroup that can host action button layout.
3939
* Returned view must not be attached to the root view.
4040
*/
4141
@UiThread
@@ -183,32 +183,3 @@ abstract class ActionButtonsBinder : UIBinder {
183183
fun defaultBinder(): ActionButtonsBinder = MapboxActionButtonsBinder()
184184
}
185185
}
186-
187-
/**
188-
* Default Action Buttons Binder implementation.
189-
*/
190-
@ExperimentalPreviewMapboxNavigationAPI
191-
internal class MapboxActionButtonsBinder : ActionButtonsBinder() {
192-
193-
override fun onCreateLayout(layoutInflater: LayoutInflater, root: ViewGroup): ViewGroup =
194-
layoutInflater
195-
.inflate(R.layout.mapbox_action_buttons_layout, root, false) as ViewGroup
196-
197-
override fun getCustomButtonsStartContainer(layout: ViewGroup): ViewGroup? =
198-
layout.findViewById(R.id.buttonsContainerTop)
199-
200-
override fun getCompassButtonContainer(layout: ViewGroup): ViewGroup? =
201-
layout.findViewById(R.id.buttonsContainerCompass)
202-
203-
override fun getCameraModeButtonContainer(layout: ViewGroup): ViewGroup? =
204-
layout.findViewById(R.id.buttonsContainerCamera)
205-
206-
override fun getToggleAudioButtonContainer(layout: ViewGroup): ViewGroup? =
207-
layout.findViewById(R.id.buttonsContainerAudio)
208-
209-
override fun getRecenterButtonContainer(layout: ViewGroup): ViewGroup? =
210-
layout.findViewById(R.id.buttonsContainerRecenter)
211-
212-
override fun getCustomButtonsEndContainer(layout: ViewGroup): ViewGroup? =
213-
layout.findViewById(R.id.buttonsContainerBottom)
214-
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package com.mapbox.navigation.dropin.actionbutton
2+
3+
import android.view.LayoutInflater
4+
import android.view.ViewGroup
5+
import com.mapbox.navigation.base.ExperimentalPreviewMapboxNavigationAPI
6+
import com.mapbox.navigation.dropin.R
7+
8+
/**
9+
* Default Action Buttons Binder implementation.
10+
*/
11+
@ExperimentalPreviewMapboxNavigationAPI
12+
internal class MapboxActionButtonsBinder : ActionButtonsBinder() {
13+
14+
override fun onCreateLayout(layoutInflater: LayoutInflater, root: ViewGroup): ViewGroup =
15+
layoutInflater
16+
.inflate(R.layout.mapbox_action_buttons_layout, root, false) as ViewGroup
17+
18+
override fun getCustomButtonsStartContainer(layout: ViewGroup): ViewGroup? =
19+
layout.findViewById(R.id.buttonsContainerTop)
20+
21+
override fun getCompassButtonContainer(layout: ViewGroup): ViewGroup? =
22+
layout.findViewById(R.id.buttonsContainerCompass)
23+
24+
override fun getCameraModeButtonContainer(layout: ViewGroup): ViewGroup? =
25+
layout.findViewById(R.id.buttonsContainerCamera)
26+
27+
override fun getToggleAudioButtonContainer(layout: ViewGroup): ViewGroup? =
28+
layout.findViewById(R.id.buttonsContainerAudio)
29+
30+
override fun getRecenterButtonContainer(layout: ViewGroup): ViewGroup? =
31+
layout.findViewById(R.id.buttonsContainerRecenter)
32+
33+
override fun getCustomButtonsEndContainer(layout: ViewGroup): ViewGroup? =
34+
layout.findViewById(R.id.buttonsContainerBottom)
35+
}

0 commit comments

Comments
 (0)