Ejemplo n.º 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)
     {
         Methods.DisplayReportResultTrack(e);
         return(null);
     }
 }
Ejemplo n.º 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;

                switch (item.TypeIcon)
                {
                case "Accept":
                    Glide.With(ActivityContext).Load(Resource.Drawable.social_ic_phone_calls).Into(holder.IconCall);
                    break;

                case "Cancel":
                    Glide.With(ActivityContext).Load(Resource.Drawable.social_ic_phone_call_arrow).Into(holder.IconCall);
                    break;

                case "Declined":
                    Glide.With(ActivityContext).Load(Resource.Drawable.social_ic_forward_call).Into(holder.IconCall);
                    break;
                }

                switch (item.Time)
                {
                case "Declined call":
                    holder.TxtLastTimecall.Text = ActivityContext.GetText(Resource.String.Lbl_NotAnswered_call);
                    break;

                case "Missed call":
                    holder.TxtLastTimecall.Text = ActivityContext.GetText(Resource.String.Lbl_Missed_call);
                    break;

                case "Answered call":
                    holder.TxtLastTimecall.Text = ActivityContext.GetText(Resource.String.Lbl_Answered_call);
                    break;

                default:
                    holder.TxtLastTimecall.Text = item.Time;
                    break;
                }
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }