Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2e35550
Convert NavigationView to a plain view rather than Activity
danesfeder Oct 10, 2017
18fc327
Merge branch 'master' into dan-nav-view
danesfeder Oct 10, 2017
acb1041
Add listener for notifying when navigation has ended
danesfeder Oct 11, 2017
ac580ef
Merge branch 'dan-nav-view' of github.com:mapbox/mapbox-navigation-an…
danesfeder Oct 11, 2017
c80efd2
Merge branch 'master' into dan-nav-view
danesfeder Oct 11, 2017
07ef0d1
Add leg steps if current step count is 0. This will always be the ca…
danesfeder Oct 11, 2017
07de8f2
Merge branch 'dan-nav-view' of github.com:mapbox/mapbox-navigation-an…
danesfeder Oct 11, 2017
4bcb132
Fix shadow hide / show throwing off bottomsheet peek height
danesfeder Oct 11, 2017
98d8eb7
Use target distance for initial zoom
danesfeder Oct 11, 2017
1bc4ca2
Merge branch 'master' into dan-nav-view
danesfeder Oct 11, 2017
f2410f3
Merge branch 'master' into dan-nav-view
danesfeder Oct 11, 2017
149e8de
Add map padding to prevent bottomsheet from covering puck
danesfeder Oct 12, 2017
7c68eb9
Merge branch 'master' into dan-nav-view
danesfeder Oct 12, 2017
2f69360
Merge branch 'dan-nav-view' of github.com:mapbox/mapbox-navigation-an…
danesfeder Oct 12, 2017
9dd932b
Add Null check on the notification manager (#332)
danesfeder Oct 11, 2017
a6fc167
send feedback identifier when the event happens (#359)
Guardiola31337 Oct 11, 2017
5e9a293
Send empty arrays properly (#354)
Guardiola31337 Oct 11, 2017
8721808
Account for different landscape view when adjusting drawable colors A…
danesfeder Oct 11, 2017
e45f3a1
Set target distance based on view percentage of screen
danesfeder Oct 12, 2017
78538fd
Merge branch 'master' into dan-nav-view
danesfeder Oct 12, 2017
e458c2b
Merge branch 'dan-nav-view' of github.com:mapbox/mapbox-navigation-an…
danesfeder Oct 12, 2017
8f9495d
Throw class cast exceptions when NavigationView is inflated with inva…
danesfeder Oct 12, 2017
1a27d14
Launch coordinates with navigation activity
danesfeder Oct 12, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libandroid-navigation-ui/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android">

<application>
<activity android:name=".NavigationView"/>
<activity android:name=".NavigationActivity"/>
</application>

</manifest>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
package com.mapbox.services.android.navigation.ui.v5;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

public class NavigationActivity extends AppCompatActivity implements NavigationViewListener {

private NavigationView navigationView;

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
setTheme(R.style.Theme_AppCompat_NoActionBar);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_navigation);
navigationView = findViewById(R.id.navigationView);
navigationView.onCreate(savedInstanceState);
navigationView.getNavigationAsync(this);
}

@Override
protected void onStart() {
super.onStart();
navigationView.onStart();
}

@Override
public void onResume() {
super.onResume();
navigationView.onResume();
}

@Override
public void onPause() {
super.onPause();
navigationView.onPause();
}

@Override
public void onLowMemory() {
super.onLowMemory();
navigationView.onLowMemory();
}

@Override
protected void onStop() {
super.onStop();
navigationView.onStop();
}

@Override
protected void onDestroy() {
super.onDestroy();
navigationView.onDestroy();
}

@Override
protected void onSaveInstanceState(Bundle outState) {
navigationView.onSaveInstanceState(outState);
super.onSaveInstanceState(outState);
}

@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
navigationView.onRestoreInstanceState(savedInstanceState);
}

@Override
public void onNavigationReady() {
navigationView.startNavigation(this);
}

@Override
public void onNavigationFinished() {
finish();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,13 @@ interface View {
void animateExpandArrowRotation(float value);

void animateInstructionViewAlpha(float value);

int getBottomSheetHeight();

int getBottomSheetPeekHeight();

int[] getMapPadding();

void setMapPadding(int left, int top, int right, int bottom);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ public static void startNavigation(Activity activity, DirectionsRoute route,
editor.putBoolean(NavigationConstants.NAVIGATION_VIEW_SIMULATE_ROUTE, simulateRoute);
editor.apply();

Intent navigationView = new Intent(activity, NavigationView.class);
Intent navigationActivity = new Intent(activity, NavigationActivity.class);
Bundle bundle = new Bundle();
bundle.putBoolean(NavigationConstants.NAVIGATION_VIEW_LAUNCH_ROUTE, true);
navigationView.putExtras(bundle);
activity.startActivity(navigationView);
navigationActivity.putExtras(bundle);
activity.startActivity(navigationActivity);
}

/**
Expand Down Expand Up @@ -85,11 +85,11 @@ public static void startNavigation(Activity activity, Position origin, Position
editor.putBoolean(NavigationConstants.NAVIGATION_VIEW_SIMULATE_ROUTE, simulateRoute);
editor.apply();

Intent navigationView = new Intent(activity, NavigationView.class);
Intent navigationActivity = new Intent(activity, NavigationActivity.class);
Bundle bundle = new Bundle();
bundle.putBoolean(NavigationConstants.NAVIGATION_VIEW_LAUNCH_ROUTE, false);
navigationView.putExtras(bundle);
activity.startActivity(navigationView);
navigationActivity.putExtras(bundle);
activity.startActivity(navigationActivity);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,20 @@ void onSummaryBottomSheetExpanded() {

if (view.isSummaryDirectionsVisible()) {
view.setSheetShadowVisibility(false);
} else {
view.setMapPadding(0, 0, 0, view.getBottomSheetHeight());
}
}

void onSummaryBottomSheetCollapsed() {
view.setCancelBtnClickable(true);
view.setSummaryOptionsVisibility(true);
view.setSummaryDirectionsVisibility(false);

int bottomPadding = view.getMapPadding()[3];
if (bottomPadding != view.getBottomSheetPeekHeight()) {
view.setMapPadding(0, 0, 0, view.getBottomSheetPeekHeight());
}
}

void onSummaryBottomSheetHidden() {
Expand Down
Loading