Example #1
0
 public VerticalRecyclingSystem(RectTransform prototypeCell, RectTransform viewport, RectTransform content, IRecyclableScrollRectDataSource dataSource, bool isGrid, int coloumns)
 {
     PrototypeCell         = prototypeCell;
     Viewport              = viewport;
     Content               = content;
     _dataSource           = dataSource;
     IsGrid                = isGrid;
     _coloumns             = isGrid ? coloumns : 1;
     _recyclableViewBounds = new Bounds();
 }
Example #2
0
 public HorizontalRecyclingSystem(RectTransform prototypeCell, RectTransform viewport, RectTransform content, IRecyclableScrollRectDataSource dataSource, bool isGrid, int rows)
 {
     PrototypeCell         = prototypeCell;
     Viewport              = viewport;
     Content               = content;
     DataSource            = dataSource;
     IsGrid                = isGrid;
     _rows                 = isGrid ? rows : 1;
     _recyclableViewBounds = new Bounds();
 }
 /// <summary>
 /// Overloaded ReloadData with dataSource param
 ///Reloads the data. Call this if a new datasource is assigned.
 /// </summary>
 public void ReloadData(IRecyclableScrollRectDataSource dataSource)
 {
     if (_recyclingSystem != null)
     {
         StopMovement();
         onValueChanged.RemoveListener(OnValueChangedListener);
         _recyclingSystem.DataSource = dataSource;
         StartCoroutine(_recyclingSystem.InitCoroutine(() =>
                                                       onValueChanged.AddListener(OnValueChangedListener)
                                                       ));
         _prevAnchoredPos = content.anchoredPosition;
     }
 }
 /// <summary>
 /// Use this to init the list from the controller class when self-init is false
 /// </summary>
 /// <param name="dataSource"></param>
 public void Initialize(IRecyclableScrollRectDataSource dataSource)
 {
     DataSource = dataSource;
     StartCoroutine(InitCoroutine());
 }
 /// <summary>
 /// public API for Initializing when datasource is not set in controller's Awake. Make sure selfInitalize is set to false.
 /// </summary>
 public void Initialize(IRecyclableScrollRectDataSource dataSource)
 {
     DataSource = dataSource;
     Initialize();
 }