From 0df06b575749f26810b32e177da99ee3d0f72b5d Mon Sep 17 00:00:00 2001 From: Arturo Mejia Date: Mon, 10 Jun 2019 11:58:18 -0400 Subject: [PATCH] [fenix] Revert "For https://github.com/mozilla-mobile/fenix/issues/3008, For https://github.com/mozilla-mobile/fenix/issues/2162 Add Simple Logic for Menu Orientation" (https://github.com/mozilla-mobile/fenix/pull/3310) https://github.com/mozilla-mobile/fenix/pull/3114 --- .../sessioncontrol/viewholders/CollectionViewHolder.kt | 10 +--------- .../mozilla/fenix/library/bookmarks/BookmarkAdapter.kt | 9 +-------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/app/src/main/java/org/mozilla/fenix/home/sessioncontrol/viewholders/CollectionViewHolder.kt b/app/src/main/java/org/mozilla/fenix/home/sessioncontrol/viewholders/CollectionViewHolder.kt index 49b52a60be..4c3153ff6f 100644 --- a/app/src/main/java/org/mozilla/fenix/home/sessioncontrol/viewholders/CollectionViewHolder.kt +++ b/app/src/main/java/org/mozilla/fenix/home/sessioncontrol/viewholders/CollectionViewHolder.kt @@ -17,7 +17,6 @@ import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job import kotlinx.coroutines.launch -import mozilla.components.browser.menu.BrowserMenu import mozilla.components.browser.menu.BrowserMenuBuilder import mozilla.components.browser.menu.item.SimpleBrowserMenuItem import org.mozilla.fenix.R @@ -58,16 +57,9 @@ class CollectionViewHolder( collection_overflow_button.run { increaseTapArea(buttonIncreaseDps) setOnClickListener { - val location = IntArray(2) - it.getLocationInWindow(location) collectionMenu.menuBuilder .build(view.context) - .show( - anchor = it, - orientation = if (location[1] > (rootView.measuredHeight / 2)) - BrowserMenu.Orientation.UP else - BrowserMenu.Orientation.DOWN - ) + .show(anchor = it) } } diff --git a/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkAdapter.kt b/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkAdapter.kt index efb44b8b87..def569235d 100644 --- a/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkAdapter.kt +++ b/app/src/main/java/org/mozilla/fenix/library/bookmarks/BookmarkAdapter.kt @@ -176,14 +176,7 @@ class BookmarkAdapter(val emptyView: View, val actionEmitter: Observer (it.rootView.measuredHeight / 2)) - BrowserMenu.Orientation.UP else - BrowserMenu.Orientation.DOWN - ) + bookmarkItemMenu.menuBuilder.build(containerView.context).show(anchor = it) } bookmark_title.text = if (item.title.isNullOrBlank()) item.url else item.title bookmark_url.text = item.url