Пример #1
0
 // 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 LastCallsAdapterViewHolder(itemView, OnClick, OnLongClick, CallOnClick);
         return(holder);
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         return(null);
     }
 }
Пример #2
0
        private void Initialize(LastCallsAdapterViewHolder holder, Classes.CallUser item)
        {
            try
            {
                GlideImageLoader.LoadImage(ActivityContext, item.Avatar, holder.ImageAvatar, ImageStyle.CircleCrop, ImagePlaceholders.Drawable);

                string name = Methods.FunString.DecodeString(item.Name);
                holder.TxtUsername.Text = name;

                if (item.TypeIcon == "Accept")
                {
                    Glide.With(ActivityContext).Load(Resource.Drawable.social_ic_phone_calls).Into(holder.IconCall);
                }
                else if (item.TypeIcon == "Cancel")
                {
                    Glide.With(ActivityContext).Load(Resource.Drawable.social_ic_phone_call_arrow).Into(holder.IconCall);
                }
                else if (item.TypeIcon == "Declined")
                {
                    Glide.With(ActivityContext).Load(Resource.Drawable.social_ic_forward_call).Into(holder.IconCall);
                }

                if (item.Time == "Declined call")
                {
                    holder.TxtLastTimecall.Text = ActivityContext.GetText(Resource.String.Lbl_Declined_call);
                }
                else if (item.Time == "Missed call")
                {
                    holder.TxtLastTimecall.Text = ActivityContext.GetText(Resource.String.Lbl_Missed_call);
                }
                else if (item.Time == "Answered call")
                {
                    holder.TxtLastTimecall.Text = ActivityContext.GetText(Resource.String.Lbl_Answered_call);
                }
                else
                {
                    holder.TxtLastTimecall.Text = item.Time;
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }