Example #1
0
        protected override void OnDestroy()
        {
            BrowseViewState?.Dispose();
            BrowseViewAdapter?.Dispose();

            base.OnDestroy();
        }
Example #2
0
        protected override void OnPause()
        {
            base.OnPause();

            if (IsHandlingException)
            {
                return;
            }

            // https://futurestud.io/tutorials/how-to-save-and-restore-the-scroll-position-and-state-of-a-android-listview

            if (BrowseViewState != null)
            {
                BrowseViewState.Dispose();
                BrowseViewState = null;
            }

            if (_abandonViewState == false)
            {
                BrowseViewState = AbstractBrowseView.OnSaveInstanceState();
            }

            if (ColumnCount == 1)
            {
                FirstVisiblePosition = AbstractBrowseView.FirstVisiblePosition;
            }

            FirstVisibleRow = AbstractBrowseView.FirstVisiblePosition / ColumnCount;
            PositionsInRow  = ColumnCount;
        }