@Test public void testChangeListener() { final MockUtils.MockRouteOptionsBuilder builder = new MockUtils.MockRouteOptionsBuilder(); RouteOptions options = builder.withTunnelOptions().build(); mTunnelOptionsPanel.setRouteOptions(options); mTunnelOptionsPanel.setListener(new OptionsPanel.Listener() { @Override public void onOptionCreated(List<OptionItem> item) { mCallbackCalled = false; } @Override public void onOptionChanged(OptionItem item) { mCallbackCalled = true; } }); options = builder.withNoTunnelOptions().build(); mTunnelOptionsPanel.setRouteOptions(options); assertThat(mCallbackCalled, is(true)); }
public void setRouteOptions(final RouteOptions routeOptions) { if (routeOptions == null) { throw new IllegalArgumentException(getString(R.string.msdkui_exception_route_options_null)); } mRouteOptions = routeOptions; select(mRouteOptions.getTruckTunnelCategory()); }
TunnelOptionsPanel extends OptionsPanel implements OptionItem.OnChangedListener { public void setRouteOptions(final RouteOptions routeOptions) { if (routeOptions == null) { throw new IllegalArgumentException(getString(R.string.msdkui_exception_route_options_null)); } mRouteOptions = routeOptions; select(mRouteOptions.getTruckTunnelCategory()); } }
TunnelOptionsPanel extends OptionsPanel implements OptionItem.OnChangedListener { public void setRouteOptions(final RouteOptions routeOptions) { if (routeOptions == null) { throw new IllegalArgumentException(getString(R.string.msdkui_exception_route_options_null)); } mRouteOptions = routeOptions; select(mRouteOptions.getTruckTunnelCategory()); } TunnelOptionsPanel(final Context context);  TunnelOptionsPanel(final Context context, final AttributeSet attrs);  TunnelOptionsPanel(final Context context, final AttributeSet attrs, final int defStyleAttr); @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)  TunnelOptionsPanel(final Context context, final AttributeSet attrs, final int defStyleAttr, final int defStyleRes); }
TunnelOptionsPanel extends OptionsPanel implements OptionItem.OnChangedListener { public void setRouteOptions(final RouteOptions routeOptions) { if (routeOptions == null) { throw new IllegalArgumentException(getString(R.string.msdkui_exception_route_options_null)); } mRouteOptions = routeOptions; select(mRouteOptions.getTruckTunnelCategory()); } TunnelOptionsPanel(final Context context);  TunnelOptionsPanel(final Context context, final AttributeSet attrs);  TunnelOptionsPanel(final Context context, final AttributeSet attrs, final int defStyleAttr); @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)  TunnelOptionsPanel(final Context context, final AttributeSet attrs, final int defStyleAttr, final int defStyleRes); RouteOptions getRouteOptions(); void setRouteOptions(final RouteOptions routeOptions); void populateRouteOptions(); @Override void onChanged(OptionItem item); }
TunnelOptionsPanel extends OptionsPanel implements OptionItem.OnChangedListener { public void setRouteOptions(final RouteOptions routeOptions) { if (routeOptions == null) { throw new IllegalArgumentException(getString(R.string.msdkui_exception_route_options_null)); } mRouteOptions = routeOptions; select(mRouteOptions.getTruckTunnelCategory()); } TunnelOptionsPanel(final Context context);  TunnelOptionsPanel(final Context context, final AttributeSet attrs);  TunnelOptionsPanel(final Context context, final AttributeSet attrs, final int defStyleAttr); @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)  TunnelOptionsPanel(final Context context, final AttributeSet attrs, final int defStyleAttr, final int defStyleRes); RouteOptions getRouteOptions(); void setRouteOptions(final RouteOptions routeOptions); void populateRouteOptions(); @Override void onChanged(OptionItem item);  }