mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
set scrolling orientation based on the user setting
This commit is contained in:
parent
f740150d49
commit
88de8a4d2a
4 changed files with 7 additions and 0 deletions
|
@ -220,6 +220,7 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener {
|
|||
|
||||
private fun handleZooming() {
|
||||
val layoutManager = directories_grid.layoutManager as GridLayoutManager
|
||||
layoutManager.orientation = if (config.scrollHorizontally) GridLayoutManager.HORIZONTAL else GridLayoutManager.VERTICAL
|
||||
layoutManager.spanCount = config.dirColumnCnt
|
||||
MyScalableRecyclerView.mListener = object : MyScalableRecyclerView.MyScalableRecyclerViewListener {
|
||||
override fun zoomIn() {
|
||||
|
|
|
@ -296,6 +296,7 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener {
|
|||
|
||||
private fun handleZooming() {
|
||||
val layoutManager = media_grid.layoutManager as GridLayoutManager
|
||||
layoutManager.orientation = if (config.scrollHorizontally) GridLayoutManager.HORIZONTAL else GridLayoutManager.VERTICAL
|
||||
layoutManager.spanCount = config.mediaColumnCnt
|
||||
MyScalableRecyclerView.mListener = object : MyScalableRecyclerView.MyScalableRecyclerViewListener {
|
||||
override fun zoomIn() {
|
||||
|
|
|
@ -190,4 +190,8 @@ class Config(context: Context) : BaseConfig(context) {
|
|||
val listType = object : TypeToken<List<AlbumCover>>() {}.type
|
||||
return Gson().fromJson<ArrayList<AlbumCover>>(albumCovers, listType) ?: ArrayList(1)
|
||||
}
|
||||
|
||||
var scrollHorizontally: Boolean
|
||||
get() = prefs.getBoolean(SCROLL_HORIZONTALLY, false)
|
||||
set(scrollHorizontally) = prefs.edit().putBoolean(SCROLL_HORIZONTALLY, scrollHorizontally).apply()
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ val HIDE_FOLDER_TOOLTIP_SHOWN = "hide_folder_tooltip_shown"
|
|||
val EXCLUDED_FOLDERS = "excluded_folders"
|
||||
val INCLUDED_FOLDERS = "included_folders"
|
||||
val ALBUM_COVERS = "album_covers"
|
||||
val SCROLL_HORIZONTALLY = "scroll_horizontally"
|
||||
|
||||
val NOMEDIA = ".nomedia"
|
||||
|
||||
|
|
Loading…
Reference in a new issue