private void Initialize(RateUsersAdapterViewHolder 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); holder.UserRatingBar.Rating = (float)Convert.ToDouble(users.Points); //if (users.Verified == "1") // holder.Name.SetCompoundDrawablesWithIntrinsicBounds(0, 0, Resource.Drawable.icon_checkmark_small_vector, 0); //if (Type == TypeTextSecondary.None) //{ // holder.About.Visibility = ViewStates.Gone; //} //else //{ // 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); //} //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); //if (!ShowButton) return; //WoWonderTools.SetAddFriendCondition(users.IsFollowing, holder.Button); } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
// Create new views (invoked by the layout manager) public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { try { //Setup your layout here >> Style_HRateUser_view var itemView = LayoutInflater.From(parent.Context)?.Inflate(Resource.Layout.Style_HRateUser_view, parent, false); var vh = new RateUsersAdapterViewHolder(itemView, FollowButtonClick, Click, LongClick); return(vh); } catch (Exception exception) { Methods.DisplayReportResultTrack(exception); return(null !); } }