// Create new views (invoked by the layout manager) public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { try { //Setup your layout here >> Notifications_view var itemView = LayoutInflater.From(parent.Context) .Inflate(Resource.Layout.Style_Notifications_view, parent, false); var vh = new Notifications_AdapterViewHolder(itemView, OnClick, OnLongClick); return(vh); } catch (Exception exception) { Crashes.TrackError(exception); return(null); } }
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); } }
public static string AddIconFonts(Notifications_AdapterViewHolder holder, string Type, string icon) { try { var Type_icon = ""; if (Type == "following") { Type_icon = "person-add"; IMethods.Set_TextViewIcon("1", holder.Icon_Notfy, IonIcons_Fonts.PersonAdd); return(Type_icon); } if (Type == "comment" || Type == "comment_reply" || Type == "also_replied") { Type_icon = "chatboxes"; IMethods.Set_TextViewIcon("1", holder.Icon_Notfy, IonIcons_Fonts.IosChatboxes); return(Type_icon); } if (Type == "liked_post" || Type == "liked_comment" || Type == "liked_reply_comment" || Type == "liked_page") { Type_icon = "ThumbUp"; IMethods.Set_TextViewIcon("1", holder.Icon_Notfy, IonIcons_Fonts.Thumbsup); return(Type_icon); } if (Type == "wondered_post" || Type == "wondered_comment" || Type == "wondered_reply_comment" || Type == "exclamation-circle") { Type_icon = "Information"; IMethods.Set_TextViewIcon("1", holder.Icon_Notfy, IonIcons_Fonts.Information); return(Type_icon); } if (Type == "comment_mention" || Type == "comment_reply_mention") { Type_icon = "Tag"; IMethods.Set_TextViewIcon("1", holder.Icon_Notfy, IonIcons_Fonts.Pricetag); return(Type_icon); } if (Type == "post_mention") { Type_icon = "at"; IMethods.Set_TextViewIcon("1", holder.Icon_Notfy, IonIcons_Fonts.At); return(Type_icon); } if (Type == "share_post") { Type_icon = "Share"; IMethods.Set_TextViewIcon("1", holder.Icon_Notfy, IonIcons_Fonts.AndroidShareAlt); return(Type_icon); } if (Type == "profile_wall_post") { Type_icon = "image"; IMethods.Set_TextViewIcon("1", holder.Icon_Notfy, IonIcons_Fonts.Image); return(Type_icon); } if (Type == "visited_profile") { Type_icon = "Eye"; IMethods.Set_TextViewIcon("1", holder.Icon_Notfy, IonIcons_Fonts.Eye); return(Type_icon); } if (Type == "joined_group" || Type == "accepted_invite" || Type == "accepted_request" || Type == "accepted_join_request") { Type_icon = "Check"; IMethods.Set_TextViewIcon("1", holder.Icon_Notfy, IonIcons_Fonts.Checkmark); return(Type_icon); } if (Type == "invited_page") { Type_icon = "Flag"; IMethods.Set_TextViewIcon("1", holder.Icon_Notfy, IonIcons_Fonts.Flag); return(Type_icon); } if (Type == "added_you_to_group") { Type_icon = "Adjust"; IMethods.Set_TextViewIcon("1", holder.Icon_Notfy, IonIcons_Fonts.AndroidAdd); return(Type_icon); } if (Type == "requested_to_join_group") { Type_icon = "Clock"; IMethods.Set_TextViewIcon("1", holder.Icon_Notfy, IonIcons_Fonts.IosTimerOutline); return(Type_icon); } if (Type == "thumbs-down") { Type_icon = "ThumbDown"; IMethods.Set_TextViewIcon("1", holder.Icon_Notfy, IonIcons_Fonts.Thumbsdown); return(Type_icon); } if (Type == "going_event") { Type_icon = "Calendar"; IMethods.Set_TextViewIcon("1", holder.Icon_Notfy, IonIcons_Fonts.Calendar); return(Type_icon); } if (Type == "viewed_story") { Type_icon = "Calendar"; IMethods.Set_TextViewIcon("1", holder.Icon_Notfy, IonIcons_Fonts.Aperture); return(Type_icon); } if (Type == "reaction") { if (icon == "like") { Type_icon = "ThumbUp"; IMethods.Set_TextViewIcon("1", holder.Icon_Notfy, IonIcons_Fonts.Thumbsup); return(Type_icon); } else if (icon == "haha") { Type_icon = "Happy"; IMethods.Set_TextViewIcon("1", holder.Icon_Notfy, IonIcons_Fonts.Happy); return(Type_icon); } else if (icon == "love") { Type_icon = "Heart"; IMethods.Set_TextViewIcon("1", holder.Icon_Notfy, IonIcons_Fonts.Heart); return(Type_icon); } else if (icon == "wow") { Type_icon = "Information"; IMethods.Set_TextViewIcon("1", holder.Icon_Notfy, IonIcons_Fonts.Information); return(Type_icon); } else if (icon == "sad") { Type_icon = "SadOutline"; IMethods.Set_TextViewIcon("1", holder.Icon_Notfy, IonIcons_Fonts.SadOutline); return(Type_icon); } else if (icon == "angry") { Type_icon = "SadOutline"; IMethods.Set_TextViewIcon("1", holder.Icon_Notfy, IonIcons_Fonts.SocialFreebsdDevil); return(Type_icon); } else { Type_icon = "ArrowRightDropCircleOutline"; IMethods.Set_TextViewIcon("1", holder.Icon_Notfy, IonIcons_Fonts.AndroidNotifications); return(Type_icon); } } Type_icon = "ArrowRightDropCircleOutline"; IMethods.Set_TextViewIcon("1", holder.Icon_Notfy, IonIcons_Fonts.AndroidNotifications); return(Type_icon); } catch (Exception exception) { Crashes.TrackError(exception); IMethods.Set_TextViewIcon("1", holder.Icon_Notfy, IonIcons_Fonts.AndroidNotifications); return(""); } }