mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-02-18 04:40:51 +01:00
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
|
config.temporarilyShowHidden = false
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun refreshMenuItems() {
|
fun refreshMenuItems() {
|
||||||
val currentFragment = getCurrentFragment() ?: return
|
val currentFragment = getCurrentFragment() ?: return
|
||||||
val currentViewType = config.getFolderViewType(currentFragment.currentPath)
|
val currentViewType = config.getFolderViewType(currentFragment.currentPath)
|
||||||
val favorites = config.favorites
|
val favorites = config.favorites
|
||||||
|
@ -351,6 +351,7 @@ class MimeTypesActivity : SimpleActivity(), ItemOperationsListener {
|
|||||||
ChangeViewTypeDialog(this, currentMimeType, true) {
|
ChangeViewTypeDialog(this, currentMimeType, true) {
|
||||||
recreateList()
|
recreateList()
|
||||||
setupLayoutManager()
|
setupLayoutManager()
|
||||||
|
refreshMenuItems()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -375,7 +376,7 @@ class MimeTypesActivity : SimpleActivity(), ItemOperationsListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun columnCountChanged() {
|
private fun columnCountChanged() {
|
||||||
invalidateOptionsMenu()
|
refreshMenuItems()
|
||||||
getRecyclerAdapter()?.apply {
|
getRecyclerAdapter()?.apply {
|
||||||
notifyItemRangeChanged(0, listItems.size)
|
notifyItemRangeChanged(0, listItems.size)
|
||||||
}
|
}
|
||||||
|
@ -115,7 +115,7 @@ class ItemsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF
|
|||||||
|
|
||||||
itemsIgnoringSearch = listItems
|
itemsIgnoringSearch = listItems
|
||||||
activity?.runOnUiThread {
|
activity?.runOnUiThread {
|
||||||
activity?.invalidateOptionsMenu()
|
(activity as? MainActivity)?.refreshMenuItems()
|
||||||
addItems(listItems, forceRefresh)
|
addItems(listItems, forceRefresh)
|
||||||
if (context != null && currentViewType != context!!.config.getFolderViewType(currentPath)) {
|
if (context != null && currentViewType != context!!.config.getFolderViewType(currentPath)) {
|
||||||
setupLayoutManager()
|
setupLayoutManager()
|
||||||
@ -492,7 +492,7 @@ class ItemsFragment(context: Context, attributeSet: AttributeSet) : MyViewPagerF
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun columnCountChanged() {
|
private fun columnCountChanged() {
|
||||||
activity?.invalidateOptionsMenu()
|
(activity as? MainActivity)?.refreshMenuItems()
|
||||||
getRecyclerAdapter()?.apply {
|
getRecyclerAdapter()?.apply {
|
||||||
notifyItemRangeChanged(0, listItems.size)
|
notifyItemRangeChanged(0, listItems.size)
|
||||||
}
|
}
|
||||||
|
@ -188,7 +188,7 @@ class RecentsFragment(context: Context, attributeSet: AttributeSet) : MyViewPage
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun columnCountChanged() {
|
private fun columnCountChanged() {
|
||||||
activity?.invalidateOptionsMenu()
|
(activity as? MainActivity)?.refreshMenuItems()
|
||||||
getRecyclerAdapter()?.apply {
|
getRecyclerAdapter()?.apply {
|
||||||
notifyItemRangeChanged(0, listItems.size)
|
notifyItemRangeChanged(0, listItems.size)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user