1
0
Fork 0

Revert "For #3008, For #2162 Add Simple Logic for Menu Orientation" (#3310)

#3114
master
Arturo Mejia 2019-06-10 11:58:18 -04:00 committed by Colin Lee
parent f7b5fc3e18
commit 5df726715f
2 changed files with 2 additions and 17 deletions

View File

@ -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)
}
}

View File

@ -176,14 +176,7 @@ class BookmarkAdapter(val emptyView: View, val actionEmitter: Observer<BookmarkA
bookmark_overflow.increaseTapArea(bookmarkOverflowExtraDips)
bookmark_overflow.setOnClickListener {
val location = IntArray(2)
it.getLocationInWindow(location)
bookmarkItemMenu.menuBuilder.build(containerView.context).show(
anchor = it,
orientation = if (location[1] > (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