Commit dcb39b0a authored by Emily Kager's avatar Emily Kager Committed by Emily Kager
Browse files

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

parent 80693f4f
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -596,9 +596,10 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
    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) {
        view?.swipeRefresh?.apply {
+0 −3
Original line number Diff line number Diff line
@@ -6,7 +6,6 @@ package org.mozilla.fenix.browser

import android.content.Context
import android.os.Bundle
import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
@@ -196,8 +195,6 @@ class BrowserFragment : BaseBrowserFragment(), UserInteractionHandler {
        return 0 to toolbarSize
    }

    override fun getAppropriateLayoutGravity() = Gravity.BOTTOM

    private fun themeReaderViewControlsForPrivateMode(view: View) = with(view) {
        listOf(
            R.id.mozac_feature_readerview_font_size_decrease,
+0 −3
Original line number Diff line number Diff line
@@ -5,7 +5,6 @@
package org.mozilla.fenix.customtabs

import android.content.Context
import android.view.Gravity
import android.view.View
import androidx.navigation.fragment.navArgs
import kotlinx.android.synthetic.main.component_browser_top_toolbar.*
@@ -204,6 +203,4 @@ class ExternalAppBrowserFragment : BaseBrowserFragment(), UserInteractionHandler
            null
        )
    )

    override fun getAppropriateLayoutGravity() = Gravity.TOP
}