Part of #131 - Add Background to URL View Toolbar
parent
6c06651ecc
commit
2e15efafe0
|
@ -5,6 +5,8 @@
|
||||||
package org.mozilla.fenix.components.toolbar
|
package org.mozilla.fenix.components.toolbar
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.core.view.ViewCompat
|
import androidx.core.view.ViewCompat
|
||||||
import androidx.lifecycle.Lifecycle
|
import androidx.lifecycle.Lifecycle
|
||||||
import androidx.lifecycle.LifecycleObserver
|
import androidx.lifecycle.LifecycleObserver
|
||||||
|
@ -16,6 +18,7 @@ import mozilla.components.browser.toolbar.BrowserToolbar
|
||||||
import mozilla.components.concept.storage.HistoryStorage
|
import mozilla.components.concept.storage.HistoryStorage
|
||||||
import mozilla.components.feature.toolbar.ToolbarAutocompleteFeature
|
import mozilla.components.feature.toolbar.ToolbarAutocompleteFeature
|
||||||
import mozilla.components.feature.toolbar.ToolbarFeature
|
import mozilla.components.feature.toolbar.ToolbarFeature
|
||||||
|
import mozilla.components.support.ktx.android.content.res.pxToDp
|
||||||
import org.mozilla.fenix.R
|
import org.mozilla.fenix.R
|
||||||
import org.mozilla.fenix.ext.application
|
import org.mozilla.fenix.ext.application
|
||||||
import org.mozilla.fenix.ext.components
|
import org.mozilla.fenix.ext.components
|
||||||
|
@ -30,6 +33,11 @@ class ToolbarIntegration(
|
||||||
init {
|
init {
|
||||||
toolbar.setMenuBuilder(context.components.toolbar.menuBuilder)
|
toolbar.setMenuBuilder(context.components.toolbar.menuBuilder)
|
||||||
|
|
||||||
|
toolbar.browserActionMargin = toolbar.resources.pxToDp(8)
|
||||||
|
toolbar.textColor = ContextCompat.getColor(context, R.color.searchText)
|
||||||
|
toolbar.urlBoxView = LayoutInflater.from(context).inflate(R.layout.layout_url_backround, null)
|
||||||
|
toolbar.urlBoxMargin = toolbar.resources.pxToDp(8)
|
||||||
|
|
||||||
val home = BrowserToolbar.Button(
|
val home = BrowserToolbar.Button(
|
||||||
context.resources.getDrawable(
|
context.resources.getDrawable(
|
||||||
R.drawable.ic_home,
|
R.drawable.ic_home,
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- 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/. -->
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<solid android:color="@color/url_box_view" />
|
||||||
|
|
||||||
|
<corners
|
||||||
|
android:bottomLeftRadius="8dp"
|
||||||
|
android:bottomRightRadius="8dp"
|
||||||
|
android:topLeftRadius="8dp"
|
||||||
|
android:topRightRadius="8dp" />
|
||||||
|
</shape>
|
|
@ -36,7 +36,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="56dp"
|
android:layout_height="56dp"
|
||||||
android:layout_gravity="bottom"
|
android:layout_gravity="bottom"
|
||||||
android:background="@color/colorPrimary"
|
android:background="@color/offwhite"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:focusable="true"
|
android:focusable="true"
|
||||||
android:focusableInTouchMode="true"
|
android:focusableInTouchMode="true"
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- 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/. -->
|
||||||
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:background="@drawable/url_background" />
|
||||||
|
</FrameLayout>
|
|
@ -13,7 +13,8 @@
|
||||||
<color name="searchStrokeAlternative">#0A202340</color>
|
<color name="searchStrokeAlternative">#0A202340</color>
|
||||||
<color name="searchText">#0C0C0D</color>
|
<color name="searchText">#0C0C0D</color>
|
||||||
<color name="offwhite">#f9f9fa</color>
|
<color name="offwhite">#f9f9fa</color>
|
||||||
<color name="icons">#0C0C0D</color>
|
<color name="url_box_view">#E9E9ED</color>
|
||||||
|
<color name="icons">#20233E</color>
|
||||||
|
|
||||||
<color name="session_list_empty_bg">#1A665BFD</color>
|
<color name="session_list_empty_bg">#1A665BFD</color>
|
||||||
<color name="session_list_empty_fg">#665BFD</color>
|
<color name="session_list_empty_fg">#665BFD</color>
|
||||||
|
|
Loading…
Reference in New Issue