// Create new views (invoked by the layout manager) public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { try { //Setup your layout here >> Last_Calls_view View itemView = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.Last_Calls_view, parent, false); var holder = new Last_Calls_AdapterViewHolder(itemView, OnClick, OnLongClick, CallOnClick); return(holder); } catch (Exception e) { Console.WriteLine(e); return(null); } }
public void Initialize(Last_Calls_AdapterViewHolder holder, Classes.Call_User item) { try { ImageCacheLoader.LoadImage(item.avatar, holder.Image_Avatar, false, true); string name = IMethods.Fun_String.DecodeString(item.name); holder.Txt_Username.Text = name; if (item.typeIcon == "Accept") { IMethods.Set_TextViewIcon("2", holder.Txt_LastCall_icon, "\uf095"); holder.Txt_LastCall_icon.SetTextColor(Color.ParseColor(item.typeColor)); } else if (item.typeIcon == "Cancel") { IMethods.Set_TextViewIcon("2", holder.Txt_LastCall_icon, "\uf3dd"); holder.Txt_LastCall_icon.SetTextColor(Color.ParseColor(item.typeColor)); } else if (item.typeIcon == "Declined") { IMethods.Set_TextViewIcon("2", holder.Txt_LastCall_icon, "\uf05e"); holder.Txt_LastCall_icon.SetTextColor(Color.ParseColor(item.typeColor)); } if (item.time == "Declined call") { holder.Txt_LastTimecall.Text = this.Activity_Context.GetText(Resource.String.Lbl_Declined_call); } else if (item.time == "Missed call") { holder.Txt_LastTimecall.Text = this.Activity_Context.GetText(Resource.String.Lbl_Missed_call); } else if (item.time == "Answered call") { holder.Txt_LastTimecall.Text = this.Activity_Context.GetText(Resource.String.Lbl_Answered_call); } else { holder.Txt_LastTimecall.Text = item.time; } } catch (Exception e) { Console.WriteLine(e); } }