private void HandleSettingsGroupChanged(int idx) { if (idx >= loadedSettingsGroups.Count) { idx = 0; } selectedSettingsGroup?.OnDisable(); selectedSettingsGroup = loadedSettingsGroups[idx]; selectedSettingsGroup.OnEnable(); customListTableView.ReloadData(); int initialCell = selectedSettingsGroup.CellToSelect(); if (initialCell == -1) { customListTableView.ClearSelection(); } else { customListTableView.SelectCellWithIdx(initialCell); } TableViewScroller scroller = TVTableViewScroller(ref customListTableView); scroller.ScrollToCellWithIdx(0, TableViewScroller.ScrollPositionType.Beginning, true); }
private void HandleCellSelectedEvent(SegmentedControl _, int cellIdx) { selectedGroup?.OnDisable(); selectedGroup = loadedSettingsGroups[cellIdx]; selectedGroup.OnEnable(); tableList.data.Clear(); tableList.cellSize = selectedGroup.GetSize(); for (var i = 0; i < selectedGroup.NumberOfCells(); i++) { tableList.data.Add(selectedGroup.CellInfoForIdx(i)); } tableList.tableView.ReloadData(); tableList.tableView.ScrollToCellWithIdx(0, TableView.ScrollPositionType.Beginning, false); tableList.tableView.SelectCellWithIdx(selectedGroup.CellToSelect(), false); ScrollView_scrollPositionChangedEvent(0f); }