1
0
Fork 0

Part of #131 - Add Background to URL View Toolbar

master
Emily Kager 2019-01-28 16:34:49 -08:00 committed by Colin Lee
parent 6c06651ecc
commit 2e15efafe0
5 changed files with 39 additions and 2 deletions

View File

@ -5,6 +5,8 @@
package org.mozilla.fenix.components.toolbar
import android.content.Context
import android.view.LayoutInflater
import androidx.core.content.ContextCompat
import androidx.core.view.ViewCompat
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleObserver
@ -16,6 +18,7 @@ import mozilla.components.browser.toolbar.BrowserToolbar
import mozilla.components.concept.storage.HistoryStorage
import mozilla.components.feature.toolbar.ToolbarAutocompleteFeature
import mozilla.components.feature.toolbar.ToolbarFeature
import mozilla.components.support.ktx.android.content.res.pxToDp
import org.mozilla.fenix.R
import org.mozilla.fenix.ext.application
import org.mozilla.fenix.ext.components
@ -30,6 +33,11 @@ class ToolbarIntegration(
init {
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(
context.resources.getDrawable(
R.drawable.ic_home,

View File

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

View File

@ -36,7 +36,7 @@
android:layout_width="match_parent"
android:layout_height="56dp"
android:layout_gravity="bottom"
android:background="@color/colorPrimary"
android:background="@color/offwhite"
android:clickable="true"
android:focusable="true"
android:focusableInTouchMode="true"

View File

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

View File

@ -13,7 +13,8 @@
<color name="searchStrokeAlternative">#0A202340</color>
<color name="searchText">#0C0C0D</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_fg">#665BFD</color>