mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-04-03 13:11:02 +02:00
show the Go To Favorite button only if there are any favorites
This commit is contained in:
parent
9327542b7a
commit
ac4d65c69d
@ -107,8 +107,11 @@ class MainActivity : SimpleActivity(), ItemsFragment.ItemInteractionListener, Br
|
|||||||
menuInflater.inflate(R.menu.menu, menu)
|
menuInflater.inflate(R.menu.menu, menu)
|
||||||
|
|
||||||
val favorites = config.favorites
|
val favorites = config.favorites
|
||||||
menu.findItem(R.id.add_favorite).isVisible = !favorites.contains(currentPath)
|
menu.apply {
|
||||||
menu.findItem(R.id.remove_favorite).isVisible = favorites.contains(currentPath)
|
findItem(R.id.add_favorite).isVisible = !favorites.contains(currentPath)
|
||||||
|
findItem(R.id.remove_favorite).isVisible = favorites.contains(currentPath)
|
||||||
|
findItem(R.id.go_to_favorite).isVisible = favorites.isNotEmpty()
|
||||||
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user