public void setAllowReordering(final boolean allowReordering) { this.allowReordering = allowReordering; if (gridAdapter != null) { gridAdapter.recalculateItemsPerRow(); gridAdapter.notifyDataSetChanged(); } }
@Override public void onRestoreInstanceState(final Parcelable state) { if (!(state instanceof SavedState)) { super.onRestoreInstanceState(state); return; } SavedState ss = (SavedState) state; super.onRestoreInstanceState(ss.getSuperState()); if (gridAdapter != null) gridAdapter.restoreState(ss.adapterState); allowReordering = ss.allowReordering; debugging = ss.debugging; defaultPadding = ss.defaultPadding; numColumns = ss.numColumns; requestedColumnCount = ss.requestedColumnCount; requestedColumnWidth = ss.requestedColumnWidth; requestedHorizontalSpacing = ss.requestedHorizontalSpacing; requestedVerticalSpacing = ss.requestedVerticalSpacing; setSelectionFromTop(20, 0); }
public void setAdapter(final AsymmetricGridViewAdapter<T> adapter) { gridAdapter = adapter; super.setAdapter(adapter); adapter.recalculateItemsPerRow(); }