@Test public void testHandleManeuverEvent() { final Maneuver maneuver = MockUtils.mockManeuver(); GuidanceStreetLabelListener listener = mock(GuidanceStreetLabelListener.class); mGuidanceStreetLabelPresenter.addListener(listener); when(mNavigationManager.getNextManeuver()).thenReturn(maneuver); when(mNavigationManager.getNextManeuverDistance()).thenReturn(200L); mGuidanceStreetLabelPresenter.handleManeuverEvent(); verify(listener, times(2)).onDataChanged(any()); }
@Override public void handleManeuverEvent() { final Maneuver nextManeuver = getNextManeuver(); if (nextManeuver != null) { final String currentStreetInfo = GuidanceManeuverUtil.getCurrentManeuverStreet(mContext, nextManeuver); final GuidanceStreetLabelData data = new GuidanceStreetLabelData(currentStreetInfo, ThemeUtil.getColor(mContext, R.attr.colorPositive)); notifyDataChanged(data); } }
GuidanceStreetLabelPresenter extends BaseGuidancePresenter { @Override public void handleManeuverEvent() { final Maneuver nextManeuver = getNextManeuver(); if (nextManeuver != null) { final String currentStreetInfo = GuidanceManeuverUtil.getCurrentManeuverStreet(mContext, nextManeuver); final GuidanceStreetLabelData data = new GuidanceStreetLabelData(currentStreetInfo, ThemeUtil.getColor(mContext, R.attr.colorPositive)); notifyDataChanged(data); } } }
GuidanceStreetLabelPresenter extends BaseGuidancePresenter { @Override public void handleManeuverEvent() { final Maneuver nextManeuver = getNextManeuver(); if (nextManeuver != null) { final String currentStreetInfo = GuidanceManeuverUtil.getCurrentManeuverStreet(mContext, nextManeuver); final GuidanceStreetLabelData data = new GuidanceStreetLabelData(currentStreetInfo, ThemeUtil.getColor(mContext, R.attr.colorPositive)); notifyDataChanged(data); } } GuidanceStreetLabelPresenter(Context context, NavigationManager navigationManager,
                                        Route route); }
GuidanceStreetLabelPresenter extends BaseGuidancePresenter { @Override public void handleManeuverEvent() { final Maneuver nextManeuver = getNextManeuver(); if (nextManeuver != null) { final String currentStreetInfo = GuidanceManeuverUtil.getCurrentManeuverStreet(mContext, nextManeuver); final GuidanceStreetLabelData data = new GuidanceStreetLabelData(currentStreetInfo, ThemeUtil.getColor(mContext, R.attr.colorPositive)); notifyDataChanged(data); } } GuidanceStreetLabelPresenter(Context context, NavigationManager navigationManager,
                                        Route route); @Override void handleNewInstructionEvent(); @Override void handleManeuverEvent(); void addListener(GuidanceStreetLabelListener listener); void removeListener(GuidanceStreetLabelListener listener); }
GuidanceStreetLabelPresenter extends BaseGuidancePresenter { @Override public void handleManeuverEvent() { final Maneuver nextManeuver = getNextManeuver(); if (nextManeuver != null) { final String currentStreetInfo = GuidanceManeuverUtil.getCurrentManeuverStreet(mContext, nextManeuver); final GuidanceStreetLabelData data = new GuidanceStreetLabelData(currentStreetInfo, ThemeUtil.getColor(mContext, R.attr.colorPositive)); notifyDataChanged(data); } } GuidanceStreetLabelPresenter(Context context, NavigationManager navigationManager,
                                        Route route); @Override void handleNewInstructionEvent(); @Override void handleManeuverEvent(); void addListener(GuidanceStreetLabelListener listener); void removeListener(GuidanceStreetLabelListener listener);  }