package cl.smartcities.isci.transportinspector.router.stepInnerStrategy;

import android.content.Context;
import android.content.res.Resources;
import android.support.v4.content.ContextCompat;
import android.view.View;

import cl.smartcities.isci.transportinspector.R;
import cl.smartcities.isci.transportinspector.router.transappStep.StepViewHolder;

/**
 * Created by Agustin Antoine on 26-09-2016.
 */
public class BusStrategy implements StepStrategy{

    private final String busService;
    private final int busDrawable;

    public BusStrategy(int busDrawable, String busService) {
        this.busDrawable = busDrawable;
        this.busService = busService;
    }

    @Override
    public void setStepHolder(Context context, StepViewHolder holder, String time) {
        holder.busIcon.setImageDrawable(ContextCompat.getDrawable(context, busDrawable));
        holder.busService.setText(busService);
        Resources res = context.getResources();
        holder.stepTimeBus.setText(String.format(res.getString(R.string.transit_step_time), time));
        holder.busLayout.setVisibility(View.VISIBLE);
    }
}
