Skip to content

Commit

Permalink
NavigationView do not allow way name to show in overview mode
Browse files Browse the repository at this point in the history
  • Loading branch information
danesfeder committed Jan 15, 2019
1 parent c4a30f2 commit a37df85
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void onNavigationLocationUpdate(Location location) {
}

void onWayNameChanged(@NonNull String wayName) {
if (TextUtils.isEmpty(wayName)) {
if (TextUtils.isEmpty(wayName) || view.isSummaryBottomSheetHidden()) {
view.updateWayNameVisibility(false);
return;
}
Expand All @@ -86,4 +86,4 @@ void onRouteOverviewClick() {
view.updateCameraRouteOverview();
view.showRecenterBtn();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,9 @@ public void updateWayNameView(@NonNull String wayName) {
@Override
public void updateWayNameVisibility(boolean isVisible) {
wayNameView.updateVisibility(isVisible);
if (navigationMap != null) {
navigationMap.updateWaynameQueryMap(isVisible);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

public class NavigationPresenterTest {

Expand Down Expand Up @@ -98,6 +99,17 @@ public void onWayNameChanged_mapWayNameIsHidden() {
verify(view).updateWayNameVisibility(false);
}

@Test
public void onWayNameChanged_mapWayNameIsHiddenWithCollapsedBottomsheet() {
NavigationContract.View view = mock(NavigationContract.View.class);
when(view.isSummaryBottomSheetHidden()).thenReturn(true);
NavigationPresenter presenter = new NavigationPresenter(view);

presenter.onWayNameChanged("some valid way name");

verify(view).updateWayNameVisibility(false);
}

@Test
public void onNavigationStopped_mapWayNameIsHidden() {
NavigationContract.View view = mock(NavigationContract.View.class);
Expand Down

0 comments on commit a37df85

Please sign in to comment.