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 047759661..ebfcdcd1b 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 @@ -862,10 +862,6 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { runOnUiThread { checkPlaceholderVisibility(dirs) - - val allowHorizontalScroll = config.scrollHorizontally && config.viewTypeFolders == VIEW_TYPE_GRID - /*directories_vertical_fastscroller.beVisibleIf(directories_grid.isVisible() && !allowHorizontalScroll) - directories_horizontal_fastscroller.beVisibleIf(directories_grid.isVisible() && allowHorizontalScroll)*/ setupAdapter(dirs.clone() as ArrayList) } @@ -947,7 +943,6 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { createDirectoryFromMedia(directory.path, curMedia, albumCovers, hiddenString, includedFolders, getProperFileSize, noMediaFolders) } - //mydebug("end ${System.currentTimeMillis() - time} ${directory.name}") // we are looping through the already displayed folders looking for changes, do not do anything if nothing changed if (directory.copy(subfoldersCount = 0, subfoldersMediaCount = 0) == newDir) { continue @@ -1055,7 +1050,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { runOnUiThread { directories_empty_placeholder.beGone() directories_empty_placeholder_2.beGone() - directories_grid.beVisible() + directories_fastscroller.beVisible() } } @@ -1163,7 +1158,7 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { } directories_empty_placeholder_2.underlineText() - directories_grid.beVisibleIf(directories_empty_placeholder.isGone()) + directories_fastscroller.beVisibleIf(directories_empty_placeholder.isGone()) } private fun setupAdapter(dirs: ArrayList, textToSearch: String = "", forceRecreate: Boolean = false) { 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 7c5537e2f..bf0c3f0f1 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 @@ -364,8 +364,10 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { if (grouped.isEmpty()) { media_empty_text_placeholder.text = getString(R.string.no_items_found) media_empty_text_placeholder.beVisible() + media_fastscroller.beGone() } else { media_empty_text_placeholder.beGone() + media_fastscroller.beVisible() } handleGridSpacing(grouped) @@ -661,11 +663,6 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { private fun setupGridLayoutManager() { val layoutManager = media_grid.layoutManager as MyGridLayoutManager - (media_grid.layoutParams as RelativeLayout.LayoutParams).apply { - topMargin = 0 - bottomMargin = 0 - } - if (config.scrollHorizontally) { layoutManager.orientation = RecyclerView.HORIZONTAL media_refresh_layout.layoutParams = RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.MATCH_PARENT) @@ -692,13 +689,6 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { 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 } @@ -848,12 +838,9 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { if (media_empty_text_placeholder.isVisible()) { media_empty_text_placeholder.text = getString(R.string.no_media_with_filters) } - media_grid.beVisibleIf(media_empty_text_placeholder.isGone()) + media_fastscroller.beVisibleIf(media_empty_text_placeholder.isGone()) val viewType = config.getFolderViewType(if (mShowAll) SHOW_ALL else mPath) - val allowHorizontalScroll = config.scrollHorizontally && viewType == VIEW_TYPE_GRID - /*media_vertical_fastscroller.beVisibleIf(media_grid.isVisible() && !allowHorizontalScroll) - media_horizontal_fastscroller.beVisibleIf(media_grid.isVisible() && allowHorizontalScroll)*/ setupAdapter() }