|
|
|
|
@@ -1,7 +1,6 @@
|
|
|
|
|
package com.mogo.och.bus.adapter;
|
|
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
|
import android.graphics.Color;
|
|
|
|
|
import android.view.LayoutInflater;
|
|
|
|
|
import android.view.View;
|
|
|
|
|
import android.view.ViewGroup;
|
|
|
|
|
@@ -15,7 +14,6 @@ import com.mogo.och.bus.R;
|
|
|
|
|
import com.mogo.och.bus.bean.OchBusStation;
|
|
|
|
|
import com.mogo.och.bus.constant.OchBusConst;
|
|
|
|
|
import com.mogo.och.bus.view.VerticalDashLineView;
|
|
|
|
|
import com.mogo.utils.logger.Logger;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
@@ -58,12 +56,12 @@ public class OchBusStationAdapter extends RecyclerView.Adapter<OchBusStationAdap
|
|
|
|
|
// Logger.d("OchBusStationAdapter", "position: " + position + " currPos: " + currentStation + " station: " + stationList.get(position));
|
|
|
|
|
holder.tvStationName.setText(stationList.get(position).getSiteName());
|
|
|
|
|
if (position == currentStation) {
|
|
|
|
|
if(currentStation == 0){
|
|
|
|
|
if (currentStation == 0) {
|
|
|
|
|
// 在起始点
|
|
|
|
|
holder.tvStationName.setTextColor(context.getResources().getColor(R.color.module_mogo_och_bus_arrived_station_name_text_color));
|
|
|
|
|
holder.ivIcon.setImageResource(R.drawable.module_mogo_och_bus_icon_arrived_station);
|
|
|
|
|
holder.vDashBottom.setColor(context.getResources().getColor(R.color.module_mogo_och_bus_not_arrive_dash_color));
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
holder.tvStationName.setTextColor(context.getResources().getColor(R.color.module_mogo_och_bus_current_station_name_text_color));
|
|
|
|
|
holder.ivIcon.setImageResource(R.drawable.module_mogo_och_bus_icon_arriving_station);
|
|
|
|
|
holder.vDashTop.setGradient(context.getResources().getColor(R.color.module_mogo_och_bus_arriving_start_dash_color), context.getResources().getColor(R.color.module_mogo_och_bus_arriving_end_dash_color));
|
|
|
|
|
@@ -76,11 +74,11 @@ public class OchBusStationAdapter extends RecyclerView.Adapter<OchBusStationAdap
|
|
|
|
|
if (position == currentStation - 1) {
|
|
|
|
|
holder.vDashBottom.setGradient(context.getResources().getColor(R.color.module_mogo_och_bus_leaving_start_dash_color), context.getResources().getColor(R.color.module_mogo_och_bus_leaving_end_dash_color));
|
|
|
|
|
holder.vDashTop.setColor(context.getResources().getColor(R.color.module_mogo_och_bus_arrived_dash_color));
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
holder.vDashTop.setColor(context.getResources().getColor(R.color.module_mogo_och_bus_arrived_dash_color));
|
|
|
|
|
holder.vDashBottom.setColor(context.getResources().getColor(R.color.module_mogo_och_bus_arrived_dash_color));
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
} else {
|
|
|
|
|
holder.tvStationName.setTextColor(context.getResources().getColor(R.color.module_mogo_och_bus_not_arrive_station_name_text_color));
|
|
|
|
|
holder.ivIcon.setImageResource(R.drawable.module_mogo_och_bus_icon_not_arrive_station);
|
|
|
|
|
holder.vDashTop.setColor(context.getResources().getColor(R.color.module_mogo_och_bus_not_arrive_dash_color));
|
|
|
|
|
@@ -97,7 +95,7 @@ public class OchBusStationAdapter extends RecyclerView.Adapter<OchBusStationAdap
|
|
|
|
|
holder.tvStationNotice.setVisibility(View.VISIBLE);
|
|
|
|
|
holder.vDashTop.setVisibility(View.VISIBLE);
|
|
|
|
|
holder.vDashBottom.setVisibility(View.GONE);
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
holder.tvStationNotice.setVisibility(View.GONE);
|
|
|
|
|
holder.vDashTop.setVisibility(View.VISIBLE);
|
|
|
|
|
holder.vDashBottom.setVisibility(View.VISIBLE);
|
|
|
|
|
@@ -111,11 +109,12 @@ public class OchBusStationAdapter extends RecyclerView.Adapter<OchBusStationAdap
|
|
|
|
|
return stationList.size();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static class ViewHolder extends RecyclerView.ViewHolder{
|
|
|
|
|
static class ViewHolder extends RecyclerView.ViewHolder {
|
|
|
|
|
ImageView ivIcon;
|
|
|
|
|
TextView tvStationName;
|
|
|
|
|
TextView tvStationNotice;
|
|
|
|
|
VerticalDashLineView vDashBottom,vDashTop;
|
|
|
|
|
VerticalDashLineView vDashBottom, vDashTop;
|
|
|
|
|
|
|
|
|
|
public ViewHolder(@NonNull View itemView) {
|
|
|
|
|
super(itemView);
|
|
|
|
|
ivIcon = itemView.findViewById(R.id.module_mogo_och_bus_station_icon);
|
|
|
|
|
|