Exemplo n.º 1
0
        private void OnGUI()
        {
            if (GUILayout.Button("すべて選択"))
            {
                foreach (var n in m_list)
                {
                    n.IsChecked = true;
                }
                m_view.RefreshAllShownItem();
            }
            if (GUILayout.Button("選択解除"))
            {
                foreach (var n in m_list)
                {
                    n.IsChecked = false;
                }
                m_view.RefreshAllShownItem();
            }
            if (GUILayout.Button("削除"))
            {
                if (!m_list.Any(c => c.IsChecked))
                {
                    return;
                }

                m_list = m_list
                         .Where(c => !c.IsChecked)
                         .ToArray()
                ;

                m_view.SetListItemCount(m_list.Length, false);
                m_view.RefreshAllShownItem();
            }
        }
Exemplo n.º 2
0
 /// <summary>         下面菊花 数据完成ing         </summary>
 void OnDataSourceLoadMoreFinished()
 {
     if (mLoopListView.ShownItemCount == 0)
     {
         return;
     }
     if (mLoadingTipStatus == LoadingTipStatus.WaitLoad)
     {
         mLoadingTipStatus = LoadingTipStatus.None;
         mLoopListView.SetListItemCount(DataSourceMgr.Get.TotalItemCount + 1, false);
         mLoopListView.RefreshAllShownItem();
     }
 }
Exemplo n.º 3
0
 void Update()
 {
     // 改变数据
     if (Input.GetKeyDown(KeyCode.A))
     {
         simulateDate = "Hello";
         listview.RefreshAllShownItem();
     }
     if (Input.GetKeyDown(KeyCode.B))
     {
         simulateDate = "你好";
         listview.RefreshAllShownItem();
     }
 }
Exemplo n.º 4
0
 /// <summary> 重新设置每个子树的个数(列表更改后调用) </summary>
 /// <param name="TreeViewChildItemCountList"></param>
 public void SetChildTreeItemCount(List <int> TreeViewChildItemCountList)
 {
     TreeData = new TreeViewData();
     TreeData.mTreeViewItemCount          = TotalCount;
     TreeData.mTreeViewChildItemCountList = TreeViewChildItemCountList;
     TreeData.Init();
     TreeItemCountMgr.Clear();
     for (int i = 0; i < TreeData.mTreeViewItemCount; i++)
     {
         int childCount = TreeData.GetItemDataByIndex(i).ChildCount;
         //int childCount = TreeViewChildItemCountList[i];
         TreeItemCountMgr.AddTreeItem(childCount, true);
     }
     LoopListView.RefreshAllShownItem();
 }
Exemplo n.º 5
0
 /// <summary> 设置List列表个数(列表更改后需要重新设置) </summary>
 /// <param name="count"></param>
 public void SetListItemTotalCount(int count)
 {
     DataManger.TotalDataCount = count;
     DataManger.SetDataTotalCount(DataManger.TotalDataCount);
     LoopListView.SetListItemCount(DataManger.TotalDataCount, false);
     LoopListView.RefreshAllShownItem();
 }
Exemplo n.º 6
0
    private LoopListViewItem2 OnGetMinItemByIndex(LoopListView2 listView, int index)
    {
        LoopListViewItem2 item       = listView.NewListViewItem(ItemNameList[0]);
        LevelLimitItem    itemScript = item.GetComponent <LevelLimitItem>();

        if (item.IsInitHandlerCalled == false)
        {
            item.IsInitHandlerCalled = true;
            itemScript.Init();
        }
        int firstItemVal = 1;
        int itemCount    = MaxLevel;
        int val          = 0;

        if (index >= 0)
        {
            val = index % itemCount;
        }
        else
        {
            val = itemCount + ((index + 1) % itemCount) - 1;
        }
        val = val + firstItemVal;
        itemScript.Level = val;
        itemScript.SetData(val.ToString());
        LoopListViewMax.RefreshAllShownItem();
        return(item);
    }
Exemplo n.º 7
0
 public void RefreshAllShowItem(int itemCount, bool resetPos = false)
 {
     listView.SetListItemCount(itemCount, resetPos);
     if (itemCount == listView.ItemTotalCount)
     {
         listView.RefreshAllShownItem();
     }
 }
 void OnDataSourceRefreshFinished()
 {
     if (mLoopListView.ShownItemCount == 0)
     {
         return;
     }
     if (mLoadingTipStatus1 == LoadingTipStatus.WaitLoad)
     {
         mLoadingTipStatus1         = LoadingTipStatus.Loaded;
         mDataLoadedTipShowLeftTime = 0.7f;
         LoopListViewItem2 item = mLoopListView.GetShownItemByItemIndex(0);
         if (item == null)
         {
             return;
         }
         UpdateLoadingTip1(item);
         mLoopListView.RefreshAllShownItem();
     }
 }
Exemplo n.º 9
0
        void OnFilterButtonClicked()
        {
            string newFilter = mFilterInput.text;

            if (newFilter == mFilerStr)
            {
                return;
            }
            mFilerStr = newFilter;
            UpdateFilteredDataList();
            mLoopListView.SetListItemCount(mFilteredDataList.Count, false);
            mLoopListView.RefreshAllShownItem();
        }
        void SetListItemTotalCount(int count)
        {
            mListItemTotalCount = count;
            if (mListItemTotalCount < 0)
            {
                mListItemTotalCount = 0;
            }
            if (mListItemTotalCount > DataSourceMgr.Get.TotalItemCount)
            {
                mListItemTotalCount = DataSourceMgr.Get.TotalItemCount;
            }
            int count1 = mListItemTotalCount / mItemCountPerRow;

            if (mListItemTotalCount % mItemCountPerRow > 0)
            {
                count1++;
            }
            mLoopListView.SetListItemCount(count1, false);
            mLoopListView.RefreshAllShownItem();
        }
Exemplo n.º 11
0
 public void OnExpandClicked(int index)
 {
     mTreeItemCountMgr.ToggleItemExpand(index);
     mLoopListView.SetListItemCount(mTreeItemCountMgr.GetTotalItemAndChildCount(), false);
     mLoopListView.RefreshAllShownItem();
 }
Exemplo n.º 12
0
 void OnSelectAllBtnClicked()
 {
     DataSourceMgr.Get.CheckAllItem();
     mLoopListView.RefreshAllShownItem();
 }
Exemplo n.º 13
0
 void OnViewPortSizeChanged()
 {
     UpdateItemPrefab();
     mLoopListView.SetListItemCount(GetMaxRowCount() + 2, false);
     mLoopListView.RefreshAllShownItem();
 }
Exemplo n.º 14
0
 void OnAppendItemBtnClicked()
 {
     AppendOneData();
     mLoopListView.SetListItemCount(mDataList.Count, false);
     mLoopListView.RefreshAllShownItem();
 }