public void Insert(Get_General_Data_Object.Notification users) { try { mNotificationsList.Insert(0, users); NotifyItemInserted(mNotificationsList.IndexOf(mNotificationsList.First())); NotifyItemRangeInserted(0, mNotificationsList.Count); } catch (Exception e) { Crashes.TrackError(e); } }
// Function Users public void Add(Get_General_Data_Object.Notification notfy) { try { var check = mNotificationsList.FirstOrDefault(a => a.notifier_id == notfy.notifier_id); if (check == null) { mNotificationsList.Add(notfy); NotifyItemInserted(mNotificationsList.IndexOf(mNotificationsList.Last())); } } catch (Exception exception) { Crashes.TrackError(exception); } }
public void Initialize(Notifications_AdapterViewHolder holder, Get_General_Data_Object.Notification notfy) { try { var AvatarSplit = notfy.notifier.avatar.Split('/').Last(); var getImage_Avatar = IMethods.MultiMedia.GetMediaFrom_Disk(IMethods.IPath.FolderDiskImage, AvatarSplit); if (getImage_Avatar != "File Dont Exists") { if (holder.Image_User.Tag?.ToString() != "loaded") { ImageServiceLoader.Load_Image(holder.Image_User, "no_profile_image.png", getImage_Avatar, 1); holder.Image_User.Tag = "loaded"; } } else { if (holder.Image_User.Tag?.ToString() != "loaded") { IMethods.MultiMedia.DownloadMediaTo_DiskAsync(IMethods.IPath.FolderDiskImage, notfy.notifier.avatar); ImageServiceLoader.Load_Image(holder.Image_User, "no_profile_image.png", notfy.notifier.avatar, 1); holder.Image_User.Tag = "loaded"; } } AddIconFonts(holder, notfy.type, notfy.icon); var drawable = TextDrawable.TextDrawable.TextDrawbleBuilder.BeginConfig().FontSize(30).EndConfig() .BuildRound("", Color.ParseColor(GetColorFonts(notfy.type, notfy.icon))); holder.Image.SetImageDrawable(drawable); string name = IMethods.Fun_String.DecodeString(IMethods.Fun_String.DecodeStringWithEnter(notfy.notifier.name)); holder.UserName_Notfy.Text = name; holder.Text_Notfy.Text = notfy.type_text; } catch (Exception e) { Crashes.TrackError(e); } }