1
0
Fork 0

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

master
Emily Kager 2019-12-12 13:19:05 -08:00 committed by Emily Kager
parent 80693f4f0b
commit dcb39b0a44
3 changed files with 3 additions and 8 deletions

View File

@ -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 {

View File

@ -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,

View File

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