From 49510884b7383bf5326f4c86822bb6a452b1dcb2 Mon Sep 17 00:00:00 2001 From: tibbi Date: Wed, 26 Jun 2019 23:00:57 +0200 Subject: [PATCH] properly handle horizontal scrolling at search results --- .../gallery/pro/activities/SearchActivity.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SearchActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SearchActivity.kt index 58574ecb5..a8fe7edf6 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SearchActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/activities/SearchActivity.kt @@ -6,6 +6,8 @@ import android.content.Intent import android.os.Bundle import android.view.Menu import android.view.MenuItem +import android.view.ViewGroup +import android.widget.RelativeLayout import androidx.appcompat.widget.SearchView import androidx.core.view.MenuItemCompat import androidx.recyclerview.widget.GridLayoutManager @@ -153,13 +155,13 @@ class SearchActivity : SimpleActivity(), MediaOperationsListener { private fun setupGridLayoutManager() { val layoutManager = media_grid.layoutManager as MyGridLayoutManager - /*if (config.scrollHorizontally) { + if (config.scrollHorizontally) { layoutManager.orientation = RecyclerView.HORIZONTAL - media_refresh_layout.layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT) + media_grid.layoutParams = RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT) } else { layoutManager.orientation = RecyclerView.VERTICAL - media_refresh_layout.layoutParams = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) - }*/ + media_grid.layoutParams = RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) + } layoutManager.spanCount = config.mediaColumnCnt val adapter = getMediaAdapter()