Exemple #1
0
 //Setup your layout here //  First RUN
 public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
 {
     try
     {
         View row = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.Last_Stories_view, parent, false);
         var  vh  = new StoriesViewHolder(row, OnClick);
         return(vh);
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         return(null);
     }
 }
Exemple #2
0
        public void Initialize(StoriesViewHolder holder, GetStoriesObject.Story item)
        {
            try
            {
                //profile_picture
                ImageCacheLoader.LoadImage(item.user_data.avatar, holder.ProfileImageViewAsync, false, true);



                string name = IMethods.Fun_String.DecodeString(item.user_data.name);
                holder.Txt_Username.Text = name;

                if (!string.IsNullOrEmpty(item.description))
                {
                    holder.Txt_description.Text = item.description;
                }
                else if (!string.IsNullOrEmpty(item.title))
                {
                    holder.Txt_description.Text = item.title;
                }
                else
                {
                    holder.Txt_description.Text = this.Activity_Context.GetText(Resource.String.Lbl_Empty);
                }

                if (item.Profile_indicator == null)
                {
                    item.Profile_indicator = AppSettings.Story_Default_Color;
                }

                holder.Profile_indicator.BorderColor = Color.ParseColor(item.Profile_indicator); // Default_Color
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }