public void RefreshAllContacts()
 {
     if (StartHasBeenCalled)
     {
         InfiniteScrollScript.InitData(ContactController.Instance.AllContactsFiltered.Count);
     }
 }
Beispiel #2
0
    void Start()
    {
        Scroll.OnFill   += OnFillItem;
        Scroll.OnHeight += OnHeightItem;

        Scroll.InitData(Count);
    }
Beispiel #3
0
    public void Init()
    {
        Scroll.OnFill   += OnFillItem;
        Scroll.OnHeight += OnHeightItem;

        Count = Mathf.CeilToInt(limitLevel / 4.0f);
        Scroll.InitData(Count);
    }
Beispiel #4
0
    // Use this for initialization
    void Start()
    {
        Debug.Log("预留预设体空间=======" + count);
        scroll.FillItem += scroll_FillItem;

        scroll.PullLoad += scroll_PullLoad;
        //初始化无限滚动  100
        scroll.InitData(count);
    }
Beispiel #5
0
    IEnumerator _LoadFromDataSource()
    {
        // Waiting data load complete
        yield return(PlacementDataSource.WaitingDataReady());

        // Load data to list
        this.currentData = PlacementDataSource.GetPlacesCollection();
        Scroll.InitData(currentData.Places.Length);
    }
Beispiel #6
0
 void Start()
 {
     Scroll.OnFill   += OnFillItem;
     Scroll.OnHeight += OnHeightItem;
     Scroll.OnPull   += OnPullItem;
     for (int i = 0; i < Count; i++)
     {
         _list.Add(i);
     }
     Scroll.InitData(_list.Count);
 }
 void Start()
 {
     Scroll.OnFill   += OnFillItem;
     Scroll.OnHeight += OnHeightItem;
     Scroll.OnPull   += OnPullItem;
     for (int i = 0; i < Count; i++)
     {
         _list.Add(i);
         _heights.Add(Random.Range(100, 200));
     }
     Scroll.InitData(_list.Count);
 }
Beispiel #8
0
    private void Start()
    {
        Global.CheckNullValues(gameObject, MenuContacts);
        ContactController.Instance.FilterContacts(string.Empty, true);

        InfiniteScroll scroll = GetComponent <InfiniteScroll>();

        scroll.OnFill   += OnFillItem;
        scroll.OnHeight += OnHeightItem;

        scroll.InitData(ContactController.Instance.AllContactsFiltered.Count);
    }
Beispiel #9
0
    void Start()
    {
        scroll.FillItem += (int index, GameObject item) => {
            //这里我们可以填写和修改item prefab
            //改变文字,图像等
            //通过索引,我们可以从JSON数组获取数据,例如
            item.transform.GetChild(0).GetComponent <Text> ().text = "item #" + index;
        };

        scroll.PullLoad += (InfiniteScroll.Direction obj) => {
            //这里我们监听拖拽刷新事件并处理它
            //它可以将数据从服务器加载到JSON对象并附加到列表
            //做到这一点,调用ApplyDataTo函数,其中arg1 =通用项追加后计数,arg2 = count追加,arg3 =追加方向(顶部或底部)
            count += 20;
            scroll.ApplyDataTo(count, 20, obj);
        };

        //函数初始化无限滚动
        scroll.InitData(count);
    }
Beispiel #10
0
    void Start()
    {
        scroll.FillItem += (int index, GameObject item) => {
            // here we can fill and modify item prefab
            // change text, image, ect
            // by index we can get data from JSON array, i.g.
            item.transform.GetChild(0).GetComponent <Text> ().text = "item #" + index;
        };

        scroll.PullLoad += (InfiniteScroll.Direction obj) => {
            // here we listen pull-to-refresh event and process it
            // it could be loading data from server to JSON object and append to list
            // to do it, call ApplyDataTo function, where arg1 = common items count after appending, arg2 = count to append, arg3 = direction to append (top or bottom)
            count += 20;
            scroll.ApplyDataTo(count, 20, obj);
        };

        // function to initialize infinite scroll
        scroll.InitData(count);
    }
 private void OnValueChanged()
 {
     ContactController.Instance.FilterContacts(InputField.text);
     InfiniteScrollScript.InitData(ContactController.Instance.AllContactsFiltered.Count);
 }