Example #1
0
 private void ToggleCheckedBackground(TextViewHolder holder, int position)
 {
     try
     {
         if (SelectedItems.Get(position, false))
         {
             holder.MainView.SetBackgroundColor(Color.LightBlue);
             if (CurrentSelectedIdx == position)
             {
                 ResetCurrentItems();
             }
         }
         else
         {
             holder.MainView.SetBackgroundColor(Color.Transparent);
             if (CurrentSelectedIdx == position)
             {
                 ResetCurrentItems();
             }
         }
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }
Example #2
0
 public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
 {
     try
     {
         //Setup your layout here >>
         var itemView = MessageList[viewType];
         if (itemView != null)
         {
             if (itemView.Position == "Right" || itemView.Position == "right")
             {
                 View           row            = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.Right_MS_view, parent, false);
                 TextViewHolder textViewHolder = new TextViewHolder(row, OnClick, OnLongClick, ActivityContext);
                 return(textViewHolder);
             }
             else
             {
                 View           row            = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.Left_MS_view, parent, false);
                 TextViewHolder textViewHolder = new TextViewHolder(row, OnClick, OnLongClick, ActivityContext);
                 return(textViewHolder);
             }
         }
         else
         {
             return(null);
         }
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception);
         return(null);
     }
 }
Example #3
0
 public void Initialize(TextViewHolder holder, GetUserMessagesObject.Message item)
 {
     try
     {
         if (holder.Time.Text != item.Time)
         {
             var time = Methods.Time.UnixTimeStampToDateTime(Convert.ToInt32(item.Time));
             holder.Time.Text = time.ToShortTimeString();
             holder.TextSanitizerAutoLink.Load(item.Text, item.Position);
         }
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
     }
 }