diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/MainActivity.kt index c9707920..55fb32ae 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/MainActivity.kt @@ -145,7 +145,7 @@ class MainActivity : SimpleActivity() { config.temporarilyShowHidden = false } - private fun refreshMenuItems() { + fun refreshMenuItems() { val currentFragment = getCurrentFragment() ?: return val currentViewType = config.getFolderViewType(currentFragment.currentPath) val favorites = config.favorites diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/MimeTypesActivity.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/MimeTypesActivity.kt index f48aa060..926af5e1 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/MimeTypesActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/activities/MimeTypesActivity.kt @@ -351,6 +351,7 @@ class MimeTypesActivity : SimpleActivity(), ItemOperationsListener { ChangeViewTypeDialog(this, currentMimeType, true) { recreateList() setupLayoutManager() + refreshMenuItems() } } @@ -375,7 +376,7 @@ class MimeTypesActivity : SimpleActivity(), ItemOperationsListener { } private fun columnCountChanged() { - invalidateOptionsMenu() + refreshMenuItems() getRecyclerAdapter()?.apply { notifyItemRangeChanged(0, listItems.size) } diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/ItemsFragment.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/ItemsFragment.kt index f3716e13..9826a5b9 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/ItemsFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/ItemsFragment.kt @@ -115,7 +115,7 @@ class ItemsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF itemsIgnoringSearch = listItems activity?.runOnUiThread { - activity?.invalidateOptionsMenu() + (activity as? MainActivity)?.refreshMenuItems() addItems(listItems, forceRefresh) if (context != null && currentViewType != context!!.config.getFolderViewType(currentPath)) { setupLayoutManager() @@ -492,7 +492,7 @@ class ItemsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF } private fun columnCountChanged() { - activity?.invalidateOptionsMenu() + (activity as? MainActivity)?.refreshMenuItems() getRecyclerAdapter()?.apply { notifyItemRangeChanged(0, listItems.size) } diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/RecentsFragment.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/RecentsFragment.kt index ce225aa1..5f6ab818 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/RecentsFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/pro/fragments/RecentsFragment.kt @@ -188,7 +188,7 @@ class RecentsFragment(context: Context, attributeSet: AttributeSet) : MyViewPage } private fun columnCountChanged() { - activity?.invalidateOptionsMenu() + (activity as? MainActivity)?.refreshMenuItems() getRecyclerAdapter()?.apply { notifyItemRangeChanged(0, listItems.size) }