@Test public void testChangeListener() { DynamicPenalty dynamicPenalty = MockUtils.getDynamicPenality(Route.TrafficPenaltyMode.DISABLED); mTrafficOptionsPanel.setDynamicPenalty(dynamicPenalty); mTrafficOptionsPanel.setListener(new OptionsPanel.Listener() { @Override public void onOptionCreated(List<OptionItem> item) { mCallbackCalled = false; } @Override public void onOptionChanged(OptionItem item) { mCallbackCalled = true; } }); dynamicPenalty = MockUtils.getDynamicPenality(Route.TrafficPenaltyMode.AVOID_LONG_TERM_CLOSURES); mTrafficOptionsPanel.setDynamicPenalty(dynamicPenalty); assertThat(mCallbackCalled, is(true)); }
public void setDynamicPenalty(final DynamicPenalty penalty) { mDynamicPenalty = penalty; select(mDynamicPenalty.getTrafficPenaltyMode()); }
TrafficOptionsPanel extends OptionsPanel implements OptionItem.OnChangedListener { public void setDynamicPenalty(final DynamicPenalty penalty) { mDynamicPenalty = penalty; select(mDynamicPenalty.getTrafficPenaltyMode()); } }
TrafficOptionsPanel extends OptionsPanel implements OptionItem.OnChangedListener { public void setDynamicPenalty(final DynamicPenalty penalty) { mDynamicPenalty = penalty; select(mDynamicPenalty.getTrafficPenaltyMode()); } TrafficOptionsPanel(final Context context);  TrafficOptionsPanel(final Context context, final AttributeSet attrs);  TrafficOptionsPanel(final Context context, final AttributeSet attrs, final int defStyleAttr); @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)  TrafficOptionsPanel(final Context context, final AttributeSet attrs, final int defStyleAttr, final int defStyleRes); }
TrafficOptionsPanel extends OptionsPanel implements OptionItem.OnChangedListener { public void setDynamicPenalty(final DynamicPenalty penalty) { mDynamicPenalty = penalty; select(mDynamicPenalty.getTrafficPenaltyMode()); } TrafficOptionsPanel(final Context context);  TrafficOptionsPanel(final Context context, final AttributeSet attrs);  TrafficOptionsPanel(final Context context, final AttributeSet attrs, final int defStyleAttr); @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)  TrafficOptionsPanel(final Context context, final AttributeSet attrs, final int defStyleAttr, final int defStyleRes); DynamicPenalty getDynamicPenalty(); void setDynamicPenalty(final DynamicPenalty penalty); void populateDynamicPenalty(); @Override void onChanged(OptionItem item); }
TrafficOptionsPanel extends OptionsPanel implements OptionItem.OnChangedListener { public void setDynamicPenalty(final DynamicPenalty penalty) { mDynamicPenalty = penalty; select(mDynamicPenalty.getTrafficPenaltyMode()); } TrafficOptionsPanel(final Context context);  TrafficOptionsPanel(final Context context, final AttributeSet attrs);  TrafficOptionsPanel(final Context context, final AttributeSet attrs, final int defStyleAttr); @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)  TrafficOptionsPanel(final Context context, final AttributeSet attrs, final int defStyleAttr, final int defStyleRes); DynamicPenalty getDynamicPenalty(); void setDynamicPenalty(final DynamicPenalty penalty); void populateDynamicPenalty(); @Override void onChanged(OptionItem item);  }