コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        void OnMonthSnapTargetFinished(LoopListView2 listView, LoopListViewItem2 item)
        {
            LoopListViewItem2 item0      = mLoopListViewDay.GetShownItemByIndex(0);
            ListItem7         itemScript = item0.GetComponent <ListItem7>();
            int index = itemScript.Value - 1;

            mLoopListViewDay.RefreshAllShownItemWithFirstIndex(index);
        }
コード例 #4
0
 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);
     }
 }
コード例 #5
0
 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);
     }
 }
コード例 #6
0
        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);
        }
コード例 #7
0
        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());
                }
            }
        }
コード例 #8
0
        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;
                }
            }
        }
コード例 #9
0
        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);
        }
コード例 #10
0
        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);
        }
コード例 #11
0
        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);
        }