public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position) { if (holder is Loading) { ; } else { TrafiListview myHolder = holder as TrafiListview; myHolder.mEndStreet.Text = TrafiList[position].EndStreet; myHolder.mEndTime.Text = TrafiList[position].EndTime; myHolder.mStartTime.Text = TrafiList[position].StartTime; myHolder.mNextStopTime.Text = TrafiList[position].NextStopTime; myHolder.mNextStopDistance.Text = TrafiList[position].NextStopDistance; myHolder.mImageBottomDistance.Text = TrafiList[position].ImageBottomDistance; if (!TrafiList[position].Image.Contains("walksegment")) { Picasso.With(RVContext).Load(TrafiList[position].Image).Resize(50, 50).CenterCrop().Into(myHolder.mImage); } } }
public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { if (viewType == Resource.Layout.Loading) { View Loading = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.Loading, parent, false); Loading view = new Loading(Loading) { }; return(view); } else { View TrafiViewList = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.Trafi, parent, false); TextView EndStreet = TrafiViewList.FindViewById <TextView>(Resource.Id.EndStreet); TextView EndTime = TrafiViewList.FindViewById <TextView>(Resource.Id.EndTime); TextView StartTime = TrafiViewList.FindViewById <TextView>(Resource.Id.StartTime); TextView NextStopTime = TrafiViewList.FindViewById <TextView>(Resource.Id.NextStopTime); TextView NextStopDistance = TrafiViewList.FindViewById <TextView>(Resource.Id.NextStopDistance); TextView ImageBottomDistance = TrafiViewList.FindViewById <TextView>(Resource.Id.ImageBottomDistance); ImageView Image = TrafiViewList.FindViewById <ImageView>(Resource.Id.Image); TrafiListview view = new TrafiListview(TrafiViewList) { mEndStreet = EndStreet, mEndTime = EndTime, mStartTime = StartTime, mNextStopTime = NextStopTime, mNextStopDistance = NextStopDistance, mImageBottomDistance = ImageBottomDistance, mImage = Image }; return(view); } }