From ac4d65c69d6b0f54a6df0c4566ff21a6247565fd Mon Sep 17 00:00:00 2001 From: tibbi Date: Sat, 18 Mar 2017 18:44:35 +0100 Subject: [PATCH] show the Go To Favorite button only if there are any favorites --- .../filemanager/activities/MainActivity.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/MainActivity.kt b/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/MainActivity.kt index fb9adcd6..75599195 100644 --- a/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/MainActivity.kt +++ b/app/src/main/kotlin/com/simplemobiletools/filemanager/activities/MainActivity.kt @@ -107,8 +107,11 @@ class MainActivity : SimpleActivity(), ItemsFragment.ItemInteractionListener, Br menuInflater.inflate(R.menu.menu, menu) val favorites = config.favorites - menu.findItem(R.id.add_favorite).isVisible = !favorites.contains(currentPath) - menu.findItem(R.id.remove_favorite).isVisible = favorites.contains(currentPath) + menu.apply { + 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 }