Co-authored-by: Severin <Baron-Severin@users.noreply.github.com>master
parent
aa49ab1dfb
commit
e8972bb47d
|
@ -376,6 +376,18 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
|
|||
view = view
|
||||
)
|
||||
|
||||
session.register(observer = object : Session.Observer {
|
||||
override fun onLoadRequest(
|
||||
session: Session,
|
||||
url: String,
|
||||
triggeredByRedirect: Boolean,
|
||||
triggeredByWebContent: Boolean
|
||||
): Boolean {
|
||||
browserToolbarView.expand()
|
||||
return false
|
||||
}
|
||||
}, owner = viewLifecycleOwner)
|
||||
|
||||
@Suppress("ConstantConditionIf")
|
||||
if (FeatureFlags.pullToRefreshEnabled) {
|
||||
val primaryTextColor =
|
||||
|
|
|
@ -17,6 +17,7 @@ import androidx.core.view.isVisible
|
|||
import com.google.android.material.snackbar.Snackbar
|
||||
import kotlinx.android.extensions.LayoutContainer
|
||||
import kotlinx.android.synthetic.main.browser_toolbar_popup_window.view.*
|
||||
import kotlinx.android.synthetic.main.component_browser_top_toolbar.view.*
|
||||
import mozilla.components.browser.domains.autocomplete.ShippedDomainsProvider
|
||||
import mozilla.components.browser.session.Session
|
||||
import mozilla.components.browser.toolbar.BrowserToolbar
|
||||
|
@ -58,8 +59,10 @@ class BrowserToolbarView(
|
|||
else -> R.layout.component_browser_top_toolbar
|
||||
}
|
||||
|
||||
val view: BrowserToolbar = LayoutInflater.from(container.context)
|
||||
private val layout = LayoutInflater.from(container.context)
|
||||
.inflate(toolbarLayout, container, true)
|
||||
|
||||
val view: BrowserToolbar = layout
|
||||
.findViewById(R.id.toolbar)
|
||||
|
||||
val toolbarIntegration: ToolbarIntegration
|
||||
|
@ -216,6 +219,12 @@ class BrowserToolbarView(
|
|||
// Intentionally leaving this as a stub for now since we don't actually want to update currently
|
||||
}
|
||||
|
||||
fun expand() {
|
||||
if (!settings.shouldUseBottomToolbar) {
|
||||
layout.app_bar?.setExpanded(true)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val TOOLBAR_ELEVATION = 16
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
- License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
|
||||
<com.google.android.material.appbar.AppBarLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/app_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<mozilla.components.browser.toolbar.BrowserToolbar
|
||||
|
|
Loading…
Reference in New Issue