Ejemplo n.º 1
0
        // Replace the contents of a view (invoked by the layout manager)
        public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position)
        {
            try
            {
                switch (viewHolder)
                {
                case SuggestionsUserAdapterViewHolder holder:
                {
                    var item = UserList[position];
                    if (item != null)
                    {
                        holder.Username.Text = Methods.FunString.SubStringCutOf("@" + item.Username, 15);
                        holder.Name.Text     = Methods.FunString.SubStringCutOf(WoWonderTools.GetNameFinal(item), 15);

                        GlideImageLoader.LoadImage(ActivityContext, item.Avatar, holder.Image, ImageStyle.CenterCrop, ImagePlaceholders.Drawable);

                        WoWonderTools.SetAddFriendCondition(item.IsFollowing, holder.Button);
                    }

                    break;
                }
                }
            }
            catch (Exception exception)
            {
                Methods.DisplayReportResultTrack(exception);
            }
        }
Ejemplo n.º 2
0
        // Replace the contents of a view (invoked by the layout manager)
        public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position)
        {
            try
            {
                if (viewHolder is RecentDonationAdapterViewHolder holder)
                {
                    var item = UserList[position];
                    if (item != null)
                    {
                        GlideImageLoader.LoadImage(ActivityContext, item.UserData.Avatar, holder.Image, ImageStyle.CircleCrop, ImagePlaceholders.Drawable, true);

                        holder.Name.Text = Methods.FunString.SubStringCutOf(WoWonderTools.GetNameFinal(item.UserData), 20);

                        if (item.UserData.Verified == "1")
                        {
                            holder.Name.SetCompoundDrawablesWithIntrinsicBounds(0, 0, Resource.Drawable.icon_checkmark_small_vector, 0);
                        }

                        holder.About.Text = AppSettings.CurrencyFundingPriceStatic + item.Amount + " " + Methods.Time.TimeAgo(Convert.ToInt32(item.Time), true);

                        //Online Or offline
                        var online = WoWonderTools.GetStatusOnline(Convert.ToInt32(item.UserData.LastseenUnixTime), item.UserData.LastseenStatus);
                        holder.ImageLastSeen.SetImageResource(online ? Resource.Drawable.Green_Color : Resource.Drawable.Grey_Offline);

                        WoWonderTools.SetAddFriendCondition(item.UserData.IsFollowing, holder.Button);
                    }
                }
            }
            catch (Exception exception)
            {
                Methods.DisplayReportResultTrack(exception);
            }
        }
        public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolder, int position)
        {
            try
            {
                switch (viewHolder)
                {
                case NearByAdapterViewHolder holder:
                {
                    var users = UserList[position];
                    switch (users)
                    {
                    case null:
                        return;
                    }

                    GlideImageLoader.LoadImage(ActivityContext, users.Avatar, holder.Image, ImageStyle.CircleCrop, ImagePlaceholders.Color);

                    var online = WoWonderTools.GetStatusOnline(Convert.ToInt32(users.LastseenUnixTime), users.LastseenStatus);

                    switch (online)
                    {
                    //Online Or offline
                    case true:
                        //Online
                        holder.ImageOnline.SetImageResource(Resource.Drawable.Green_Color);
                        holder.LastTimeOnline.Text = ActivityContext.GetString(Resource.String.Lbl_Online);
                        break;

                    default:
                        holder.ImageOnline.SetImageResource(Resource.Drawable.Grey_Offline);
                        holder.LastTimeOnline.Text = Methods.Time.TimeAgo(Convert.ToInt32(users.LastseenUnixTime), false);
                        break;
                    }

                    holder.Name.Text = Methods.FunString.SubStringCutOf(WoWonderTools.GetNameFinal(users), 14);

                    switch (users.Verified)
                    {
                    case "1":
                        holder.Name.SetCompoundDrawablesWithIntrinsicBounds(0, 0, Resource.Drawable.icon_checkmark_small_vector, 0);
                        break;
                    }

                    WoWonderTools.SetAddFriendCondition(users.IsFollowing, holder.Button);
                    break;
                }
                }
            }
            catch (Exception exception)
            {
                Methods.DisplayReportResultTrack(exception);
            }
        }
Ejemplo n.º 4
0
        private void Initialize(ContactsAdapterViewHolder holder, UserDataObject users)
        {
            try
            {
                GlideImageLoader.LoadImage(ActivityContext, users.Avatar, holder.Image, ImageStyle.CircleCrop, ImagePlaceholders.Drawable, true);

                holder.Name.Text = Methods.FunString.SubStringCutOf(WoWonderTools.GetNameFinal(users), 20);

                switch (users.Verified)
                {
                case "1":
                    holder.Name.SetCompoundDrawablesWithIntrinsicBounds(0, 0, Resource.Drawable.icon_checkmark_small_vector, 0);
                    break;
                }

                switch (Type)
                {
                case TypeTextSecondary.None:
                    holder.About.Visibility = ViewStates.Gone;
                    break;

                default:
                    holder.About.Text = Type == TypeTextSecondary.About ? Methods.FunString.SubStringCutOf(WoWonderTools.GetAboutFinal(users), 25) : ActivityContext.GetString(Resource.String.Lbl_Last_seen) + " " + Methods.Time.TimeAgo(Convert.ToInt32(users.LastseenUnixTime), true);
                    break;
                }

                //Online Or offline
                var online = WoWonderTools.GetStatusOnline(Convert.ToInt32(users.LastseenUnixTime), users.LastseenStatus);
                holder.ImageLastSeen.SetImageResource(online ? Resource.Drawable.Green_Color : Resource.Drawable.Grey_Offline);

                switch (ShowButton)
                {
                case false:
                    return;

                default:
                    WoWonderTools.SetAddFriendCondition(users.IsFollowing, holder.Button);
                    break;
                }
            }
            catch (Exception e)
            {
                Methods.DisplayReportResultTrack(e);
            }
        }