For #7124 - Match toolbar location for ETP/security panel gravity

fennec/nightly
Emily Kager 5 years ago committed by Emily Kager
parent 80693f4f0b
commit dcb39b0a44

@ -596,9 +596,10 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
protected abstract fun getEngineMargins(): Pair<Int, Int> protected abstract fun getEngineMargins(): Pair<Int, Int>
/** /**
* Returns the layout [android.view.Gravity] for the quick settings dialog. * Returns the layout [android.view.Gravity] for the quick settings and ETP dialog.
*/ */
protected abstract fun getAppropriateLayoutGravity(): Int protected fun getAppropriateLayoutGravity(): Int =
if (context?.settings()?.shouldUseBottomToolbar == true) Gravity.BOTTOM else Gravity.TOP
protected fun updateLayoutMargins(inFullScreen: Boolean) { protected fun updateLayoutMargins(inFullScreen: Boolean) {
view?.swipeRefresh?.apply { view?.swipeRefresh?.apply {

@ -6,7 +6,6 @@ package org.mozilla.fenix.browser
import android.content.Context import android.content.Context
import android.os.Bundle import android.os.Bundle
import android.view.Gravity
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
@ -196,8 +195,6 @@ class BrowserFragment : BaseBrowserFragment(), UserInteractionHandler {
return 0 to toolbarSize return 0 to toolbarSize
} }
override fun getAppropriateLayoutGravity() = Gravity.BOTTOM
private fun themeReaderViewControlsForPrivateMode(view: View) = with(view) { private fun themeReaderViewControlsForPrivateMode(view: View) = with(view) {
listOf( listOf(
R.id.mozac_feature_readerview_font_size_decrease, R.id.mozac_feature_readerview_font_size_decrease,

@ -5,7 +5,6 @@
package org.mozilla.fenix.customtabs package org.mozilla.fenix.customtabs
import android.content.Context import android.content.Context
import android.view.Gravity
import android.view.View import android.view.View
import androidx.navigation.fragment.navArgs import androidx.navigation.fragment.navArgs
import kotlinx.android.synthetic.main.component_browser_top_toolbar.* import kotlinx.android.synthetic.main.component_browser_top_toolbar.*
@ -204,6 +203,4 @@ class ExternalAppBrowserFragment : BaseBrowserFragment(), UserInteractionHandler
null null
) )
) )
override fun getAppropriateLayoutGravity() = Gravity.TOP
} }

Loading…
Cancel
Save