class RouteDescriptionItem extends BaseView {

    public void setRoute(final Route route) {
        if (route == null) {
            throw new IllegalArgumentException(getContext().getString(R.string.msdkui_exception_route_null));
        }
        mRoute = route;

        final ImageView icon = (ImageView) mSections.get(Section.TYPE_ICON);
        final Integer id = RouteUtil.getIcon(mRoute);
        if (id == 0) {
            icon.setVisibility(GONE);
        } else {
            icon.setImageResource(id);
            icon.setColorFilter(ThemeUtil.getColor(getContext(), R.attr.colorForeground), PorterDuff.Mode.SRC_ATOP);
        }

        final Spannable totalTime = RouteUtil.getTimeToArrive(getContext(), mRoute, isTrafficEnabled());
        ((TextView) mSections.get(Section.TIME)).setText(totalTime);
        ((TextView) mSections.get(Section.TIME)).setContentDescription(
                getContext().getString(R.string.msdkui_duration) + " " + totalTime);

        if (isTrafficEnabled() && !isBikeOrPedestrian()) {
            ((TextView) mSections.get(Section.TRAFFIC_WARNING)).setVisibility(View.VISIBLE);
            final Spannable delayText = RouteUtil.getTrafficDelayed(getContext(), mRoute);
            ((TextView) mSections.get(Section.TRAFFIC_WARNING)).setText(delayText);
            ((TextView) mSections.get(Section.TRAFFIC_WARNING)).setContentDescription(delayText.toString().replace(
                    getContext().getString(R.string.msdkui_incl),
                    getContext().getString(R.string.msdkui_including)));

        } else {
            ((TextView) mSections.get(Section.TRAFFIC_WARNING)).setVisibility(GONE);
        }

        ((TextView) mSections.get(Section.DETAILS)).setText(
                RouteUtil.getDetails(getContext(), mRoute, mUnitSystem));
        ((SectionBar) mSections.get(Section.SECTION_BAR))
                .bind(RouteUtil.getSectionBar(getContext(), mRoute), mSectionBarScaling);

        final String arrivalTime = RouteUtil.getArrivalTime(getContext(), mRoute, isTrafficEnabled());
        ((TextView) mSections.get(Section.ARRIVAL_TIME)).setText(arrivalTime);
        ((TextView) mSections.get(Section.ARRIVAL_TIME)).setContentDescription(
                getContext().getString(R.string.msdkui_arrive_at) +
                        arrivalTime);
        setVisibility(VISIBLE);
    }

    public  RouteDescriptionItem(final Context context);
    public  RouteDescriptionItem(final Context context, final AttributeSet attrs);
    public  RouteDescriptionItem(final Context context, final AttributeSet attrs, final int defStyleAttr);
    @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) public  RouteDescriptionItem(final Context context, final AttributeSet attrs, final int defStyleAttr,
            final int defStyleRes);

}