fix #618, properly refresh menu items when appropriate
This commit is contained in:
parent
12c2ba7590
commit
23955ac05d
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue