For #6946 - Get engine margins without assuming top/bottom toolbar
This commit is contained in:
parent
dcb39b0a44
commit
686facffc6
|
@ -593,7 +593,13 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
|
|||
/**
|
||||
* Returns the top and bottom margins.
|
||||
*/
|
||||
protected abstract fun getEngineMargins(): Pair<Int, Int>
|
||||
private fun getEngineMargins(): Pair<Int, Int> =
|
||||
if (context?.settings()?.shouldUseBottomToolbar == true) {
|
||||
val toolbarSize = resources.getDimensionPixelSize(R.dimen.browser_toolbar_height)
|
||||
0 to toolbarSize
|
||||
} else {
|
||||
0 to 0
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the layout [android.view.Gravity] for the quick settings and ETP dialog.
|
||||
|
|
|
@ -190,11 +190,6 @@ class BrowserFragment : BaseBrowserFragment(), UserInteractionHandler {
|
|||
}
|
||||
}
|
||||
|
||||
override fun getEngineMargins(): Pair<Int, Int> {
|
||||
val toolbarSize = resources.getDimensionPixelSize(R.dimen.browser_toolbar_height)
|
||||
return 0 to toolbarSize
|
||||
}
|
||||
|
||||
private fun themeReaderViewControlsForPrivateMode(view: View) = with(view) {
|
||||
listOf(
|
||||
R.id.mozac_feature_readerview_font_size_decrease,
|
||||
|
|
|
@ -71,7 +71,8 @@ class ExternalAppBrowserFragment : BaseBrowserFragment(), UserInteractionHandler
|
|||
isPrivate = (activity as HomeActivity).browsingModeManager.mode.isPrivate
|
||||
),
|
||||
owner = this,
|
||||
view = view)
|
||||
view = view
|
||||
)
|
||||
|
||||
windowFeature.set(
|
||||
feature = CustomTabWindowFeature(
|
||||
|
@ -186,11 +187,6 @@ class ExternalAppBrowserFragment : BaseBrowserFragment(), UserInteractionHandler
|
|||
}
|
||||
}
|
||||
|
||||
override fun getEngineMargins(): Pair<Int, Int> {
|
||||
// Since the top toolbar is dynamic we don't want any margins
|
||||
return 0 to 0
|
||||
}
|
||||
|
||||
override fun getContextMenuCandidates(
|
||||
context: Context,
|
||||
view: View
|
||||
|
|
Loading…
Reference in New Issue
Block a user