Exemplo n.º 1
0
 void UpdatePadding()
 {
     _recyclerView.SetPadding((int)Element.ContentPaddingLeft,
                              (int)Element.ContentPaddingTop,
                              (int)Element.ContentPaddingRight,
                              (int)Element.ContentPaddingBottom);
     if (Element.IsHorizontal)
     {
         if (_paddingDecoration != null)
         {
             _recyclerView.RemoveItemDecoration(_paddingDecoration);
         }
         _paddingDecoration = new HorizontalSpacesItemDecoration(ConvertDpToPixels((float)Element.ColumnSpacing / 2), ConvertDpToPixels((int)Element.RowSpacing));
         _recyclerView.AddItemDecoration(_paddingDecoration);
     }
     else
     {
         UpdateGridLayout();
     }
 }
Exemplo n.º 2
0
 void UpdatePadding()
 {
     _recyclerView.SetPadding((int)Element.ContentPaddingLeft,
                              (int)Element.ContentPaddingTop,
                              (int)Element.ContentPaddingRight,
                              (int)Element.ContentPaddingBottom);
     if (Element.IsHorizontal)
     {
         if (_paddingDecoration != null)
         {
             _recyclerView.RemoveItemDecoration(_paddingDecoration);
         }
         var source        = Element.ItemsSource as ICollection;
         var numberOfItems = source == null ? 0 : source.Count;
         _paddingDecoration = new HorizontalSpacesItemDecoration(ConvertDpToPixels((float)Element.ColumnSpacing / 2), ConvertDpToPixels((int)Element.RowSpacing));
         _recyclerView.AddItemDecoration(_paddingDecoration);
     }
     else
     {
         UpdateGridLayout();
     }
 }