/// <summary> /// //Set Color Alert Box And Time And Day Textview /// </summary> /// <param name="viewHolder"></param> /// <param name="position"></param> public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position) { AlertModel alertModel = alertList[position]; var viewholder = holder as AdapterAlertsViewHolder; viewholder.mTextViewTime.Text = AdapterAlertsViewHolder.GetTimeAndDay(alertModel.StartDate); viewholder.tvAlertTitle.Text = alertModel.AlertTitle; AdapterAlertsViewHolder.SetAlertIconAndColor(Convert.ToString(alertModel.AlertType), viewholder.alertIcon, viewholder.mLinearLayoutRandomColor, viewholder.mTextViewTime); }
/// <summary> /// /fill Alert Card layout /// </summary> /// <param name="parent"></param> /// <param name="viewType"></param> /// <returns></returns> public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { View itemView = null; var id = Resource.Layout.row_alerts; itemView = LayoutInflater.From(parent.Context).Inflate(id, parent, false); var vh = new AdapterAlertsViewHolder(itemView); return(vh); }