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 c09b7604e..53a4ca619 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/MediaAdapter.kt @@ -292,7 +292,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, } fun updateMedia(newMedia: ArrayList) { - if (newMedia.hashCode() != currentMediaHash || currentGrouping != getFolderGrouping()) { + if (newMedia.hashCode() != currentMediaHash || currentGrouping != config.getFolderGrouping(path)) { currentMediaHash = newMedia.hashCode() Handler().postDelayed({ media = newMedia @@ -334,7 +334,7 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, } private fun groupMedia() { - currentGrouping = getFolderGrouping() + currentGrouping = config.getFolderGrouping(path) if (currentGrouping and GROUP_BY_NONE != 0) { return } @@ -355,8 +355,6 @@ class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, } } - private fun getFolderGrouping() = activity.config.getFolderGrouping(path) - private fun setupView(view: View, medium: Medium) { view.apply { play_outline.beVisibleIf(medium.isVideo())