use of flying.grub.tamtime.data.persistence.LineStop in project TamTime by flyingrub.
the class HomeAdapter method onBindViewHolder.
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holderParam, int position) {
if (holderParam instanceof ViewHolderCustom) {
return;
}
ViewHolder holder = (ViewHolder) holderParam;
LineStop lineStop = favoriteStopLine.get(position - 1);
StopZone s = lineStop.getStopZone();
Line l = lineStop.getLine();
holder.title.setText(s.getName() + " - Ligne " + l.getLineNum());
holder.recyclerView.setHasFixedSize(true);
RecyclerView.LayoutManager layoutManager = new org.solovyev.android.views.llm.LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false);
holder.recyclerView.setLayoutManager(layoutManager);
holder.recyclerView.setItemAnimator(new DefaultItemAnimator());
AllDirectionStopLine adapter = new AllDirectionStopLine(s.getStops(l), context);
final StopZone finalS = s;
adapter.SetOnItemClickListener(new AllDirectionStopLine.OnItemClickListener() {
@Override
public void onItemClick(View view, int position) {
Intent intent = new Intent(context, OneStopActivity.class);
Bundle bundle = new Bundle();
bundle.putInt("stop_zone_id", finalS.getID());
intent.putExtras(bundle);
context.startActivity(intent);
context.overridePendingTransition(R.anim.slide_from_right, R.anim.fade_scale_out);
}
});
holder.recyclerView.setAdapter(adapter);
}
Aggregations