morgan pushed to branch tor-browser-128.3.0esr-14.0-1 at The Tor Project / Applications / Tor Browser
Commits: 90379594 by cypherpunks1 at 2024-10-21T18:49:52+00:00 fixup! [android] Modify UI/UX
Bug 43223: Hide option to open bookmarks in non-private tabs on Android
- - - - -
2 changed files:
- mobile/android/fenix/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkFragment.kt - mobile/android/fenix/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkItemMenu.kt
Changes:
===================================== mobile/android/fenix/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkFragment.kt ===================================== @@ -55,6 +55,7 @@ import org.mozilla.fenix.ext.getRootView import org.mozilla.fenix.ext.nav import org.mozilla.fenix.ext.requireComponents import org.mozilla.fenix.ext.setTextColor +import org.mozilla.fenix.ext.settings import org.mozilla.fenix.library.LibraryPageFragment import org.mozilla.fenix.tabstray.Page import org.mozilla.fenix.utils.allowUndo @@ -179,6 +180,10 @@ class BookmarkFragment : LibraryPageFragment<BookmarkNode>(), UserInteractionHan } else { inflater.inflate(R.menu.bookmarks_select_multi, menu)
+ menu.findItem(R.id.open_bookmarks_in_new_tabs_multi_select)?.apply { + isVisible = !requireContext().settings().shouldDisableNormalMode + } + menu.findItem(R.id.delete_bookmarks_multi_select).title = SpannableString(getString(R.string.bookmark_menu_delete_button)).apply { setTextColor(requireContext(), R.attr.textCritical)
===================================== mobile/android/fenix/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkItemMenu.kt ===================================== @@ -14,6 +14,7 @@ import mozilla.components.concept.storage.BookmarkNodeType import mozilla.components.support.ktx.android.content.getColorFromAttr import org.mozilla.fenix.R import org.mozilla.fenix.ext.bookmarkStorage +import org.mozilla.fenix.ext.settings
class BookmarkItemMenu( private val context: Context, @@ -37,6 +38,7 @@ class BookmarkItemMenu( @SuppressWarnings("LongMethod") internal suspend fun menuItems(itemType: BookmarkNodeType, itemId: String): List<TextMenuCandidate> { val hasAtLeastOneChild = !context.bookmarkStorage.getTree(itemId, false)?.children.isNullOrEmpty() + val shouldDisableNormalMode = context.settings().shouldDisableNormalMode
return listOfNotNull( if (itemType != BookmarkNodeType.SEPARATOR) { @@ -66,7 +68,7 @@ class BookmarkItemMenu( } else { null }, - if (itemType == BookmarkNodeType.ITEM) { + if (!shouldDisableNormalMode && itemType == BookmarkNodeType.ITEM) { TextMenuCandidate( text = context.getString(R.string.bookmark_menu_open_in_new_tab_button), ) { @@ -84,7 +86,7 @@ class BookmarkItemMenu( } else { null }, - if (hasAtLeastOneChild && itemType == BookmarkNodeType.FOLDER) { + if (!shouldDisableNormalMode && hasAtLeastOneChild && itemType == BookmarkNodeType.FOLDER) { TextMenuCandidate( text = context.getString(R.string.bookmark_menu_open_all_in_tabs_button), ) {
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/90379594...
tbb-commits@lists.torproject.org