make adapters at changing column counts nullable

This commit is contained in:
tibbi 2017-06-26 22:27:35 +02:00
parent 6b72e098b0
commit f14d34a3e4
2 changed files with 4 additions and 4 deletions

View file

@ -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))

View file

@ -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)