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 282f355a0..622346dba 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 @@ -761,9 +761,9 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener { private fun columnCountChanged() { invalidateOptionsMenu() - directories_grid.adapter?.notifyDataSetChanged() - getRecyclerAdapter()?.dirs?.apply { - measureRecyclerViewContent(this) + getRecyclerAdapter()?.apply { + notifyItemRangeChanged(0, dirs.size) + measureRecyclerViewContent(dirs) } } 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 31275b592..d136ee640 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 @@ -774,8 +774,10 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener { private fun columnCountChanged() { invalidateOptionsMenu() - media_grid.adapter?.notifyDataSetChanged() - measureRecyclerViewContent(mMedia) + getMediaAdapter()?.apply { + notifyItemRangeChanged(0, media.size) + measureRecyclerViewContent(media) + } } private fun isSetWallpaperIntent() = intent.getBooleanExtra(SET_WALLPAPER_INTENT, false) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt index 7f3128cf3..1e0306d42 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/adapters/MediaAdapter.kt @@ -35,7 +35,7 @@ import kotlinx.android.synthetic.main.photo_video_item_grid.view.* import kotlinx.android.synthetic.main.thumbnail_section.view.* import java.util.* -class MediaAdapter(activity: BaseSimpleActivity, var media: MutableList, val listener: MediaOperationsListener?, val isAGetIntent: Boolean, +class MediaAdapter(activity: BaseSimpleActivity, var media: ArrayList, val listener: MediaOperationsListener?, val isAGetIntent: Boolean, val allowMultiplePicks: Boolean, val path: String, recyclerView: MyRecyclerView, fastScroller: FastScroller? = null, itemClick: (Any) -> Unit) : MyRecyclerViewAdapter(activity, recyclerView, fastScroller, itemClick) {