diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt index ed1636299..0b0134d3c 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MainActivity.kt @@ -272,13 +272,13 @@ class MainActivity : SimpleActivity(), DirectoryAdapter.DirOperationsListener { private fun increaseColumnCount() { config.dirColumnCnt = ++(directories_grid.layoutManager as GridLayoutManager).spanCount invalidateOptionsMenu() - directories_grid.adapter.notifyDataSetChanged() + directories_grid.adapter?.notifyDataSetChanged() } private fun reduceColumnCount() { config.dirColumnCnt = --(directories_grid.layoutManager as GridLayoutManager).spanCount invalidateOptionsMenu() - directories_grid.adapter.notifyDataSetChanged() + directories_grid.adapter?.notifyDataSetChanged() } private fun isPickImageIntent(intent: Intent) = isPickIntent(intent) && (hasImageContentData(intent) || isImageType(intent)) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt index a88097494..ef9344764 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/activities/MediaActivity.kt @@ -360,13 +360,13 @@ class MediaActivity : SimpleActivity(), MediaAdapter.MediaOperationsListener { private fun increaseColumnCount() { config.mediaColumnCnt = ++(media_grid.layoutManager as GridLayoutManager).spanCount invalidateOptionsMenu() - media_grid.adapter.notifyDataSetChanged() + media_grid.adapter?.notifyDataSetChanged() } private fun reduceColumnCount() { config.mediaColumnCnt = --(media_grid.layoutManager as GridLayoutManager).spanCount invalidateOptionsMenu() - media_grid.adapter.notifyDataSetChanged() + media_grid.adapter?.notifyDataSetChanged() } private fun isSetWallpaperIntent() = intent.getBooleanExtra(SET_WALLPAPER_INTENT, false)