private void setBtnDisplay(ViewerPageButton b, bool active) { if (active) { if (_activeBtn != b) { _activeBtn?.SetActive(false); } _activeBtn = b; } b?.SetActive(active); }
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); } }