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(); } }
/// <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(); } }
void Update() { // 改变数据 if (Input.GetKeyDown(KeyCode.A)) { simulateDate = "Hello"; listview.RefreshAllShownItem(); } if (Input.GetKeyDown(KeyCode.B)) { simulateDate = "你好"; listview.RefreshAllShownItem(); } }
/// <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(); }
/// <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(); }
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); }
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(); } }
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(); }
public void OnExpandClicked(int index) { mTreeItemCountMgr.ToggleItemExpand(index); mLoopListView.SetListItemCount(mTreeItemCountMgr.GetTotalItemAndChildCount(), false); mLoopListView.RefreshAllShownItem(); }
void OnSelectAllBtnClicked() { DataSourceMgr.Get.CheckAllItem(); mLoopListView.RefreshAllShownItem(); }
void OnViewPortSizeChanged() { UpdateItemPrefab(); mLoopListView.SetListItemCount(GetMaxRowCount() + 2, false); mLoopListView.RefreshAllShownItem(); }
void OnAppendItemBtnClicked() { AppendOneData(); mLoopListView.SetListItemCount(mDataList.Count, false); mLoopListView.RefreshAllShownItem(); }