@Test public void testUIInit() { final TextView etaView = mEstimatedArrivalView.findViewById(R.id.eta); final TextView distanceView = mEstimatedArrivalView.findViewById(R.id.distance); final TextView durationView = mEstimatedArrivalView.findViewById(R.id.duration); final TextView dotView = mEstimatedArrivalView.findViewById(R.id.dot); assertThat(etaView.getText().toString(), is(getString(R.string.msdkui_value_not_available))); assertThat(distanceView.getText().toString(), is(getString(R.string.msdkui_value_not_available))); assertThat(durationView.getText().toString(), is(getString(R.string.msdkui_value_not_available))); assertThat(dotView.getText().toString(), is(getString(R.string.msdkui_bullet))); GuidanceEstimatedArrivalViewData data = new GuidanceEstimatedArrivalViewData(ETA_DATE, DISTANCE, DURATION); mEstimatedArrivalView.setEstimatedArrivalData(data); assertEquals(etaView.getVisibility(), View.VISIBLE); assertEquals(distanceView.getVisibility(), View.VISIBLE); assertEquals(durationView.getVisibility(), View.VISIBLE); assertEquals(dotView.getVisibility(), View.VISIBLE); assertThat(etaView.getText(), is(equalTo(DateFormatterUtil.format(getApplicationContext(), ETA_DATE)))); assertThat(distanceView.getText(), is(equalTo("10 km"))); assertThat(durationView.getText(), is("2 min")); }
public void setEstimatedArrivalData(@Nullable GuidanceEstimatedArrivalViewData data) { mData = data; populate(data); }
GuidanceEstimatedArrivalView extends BaseView { public void setEstimatedArrivalData(@Nullable GuidanceEstimatedArrivalViewData data) { mData = data; populate(data); } }
GuidanceEstimatedArrivalView extends BaseView { public void setEstimatedArrivalData(@Nullable GuidanceEstimatedArrivalViewData data) { mData = data; populate(data); } GuidanceEstimatedArrivalView(Context context);  GuidanceEstimatedArrivalView(Context context, @Nullable AttributeSet attrs);  GuidanceEstimatedArrivalView(Context context, @Nullable AttributeSet attrs, int defStyleAttr); @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)  GuidanceEstimatedArrivalView(Context context, @Nullable AttributeSet attrs, int defStyleAttr,
                                        int defStyleRes); }
GuidanceEstimatedArrivalView extends BaseView { public void setEstimatedArrivalData(@Nullable GuidanceEstimatedArrivalViewData data) { mData = data; populate(data); } GuidanceEstimatedArrivalView(Context context);  GuidanceEstimatedArrivalView(Context context, @Nullable AttributeSet attrs);  GuidanceEstimatedArrivalView(Context context, @Nullable AttributeSet attrs, int defStyleAttr); @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)  GuidanceEstimatedArrivalView(Context context, @Nullable AttributeSet attrs, int defStyleAttr,
                                        int defStyleRes); @Nullable GuidanceEstimatedArrivalViewData getEstimatedArrivalData(); void setEstimatedArrivalData(@Nullable GuidanceEstimatedArrivalViewData data); @Override void onRestoreInstanceState(Parcelable state); }
GuidanceEstimatedArrivalView extends BaseView { public void setEstimatedArrivalData(@Nullable GuidanceEstimatedArrivalViewData data) { mData = data; populate(data); } GuidanceEstimatedArrivalView(Context context);  GuidanceEstimatedArrivalView(Context context, @Nullable AttributeSet attrs);  GuidanceEstimatedArrivalView(Context context, @Nullable AttributeSet attrs, int defStyleAttr); @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)  GuidanceEstimatedArrivalView(Context context, @Nullable AttributeSet attrs, int defStyleAttr,
                                        int defStyleRes); @Nullable GuidanceEstimatedArrivalViewData getEstimatedArrivalData(); void setEstimatedArrivalData(@Nullable GuidanceEstimatedArrivalViewData data); @Override void onRestoreInstanceState(Parcelable state);  }