From c17e6833e2af09b2e5ecbf80fedda0fd45134540 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 29 Nov 2021 21:15:58 +0100 Subject: [PATCH] setup listLayoutManager too --- .../gallery/pro/activities/MainActivity.kt | 6 ++-- .../gallery/pro/activities/MediaActivity.kt | 30 +++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt index d5a46ae53..c7bee7abd 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MainActivity.kt @@ -648,10 +648,10 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { } private fun setupListLayoutManager() { - /*val layoutManager = directories_grid.layoutManager as MyGridLayoutManager + val layoutManager = directories_grid.layoutManager as MyGridLayoutManager layoutManager.spanCount = 1 layoutManager.orientation = RecyclerView.VERTICAL - directories_refresh_layout.layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) + directories_refresh_layout.layoutParams = RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) val smallMargin = resources.getDimension(R.dimen.small_margin).toInt() (directories_grid.layoutParams as RelativeLayout.LayoutParams).apply { @@ -659,7 +659,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { bottomMargin = smallMargin } - mZoomListener = null*/ + mZoomListener = null } private fun measureRecyclerViewContent(directories: ArrayList) { diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt index 28174b5b7..f646cc0df 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/MediaActivity.kt @@ -690,6 +690,21 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { } } + private fun setupListLayoutManager() { + val layoutManager = media_grid.layoutManager as MyGridLayoutManager + layoutManager.spanCount = 1 + layoutManager.orientation = RecyclerView.VERTICAL + media_refresh_layout.layoutParams = RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) + + val smallMargin = resources.getDimension(R.dimen.small_margin).toInt() + (media_grid.layoutParams as RelativeLayout.LayoutParams).apply { + topMargin = smallMargin + bottomMargin = smallMargin + } + + mZoomListener = null + } + private fun measureRecyclerViewContent(media: ArrayList) { media_grid.onGlobalLayout { if (config.scrollHorizontally) { @@ -784,21 +799,6 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { } } - private fun setupListLayoutManager() { - /*val layoutManager = media_grid.layoutManager as MyGridLayoutManager - layoutManager.spanCount = 1 - layoutManager.orientation = RecyclerView.VERTICAL - media_refresh_layout.layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) - - val smallMargin = resources.getDimension(R.dimen.small_margin).toInt() - (media_grid.layoutParams as RelativeLayout.LayoutParams).apply { - topMargin = smallMargin - bottomMargin = smallMargin - } - - mZoomListener = null*/ - } - private fun increaseColumnCount() { config.mediaColumnCnt = ++(media_grid.layoutManager as MyGridLayoutManager).spanCount columnCountChanged()