recheck scroll direction on resume

This commit is contained in:
tibbi 2017-06-24 22:57:20 +02:00
parent f2b1ef2c3b
commit 52c636f176
3 changed files with 8 additions and 1 deletions

View file

@ -119,6 +119,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
if (mStoredScrollHorizontally != config.scrollHorizontally) {
(directories_grid.adapter as DirectoryAdapter).scrollVertically = !config.scrollHorizontally
directories_grid.adapter.notifyDataSetChanged()
setupScrollDirection()
}
tryloadGallery()
@ -396,7 +397,10 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
itemClicked(it.path)
}
}
setupScrollDirection()
}
private fun setupScrollDirection() {
directories_vertical_fastscroller.isHorizontal = false
directories_vertical_fastscroller.beGoneIf(config.scrollHorizontally)

View file

@ -89,6 +89,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
if (mStoredScrollHorizontally != config.scrollHorizontally) {
(media_grid.adapter as MediaAdapter).scrollVertically = !config.scrollHorizontally
media_grid.adapter.notifyDataSetChanged()
setupScrollDirection()
}
tryloadGallery()
@ -145,7 +146,10 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
itemClicked(it.path)
}
}
setupScrollDirection()
}
private fun setupScrollDirection() {
media_vertical_fastscroller.isHorizontal = false
media_vertical_fastscroller.beGoneIf(config.scrollHorizontally)

View file

@ -10,7 +10,6 @@ import com.simplemobiletools.commons.helpers.*
import com.simplemobiletools.gallery.R
import com.simplemobiletools.gallery.activities.SimpleActivity
import com.simplemobiletools.gallery.extensions.config
import com.simplemobiletools.gallery.helpers.Config
import kotlinx.android.synthetic.main.dialog_change_sorting.view.*
class ChangeSortingDialog(val activity: SimpleActivity, val isDirectorySorting: Boolean, showFolderCheckbox: Boolean,