private void OnGUI() { m_setCount = GUILayout.TextField(m_setCount); int setCount = 0; int.TryParse(m_setCount, out setCount); if (GUILayout.Button("項目数設定")) { m_view.SetListItemCount(setCount, false); } m_addCount = GUILayout.TextField(m_addCount); int addCount = 0; int.TryParse(m_addCount, out addCount); if (GUILayout.Button("項目数追加")) { int count = m_view.ItemTotalCount + addCount; m_view.SetListItemCount(count, false); } m_jumpToIndex = GUILayout.TextField(m_jumpToIndex); int jumpToIndex = 0; int.TryParse(m_jumpToIndex, out jumpToIndex); if (GUILayout.Button("特定の項目にジャンプ")) { m_view.MovePanelToItemIndex(jumpToIndex, 0); } if (GUILayout.Button("位置リセット")) { m_view.MovePanelToItemIndex(0, 0); } }
private void OnCloseData() { UserModel.SelectionIndex = -1; mLoopListView.SetListItemCount(0, false); CloseUIForms(EnumUIFormType.SelectMsgUIForm); CloseUIForms(EnumUIFormType.LatestMsgUIForm); }
public void RefreshAllShowItem(int itemCount, bool resetPos = false) { listView.SetListItemCount(itemCount, resetPos); if (itemCount == listView.ItemTotalCount) { listView.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(); } }
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> 设置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(); }
void OnAddItemBtnClicked() { if (mLoopListView.ItemTotalCount < 0) { return; } int count = 0; if (int.TryParse(mAddItemInput.text, out count) == false) { return; } count = mLoopListView.ItemTotalCount + count; if (count < 0 || count > DataSourceMgr.Get.TotalItemCount) { return; } mLoopListView.SetListItemCount(count, false); }
void OnDeleteBtnClicked() { bool isChanged = DataSourceMgr.Get.DeleteAllCheckedItem(); if (isChanged == false) { return; } mLoopListView.SetListItemCount(DataSourceMgr.Get.TotalItemCount, false); 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(); }
protected void Awake() { dataNum = 100; LoopList.InitListView(100, OnGetItem1); SetBtn.onClick.AddListener(() => { if (int.TryParse(InputField.text, out var num)) { dataNum = num; LoopList.SetListItemCount(num, false); } }); ScollTo.onClick.AddListener(() => { if (int.TryParse(InputField.text, out var index)) { LoopList.MovePanelToItemIndex(index, 0); } }); }
public void OnExpandClicked(int index) { mTreeItemCountMgr.ToggleItemExpand(index); mLoopListView.SetListItemCount(mTreeItemCountMgr.GetTotalItemAndChildCount(), false); mLoopListView.RefreshAllShownItem(); }
public void GetAllPendingFriends() { dialog.SetActive(false); if (gameObject.name != "Friend Requests") { return; } HTTPRequest www = new HTTPRequest(new Uri(GameManager.Instance.webURLPrefix + "pendingFriend?myId=" + GameManager.Instance.player._id), (request, response) => { HTTPResponse res = (HTTPResponse)response; if (res.IsSuccess) { Debug.Log(res.DataAsText); mItemDataList.Clear(); pList.Clear(); List <object> dic = Json.Decode(res.DataAsText) as List <object>; pList = new List <PendingFriendData>(); foreach (Dictionary <string, object> a in dic) { UserData s = new UserData(); PendingFriendData p = new PendingFriendData(); Debug.Log(a["_id"].ToString()); if (a.ContainsKey("_id")) { p._id = a["_id"].ToString(); } if (a.ContainsKey("user")) { p.user = new User(); if (a.ContainsKey("_id")) { s.requestId = a["_id"].ToString(); } foreach (KeyValuePair <string, object> t in a["user"] as Dictionary <string, object> ) { if (t.Key.Contains("_id")) { p.user._id = t.Value.ToString(); } if (t.Key.Contains("displayName")) { p.user.displayName = t.Value.ToString(); } if (t.Key.Contains("username")) { p.user.username = t.Value.ToString(); } if (t.Key.Contains("profileImageURL")) { p.user.profileImageURL = t.Value.ToString(); } } Debug.Log("Simple User"); } if (a.ContainsKey("touser")) { p.touser = new Touser(); foreach (KeyValuePair <string, object> t in a["touser"] as Dictionary <string, object> ) { if (t.Key.Contains("_id")) { p.touser._id = t.Value.ToString(); } if (t.Key.Contains("displayName")) { p.touser.displayName = t.Value.ToString(); } if (t.Key.Contains("username")) { p.touser.username = t.Value.ToString(); } if (t.Key.Contains("profileImageURL")) { p.touser.profileImageURL = t.Value.ToString(); } if (t.Key.Contains("_id")) { s._id = t.Value.ToString(); } if (t.Key.Contains("displayName")) { s.displayName = t.Value.ToString(); } if (t.Key.Contains("username")) { s.username = t.Value.ToString(); } if (t.Key.Contains("profileImageURL")) { s.profileImageURL = t.Value.ToString(); } } Debug.Log("To User"); } if (a.ContainsKey("status")) { p.status = a["status"].ToString(); if (a["status"].ToString() == "pending") { s.status = "pending"; mItemDataList.Add(s); } } /*UserData s = new UserData(); * if(a.ContainsKey("_id")) * s._id = a["_id"].ToString(); * if(a.ContainsKey("displayName")) * s.displayName = a["displayName"].ToString(); * if(a.ContainsKey("username")) * s.username = a["username"].ToString(); * if(a.ContainsKey("profileImageURL")) * s.profileImageURL = a["profileImageURL"].ToString(); * mItemDataList.Add(s);*/ s.pd = p; pList.Add(p); } mTotalDataCount = mItemDataList.Count; mIsWaittingRefreshData = true; mDataLoadLeftTime = 1; mLoopListView.SetListItemCount(mTotalDataCount); //Debug.Log(mItemDataList.Count); //mLoopListView.RefreshAllShownItem(); } }); if (GameManager.Instance.header == null) { return; } for (int i = 0; i < GameManager.Instance.header.Count; ++i) { foreach (KeyValuePair <string, List <string> > item in GameManager.Instance.header) { //Debug.Log(string.Format("{0}: {1}", item.Key, item.Value[0])); foreach (string val in item.Value) { //Debug.Log(val); } www.AddField(item.Key, item.Value[0]); } } www.Send(); }
void OnAddItemBtnClicked(int count) { mLoopListView.SetListItemCount(count, false); }
void OnAppendMsgBtnClicked() { ChatMsgDataSourceMgr.Get.AppendOneMsg(); mLoopListView.SetListItemCount(ChatMsgDataSourceMgr.Get.TotalItemCount, false); mLoopListView.MovePanelToItemIndex(ChatMsgDataSourceMgr.Get.TotalItemCount - 1, 0); }
void OnViewPortSizeChanged() { UpdateItemPrefab(); mLoopListView.SetListItemCount(GetMaxRowCount() + 2, false); mLoopListView.RefreshAllShownItem(); }
void OnAppendItemBtnClicked() { AppendOneData(); mLoopListView.SetListItemCount(mDataList.Count, false); mLoopListView.RefreshAllShownItem(); }