LoopListViewItem2 OnGetItemByIndexForHour(LoopListView2 listView, int index) { LoopListViewItem2 item = listView.NewListViewItem("ItemPrefab1"); ListItem7 itemScript = item.GetComponent <ListItem7>(); if (item.IsInitHandlerCalled == false) { item.IsInitHandlerCalled = true; itemScript.Init(); } int firstItemVal = 1; int itemCount = 24; int val = 0; if (index >= 0) { val = index % itemCount; } else { val = itemCount + ((index + 1) % itemCount) - 1; } val = val + firstItemVal; itemScript.Refresh(index, val); return(item); }
LoopListViewItem2 OnGetItemByIndexForMonth(LoopListView2 listView, int index) { LoopListViewItem2 item = listView.NewListViewItem("ItemPrefab1"); ListItem7 itemScript = item.GetComponent <ListItem7>(); if (item.IsInitHandlerCalled == false) { item.IsInitHandlerCalled = true; itemScript.Init(); } int firstItemVal = 1; int itemCount = 12; int val = 0; if (index >= 0) { val = index % itemCount; } else { val = itemCount + ((index + 1) % itemCount) - 1; } val = val + firstItemVal; itemScript.Value = val; itemScript.mText.text = mMonthNameArray[val - 1]; return(item); }
void OnMonthSnapTargetFinished(LoopListView2 listView, LoopListViewItem2 item) { LoopListViewItem2 item0 = mLoopListViewDay.GetShownItemByIndex(0); ListItem7 itemScript = item0.GetComponent <ListItem7>(); int index = itemScript.Value - 1; mLoopListViewDay.RefreshAllShownItemWithFirstIndex(index); }
void OnListViewSnapTargetChanged(LoopListView2 listView, int targetIndex) { for (int i = 0; i < listView.ShownItemCount; ++i) { LoopListViewItem2 item2 = listView.GetShownItemByIndex(i); ListItem7 itemScript = item2.GetComponent <ListItem7>(); itemScript.OnListViewSnapTargetChanged(i == targetIndex); } }
void LateUpdate() { mLoopListViewHour.UpdateAllShownItemSnapData(); for (int i = 0; i < mLoopListViewHour.ShownItemCount; ++i) { LoopListViewItem2 item = mLoopListViewHour.GetShownItemByIndex(i); ListItem7 itemScript = item.GetComponent <ListItem7>(); float scale = 1 - Mathf.Abs(item.DistanceWithViewPortSnapCenter) / 700f; scale = Mathf.Clamp(scale, 0.4f, 1); itemScript.SetScale(scale); } }
void OnHourSnapTargetChanged(LoopListView2 listView, LoopListViewItem2 item) { int index = listView.GetIndexInShownItemList(item); if (index < 0) { return; } ListItem7 itemScript = item.GetComponent <ListItem7>(); mCurSelectedHour = itemScript.Value; OnListViewSnapTargetChanged(listView, index); }
private void OnListViewSnapTargetChanged(LoopListView2 listView, int targetIndex) { int shownItemCount = listView.ShownItemCount; for (int index = 0; index < shownItemCount; ++index) { ListItem7 component = (ListItem7)((Component)listView.GetShownItemByIndex(index)).GetComponent <ListItem7>(); if (index == targetIndex) { ((Graphic)component.mText).set_color(Color.get_red()); } else { ((Graphic)component.mText).set_color(Color.get_black()); } } }
void OnListViewSnapTargetChanged(LoopListView2 listView, int targetIndex) { int count = listView.ShownItemCount; for (int i = 0; i < count; ++i) { LoopListViewItem2 item2 = listView.GetShownItemByIndex(i); ListItem7 itemScript = item2.GetComponent <ListItem7>(); if (i == targetIndex) { itemScript.mText.color = Color.red; } else { itemScript.mText.color = Color.black; } } }
private LoopListViewItem2 OnGetItemByIndexForDay( LoopListView2 listView, int index) { LoopListViewItem2 loopListViewItem2 = listView.NewListViewItem("ItemPrefab1"); ListItem7 component = (ListItem7)((Component)loopListViewItem2).GetComponent <ListItem7>(); if (!loopListViewItem2.IsInitHandlerCalled) { loopListViewItem2.IsInitHandlerCalled = true; component.Init(); } int num1 = 1; int mMonthDayCount = SpinDatePickerDemoScript.mMonthDayCountArray[this.mCurSelectedMonth - 1]; int num2 = (index < 0 ? mMonthDayCount + (index + 1) % mMonthDayCount - 1 : index % mMonthDayCount) + num1; component.Value = num2; component.mText.set_text(num2.ToString()); return(loopListViewItem2); }
private LoopListViewItem2 OnGetItemByIndexForMonth( LoopListView2 listView, int index) { LoopListViewItem2 loopListViewItem2 = listView.NewListViewItem("ItemPrefab1"); ListItem7 component = (ListItem7)((Component)loopListViewItem2).GetComponent <ListItem7>(); if (!loopListViewItem2.IsInitHandlerCalled) { loopListViewItem2.IsInitHandlerCalled = true; component.Init(); } int num1 = 1; int num2 = 12; int num3 = (index < 0 ? num2 + (index + 1) % num2 - 1 : index % num2) + num1; component.Value = num3; component.mText.set_text(SpinDatePickerDemoScript.mMonthNameArray[num3 - 1]); return(loopListViewItem2); }
private LoopListViewItem2 OnGetItemByIndexForHour( LoopListView2 listView, int index) { LoopListViewItem2 loopListViewItem2 = listView.NewListViewItem("ItemPrefab1"); ListItem7 component = (ListItem7)((Component)loopListViewItem2).GetComponent <ListItem7>(); if (!loopListViewItem2.IsInitHandlerCalled) { loopListViewItem2.IsInitHandlerCalled = true; component.Init(); } int num1 = 1; int num2 = 24; int num3 = (index < 0 ? num2 + (index + 1) % num2 - 1 : index % num2) + num1; component.Value = num3; component.mText.set_text(num3.ToString()); return(loopListViewItem2); }