diff --git a/app/src/main/java/org/mozilla/fenix/browser/BrowserFragment.kt b/app/src/main/java/org/mozilla/fenix/browser/BrowserFragment.kt index 064c60f53e..a981a5e732 100644 --- a/app/src/main/java/org/mozilla/fenix/browser/BrowserFragment.kt +++ b/app/src/main/java/org/mozilla/fenix/browser/BrowserFragment.kt @@ -17,7 +17,6 @@ import android.view.ViewGroup import android.view.accessibility.AccessibilityManager import androidx.appcompat.app.AppCompatActivity import androidx.coordinatorlayout.widget.CoordinatorLayout -import androidx.core.content.ContextCompat import androidx.fragment.app.Fragment import androidx.navigation.Navigation import com.google.android.material.snackbar.Snackbar @@ -123,12 +122,7 @@ class BrowserFragment : Fragment(), BackHandler, CoroutineScope { ) toolbarComponent.uiView.view.apply { - setBackgroundColor( - ContextCompat.getColor( - view.context, - DefaultThemeManager.resolveAttribute(R.attr.foundation, context) - ) - ) + setBackgroundResource(R.drawable.toolbar_background) (layoutParams as CoordinatorLayout.LayoutParams).apply { gravity = getAppropriateLayoutGravity() diff --git a/app/src/main/java/org/mozilla/fenix/browser/BrowserToolbarDividerBehavior.kt b/app/src/main/java/org/mozilla/fenix/browser/BrowserToolbarDividerBehavior.kt deleted file mode 100644 index dbb6e22963..0000000000 --- a/app/src/main/java/org/mozilla/fenix/browser/BrowserToolbarDividerBehavior.kt +++ /dev/null @@ -1,42 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * 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/. */ - -package org.mozilla.fenix.browser - -import android.content.Context -import android.util.AttributeSet -import android.view.View -import androidx.coordinatorlayout.widget.CoordinatorLayout -import mozilla.components.browser.toolbar.BrowserToolbar - -/** - * [CoordinatorLayout.Behavior] that will always position the [View] above the [BrowserToolbar] (including - * when the browser toolbar is scrolling or performing a snap animation). - */ -@Suppress("unused") // Referenced from XML -class BrowserToolbarDividerBehavior( - context: Context, - attrs: AttributeSet -) : CoordinatorLayout.Behavior(context, attrs) { - override fun layoutDependsOn(parent: CoordinatorLayout, child: View, dependency: View): Boolean { - if (dependency is BrowserToolbar) { - return true - } - - return super.layoutDependsOn(parent, child, dependency) - } - - override fun onDependentViewChanged(parent: CoordinatorLayout, child: View, dependency: View): Boolean { - return if (dependency is BrowserToolbar) { - repositionView(child, dependency) - true - } else { - false - } - } - - private fun repositionView(view: View, toolbar: BrowserToolbar) { - view.translationY = (toolbar.translationY + toolbar.height * -1.0).toFloat() - } -} diff --git a/app/src/main/res/drawable/toolbar_background.xml b/app/src/main/res/drawable/toolbar_background.xml new file mode 100644 index 0000000000..f68e7f091a --- /dev/null +++ b/app/src/main/res/drawable/toolbar_background.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/fragment_browser.xml b/app/src/main/res/layout/fragment_browser.xml index 229c0785f2..e7d287eb95 100644 --- a/app/src/main/res/layout/fragment_browser.xml +++ b/app/src/main/res/layout/fragment_browser.xml @@ -26,15 +26,6 @@ app:behavior_peekHeight="12dp" app:layout_behavior="org.mozilla.fenix.quickactionsheet.QuickActionSheetBehavior"/> - -