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
|
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")
|
@Suppress("ConstantConditionIf")
|
||||||
if (FeatureFlags.pullToRefreshEnabled) {
|
if (FeatureFlags.pullToRefreshEnabled) {
|
||||||
val primaryTextColor =
|
val primaryTextColor =
|
||||||
|
|
|
@ -17,6 +17,7 @@ import androidx.core.view.isVisible
|
||||||
import com.google.android.material.snackbar.Snackbar
|
import com.google.android.material.snackbar.Snackbar
|
||||||
import kotlinx.android.extensions.LayoutContainer
|
import kotlinx.android.extensions.LayoutContainer
|
||||||
import kotlinx.android.synthetic.main.browser_toolbar_popup_window.view.*
|
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.domains.autocomplete.ShippedDomainsProvider
|
||||||
import mozilla.components.browser.session.Session
|
import mozilla.components.browser.session.Session
|
||||||
import mozilla.components.browser.toolbar.BrowserToolbar
|
import mozilla.components.browser.toolbar.BrowserToolbar
|
||||||
|
@ -58,8 +59,10 @@ class BrowserToolbarView(
|
||||||
else -> R.layout.component_browser_top_toolbar
|
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)
|
.inflate(toolbarLayout, container, true)
|
||||||
|
|
||||||
|
val view: BrowserToolbar = layout
|
||||||
.findViewById(R.id.toolbar)
|
.findViewById(R.id.toolbar)
|
||||||
|
|
||||||
val toolbarIntegration: ToolbarIntegration
|
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
|
// 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 {
|
companion object {
|
||||||
private const val TOOLBAR_ELEVATION = 16
|
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
|
- 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/. -->
|
- 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"
|
<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_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
<mozilla.components.browser.toolbar.BrowserToolbar
|
<mozilla.components.browser.toolbar.BrowserToolbar
|
||||||
|
|
Loading…
Reference in New Issue