diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt index f7c940b0a..02abb93f7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -41,6 +41,7 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList() var foregroundColor = 0 var pinnedFolders = config.pinnedFolders + var scrollVertically = !config.scrollHorizontally fun toggleItemSelection(select: Boolean, pos: Int) { if (itemViews[pos] != null) @@ -366,7 +367,7 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList (Unit)) : SwappingHolder(view, MultiSelector()) { - fun bindView(directory: Directory, isPinned: Boolean): View { + fun bindView(directory: Directory, isPinned: Boolean, scrollVertically: Boolean): View { itemView.apply { dir_name.text = directory.name photo_cnt.text = directory.mediaCnt.toString() dir_pin.visibility = if (isPinned) View.VISIBLE else View.GONE - activity.loadImage(directory.tmb, dir_thumbnail, true) + activity.loadImage(directory.tmb, dir_thumbnail, scrollVertically) setOnClickListener { viewClicked(directory) } setOnLongClickListener { viewLongClicked(); true } diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt index c757dd671..1f0d72042 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt @@ -34,6 +34,7 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList, val selectedPositions = HashSet() var foregroundColor = 0 var displayFilenames = config.displayFileNames + var scrollVertically = !config.scrollHorizontally fun toggleItemSelection(select: Boolean, pos: Int) { if (itemViews[pos] != null) @@ -274,7 +275,7 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList, } override fun onBindViewHolder(holder: ViewHolder, position: Int) { - itemViews.put(position, holder.bindView(media[position], displayFilenames)) + itemViews.put(position, holder.bindView(media[position], displayFilenames, scrollVertically)) toggleItemSelection(selectedPositions.contains(position), position) holder.itemView.tag = holder } @@ -337,12 +338,12 @@ class MediaAdapter(val activity: SimpleActivity, var media: MutableList, class ViewHolder(val view: View, val adapter: MyAdapterListener, val activity: SimpleActivity, val multiSelectorCallback: ModalMultiSelectorCallback, val multiSelector: MultiSelector, val listener: MediaOperationsListener?, val itemClick: (Medium) -> (Unit)) : SwappingHolder(view, MultiSelector()) { - fun bindView(medium: Medium, displayFilenames: Boolean): View { + fun bindView(medium: Medium, displayFilenames: Boolean, scrollVertically: Boolean): View { itemView.apply { play_outline.visibility = if (medium.video) View.VISIBLE else View.GONE photo_name.beVisibleIf(displayFilenames) photo_name.text = medium.name - activity.loadImage(medium.path, medium_thumbnail, true) + activity.loadImage(medium.path, medium_thumbnail, scrollVertically) setOnClickListener { viewClicked(medium) } setOnLongClickListener { viewLongClicked(); true }