Loading...
Searching...
No Matches
com.navigine.view.DefaultNavigationView Class Reference

Ready-to-use navigation view with built-in UI: zoom controls, floor selector, follow me toggle and user location layer. Automatically wires SDK listeners (building focus, sublocation, camera) and keeps widgets in sync. Use DefaultNavigationViewConfig to customize; config can be updated at runtime via setConfig(). More...

Inherits DefaultNavigineView.

Public Member Functions

 DefaultNavigationView (final Context context)
 Creates location view with provided context. Java code snippet:
 
 DefaultNavigationView (final Context context, final AttributeSet attrs)
 Creates location view with provided context and attributes.
 
 DefaultNavigationView (final Context context, final AttributeSet attrs, final DefaultNavigationViewConfig viewConfig)
 Creates location view with view config only (visibility). Widget configs use defaults. Java code snippet:
 
 DefaultNavigationView (final Context context, final AttributeSet attrs, final DefaultNavigationViewConfig viewConfig, final ZoomControlsConfig zoomConfig, final FollowMeButtonConfig followMeConfig, final FloorSelectorViewConfig floorConfig)
 Creates location view with provided context, attributes and configs. Widget configs are passed directly; null = use defaults.
 
void setViewConfig (DefaultNavigationViewConfig newViewConfig)
 Updates view config (visibility) at runtime.
 
void setConfig (DefaultNavigationViewConfig newViewConfig, ZoomControlsConfig newZoomConfig, FollowMeButtonConfig newFollowMeConfig, FloorSelectorViewConfig newFloorConfig)
 Updates configs at runtime. Changes apply immediately. null params keep current config.
 
DefaultNavigationViewConfig getViewConfig ()
 Returns current view config (visibility).
 
FollowMeButtonConfig getFollowMeButtonConfig ()
 Returns current follow me button config.
 
FollowMeButton getFollowMeButton ()
 Direct access for advanced customization. May be null if widget is hidden.
 

Static Public Attributes

static final String TAG = DefaultNavigationView.class.getCanonicalName()
 

Protected Member Functions

void applyConfigVisibility ()
 
void applyWidgetLayoutParams ()
 
void onAttachedToWindow ()
 
void onDetachedFromWindow ()
 

Detailed Description

Ready-to-use navigation view with built-in UI: zoom controls, floor selector, follow me toggle and user location layer. Automatically wires SDK listeners (building focus, sublocation, camera) and keeps widgets in sync. Use DefaultNavigationViewConfig to customize; config can be updated at runtime via setConfig().

Basic usage with default config: Java code snippet:

// Create with default config
navigationView = new DefaultNavigationView(context);
navigationView.setLayoutParams(new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
));

Kotlin code snippet:

// Create with default config
navigationView = DefaultNavigationView(context).apply {
layoutParams = ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
)
}

Custom config at init (visibility, colors, icons) via DefaultNavigationViewConfig: Java code snippet:

DefaultNavigationViewConfig viewConfig = DefaultNavigationViewConfig.builder()
.visibleWidgets(DefaultNavigationViewConfig.WIDGET_ZOOM_CONTROLS | DefaultNavigationViewConfig.WIDGET_FOLLOW_ME)
.build();
ZoomControlsConfig zoomConfig = ZoomControlsConfig.builder()
.buttonBackgroundColor(0xF2FAFAFA)
.build();
FollowMeButtonConfig followMeConfig = FollowMeButtonConfig.builder()
.accentColor(0xFF30AAD9)
.build();
// followMeConfig.followMeIcon(drawable);
// zoomConfig.zoomInIcon(drawable); zoomConfig.zoomOutIcon(drawable);

Kotlin code snippet:

val viewConfig = DefaultNavigationViewConfig.builder()
.visibleWidgets(DefaultNavigationViewConfig.WIDGET_ZOOM_CONTROLS or DefaultNavigationViewConfig.WIDGET_FOLLOW_ME)
.build()
val zoomConfig = ZoomControlsConfig.builder()
.buttonBackgroundColor(0xF2FAFAFA.toInt())
.build()
val followMeConfig = FollowMeButtonConfig.builder()
.accentColor(0xFF30AAD9.toInt())
.build()
// followMeConfig.followMeIcon(drawable)
// zoomConfig.zoomInIcon(drawable); zoomConfig.zoomOutIcon(drawable)

Runtime config update: Java code snippet:

if (navigationView != null) {
DefaultNavigationViewConfig newViewConfig = DefaultNavigationViewConfig.builder()
.visibleWidgets(DefaultNavigationViewConfig.WIDGET_FOLLOW_ME)
.build();
FollowMeButtonConfig newFollowMeConfig = FollowMeButtonConfig.builder()
.accentColor(0xFFFF0000)
.build();
navigationView.setConfig(newViewConfig, null, newFollowMeConfig, null); // null = keep current
}

Kotlin code snippet:

navigationView?.setConfig(
DefaultNavigationViewConfig.builder()
.visibleWidgets(DefaultNavigationViewConfig.WIDGET_FOLLOW_ME)
.build(),
null,
FollowMeButtonConfig.builder()
.accentColor(0xFFFF0000.toInt())
.build(),
null
) // null = keep current

Direct widget access for advanced customization: Java code snippet:

if (navigationView != null) {
ZoomControls zoomControls = navigationView.getZoomControls();
FollowMeButton followMeButton = navigationView.getFollowMeButton();
FloorSelectorView floorSelector = navigationView.getFloorSelectorView();
// Use for advanced customization (may be null if widget is hidden)
}

Kotlin code snippet:

navigationView?.let { view ->
val zoomControls: ZoomControls? = view.zoomControls
val followMeButton: FollowMeButton? = view.followMeButton
val floorSelector: FloorSelectorView? = view.floorSelectorView
// Use for advanced customization (may be null if widget is hidden)
}

Definition at line 65 of file DefaultNavigationView.java.

Constructor & Destructor Documentation

◆ DefaultNavigationView() [1/4]

com.navigine.view.DefaultNavigationView.DefaultNavigationView ( final Context context)
inline

Creates location view with provided context. Java code snippet:

// Create with default config
navigationView = new DefaultNavigationView(context);
navigationView.setLayoutParams(new ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
));

Kotlin code snippet:

// Create with default config
navigationView = DefaultNavigationView(context).apply {
layoutParams = ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT
)
}

Definition at line 83 of file DefaultNavigationView.java.

◆ DefaultNavigationView() [2/4]

com.navigine.view.DefaultNavigationView.DefaultNavigationView ( final Context context,
final AttributeSet attrs )
inline

Creates location view with provided context and attributes.

Definition at line 88 of file DefaultNavigationView.java.

◆ DefaultNavigationView() [3/4]

com.navigine.view.DefaultNavigationView.DefaultNavigationView ( final Context context,
final AttributeSet attrs,
final DefaultNavigationViewConfig viewConfig )
inline

Creates location view with view config only (visibility). Widget configs use defaults. Java code snippet:

// Create with custom configs (configs passed directly to view)
DefaultNavigationViewConfig viewConfig = DefaultNavigationViewConfig.builder()
.hideFloorSelector()
.build();
FollowMeButtonConfig followMeConfig = FollowMeButtonConfig.builder()
.accentColor(0xFF30AAD9)
.build();
DefaultNavigationView customView = new DefaultNavigationView(context, null, viewConfig, null, followMeConfig, null);

Kotlin code snippet:

// Create with custom configs (configs passed directly)
val viewConfig = DefaultNavigationViewConfig.builder()
.hideFloorSelector()
.build()
val followMeConfig = FollowMeButtonConfig.builder()
.accentColor(0xFF30AAD9.toInt())
.build()
val customView = DefaultNavigationView(context, null, viewConfig, null, followMeConfig, null)

Definition at line 101 of file DefaultNavigationView.java.

◆ DefaultNavigationView() [4/4]

com.navigine.view.DefaultNavigationView.DefaultNavigationView ( final Context context,
final AttributeSet attrs,
final DefaultNavigationViewConfig viewConfig,
final ZoomControlsConfig zoomConfig,
final FollowMeButtonConfig followMeConfig,
final FloorSelectorViewConfig floorConfig )
inline

Creates location view with provided context, attributes and configs. Widget configs are passed directly; null = use defaults.

Definition at line 110 of file DefaultNavigationView.java.

Member Function Documentation

◆ applyConfigVisibility()

void com.navigine.view.DefaultNavigationView.applyConfigVisibility ( )
inlineprotected

Definition at line 174 of file DefaultNavigationView.java.

◆ applyWidgetLayoutParams()

void com.navigine.view.DefaultNavigationView.applyWidgetLayoutParams ( )
inlineprotected

Definition at line 184 of file DefaultNavigationView.java.

◆ getFollowMeButton()

FollowMeButton com.navigine.view.DefaultNavigationView.getFollowMeButton ( )
inline

Direct access for advanced customization. May be null if widget is hidden.

Definition at line 261 of file DefaultNavigationView.java.

◆ getFollowMeButtonConfig()

FollowMeButtonConfig com.navigine.view.DefaultNavigationView.getFollowMeButtonConfig ( )
inline

Returns current follow me button config.

Definition at line 258 of file DefaultNavigationView.java.

◆ getViewConfig()

DefaultNavigationViewConfig com.navigine.view.DefaultNavigationView.getViewConfig ( )
inline

Returns current view config (visibility).

Definition at line 253 of file DefaultNavigationView.java.

◆ onAttachedToWindow()

void com.navigine.view.DefaultNavigationView.onAttachedToWindow ( )
inlineprotected

Definition at line 264 of file DefaultNavigationView.java.

◆ onDetachedFromWindow()

void com.navigine.view.DefaultNavigationView.onDetachedFromWindow ( )
inlineprotected

Definition at line 270 of file DefaultNavigationView.java.

◆ setConfig()

void com.navigine.view.DefaultNavigationView.setConfig ( DefaultNavigationViewConfig newViewConfig,
ZoomControlsConfig newZoomConfig,
FollowMeButtonConfig newFollowMeConfig,
FloorSelectorViewConfig newFloorConfig )
inline

Updates configs at runtime. Changes apply immediately. null params keep current config.

Java code snippet:

if (navigationView != null) {
DefaultNavigationViewConfig newViewConfig = DefaultNavigationViewConfig.builder()
.visibleWidgets(DefaultNavigationViewConfig.WIDGET_FOLLOW_ME)
.build();
FollowMeButtonConfig newFollowMeConfig = FollowMeButtonConfig.builder()
.accentColor(0xFFFF0000)
.build();
navigationView.setConfig(newViewConfig, null, newFollowMeConfig, null); // null = keep current
}

Kotlin code snippet:

navigationView?.setConfig(
DefaultNavigationViewConfig.builder()
.visibleWidgets(DefaultNavigationViewConfig.WIDGET_FOLLOW_ME)
.build(),
null,
FollowMeButtonConfig.builder()
.accentColor(0xFFFF0000.toInt())
.build(),
null
) // null = keep current

Definition at line 241 of file DefaultNavigationView.java.

◆ setViewConfig()

void com.navigine.view.DefaultNavigationView.setViewConfig ( DefaultNavigationViewConfig newViewConfig)
inline

Updates view config (visibility) at runtime.

Definition at line 226 of file DefaultNavigationView.java.

Member Data Documentation

◆ TAG

final String com.navigine.view.DefaultNavigationView.TAG = DefaultNavigationView.class.getCanonicalName()
static

Definition at line 66 of file DefaultNavigationView.java.


The documentation for this class was generated from the following file: