コード例 #1
0
        private void setBtnDisplay(ViewerPageButton b, bool active)
        {
            if (active)
            {
                if (_activeBtn != b)
                {
                    _activeBtn?.SetActive(false);
                }
                _activeBtn = b;
            }

            b?.SetActive(active);
        }
コード例 #2
0
        private void addPageButtons(int pageCount, int activePage)
        {
            _scrollContentLayout.RemoveAllViewsInLayout();

            for (int i = 1; i <= pageCount; i++)
            {
                ViewerPageButton b = new ViewerPageButton(Context);
                b.PageNumber = i;
                b.OnClick   += handlePageBtnClick;

                if (i == activePage)
                {
                    _activeBtn = b;
                }

                b.SetActive(_activeBtn == b);

                _scrollContentLayout.AddView(b);
            }
        }