@Test public void testSettingRouteOptions() { final MockUtils.MockRouteOptionsBuilder builder = new MockUtils.MockRouteOptionsBuilder(); mTunnelOptionsPanel.setRouteOptions(builder.withTunnelOptions() .build()); final List<OptionItem> items = mTunnelOptionsPanel.getOptionItems(); assertThat(items.size(), equalTo(1)); SingleChoiceOptionItem item = (SingleChoiceOptionItem) items.get(0); final List<String> labels = item.getLabels(); assertThat(labels.size(), equalTo(5)); String selectedIds = item.getSelectedItemLabel(); assertThat(selectedIds, equalTo(getString(R.string.msdkui_tunnel_cat_c))); mTunnelOptionsPanel.setRouteOptions(builder.withNoTunnelOptions() .build()); selectedIds = item.getSelectedItemLabel(); assertThat(selectedIds, equalTo(getString(R.string.msdkui_undefined))); }
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);  }