* For #3008 - Adjust orientation of collections menu based on view location * For #2162 - Add simple menu orientation logic to bookmark menumaster
parent
ef0618a3d1
commit
dc0d153580
|
@ -57,9 +57,16 @@ 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 = BrowserMenu.Orientation.DOWN)
|
||||
.show(
|
||||
anchor = it,
|
||||
orientation = if (location[1] > (rootView.measuredHeight / 2))
|
||||
BrowserMenu.Orientation.UP else
|
||||
BrowserMenu.Orientation.DOWN
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -176,9 +176,13 @@ 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 = BrowserMenu.Orientation.DOWN
|
||||
orientation = if (location[1] > (it.rootView.measuredHeight / 2))
|
||||
BrowserMenu.Orientation.UP else
|
||||
BrowserMenu.Orientation.DOWN
|
||||
)
|
||||
}
|
||||
bookmark_title.text = if (item.title.isNullOrBlank()) item.url else item.title
|
||||
|
|
Loading…
Reference in New Issue