For #150 - Adds the search bar

nightly-build-test
Jeff Boek 5 years ago committed by Colin Lee
parent c0e71bf719
commit 3378ee4209

@ -67,6 +67,11 @@ dependencies {
implementation Deps.kotlin_stdlib
implementation Deps.androidx_appcompat
implementation Deps.androidx_constraintlayout
implementation Deps.mozilla_browser_awesomebar
implementation Deps.mozilla_browser_toolbar
testImplementation Deps.junit
androidTestImplementation Deps.tools_test_runner
androidTestImplementation Deps.tools_espresso_core

@ -9,7 +9,6 @@ import androidx.appcompat.app.AppCompatActivity
import org.mozilla.fenix.home.HomeFragment
class HomeActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_home)
@ -18,6 +17,5 @@ class HomeActivity : AppCompatActivity() {
replace(R.id.container, HomeFragment.create())
commit()
}
}
}

@ -9,6 +9,7 @@ import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import kotlinx.android.synthetic.main.fragment_home.*
import org.mozilla.fenix.R
@ -20,6 +21,11 @@ class HomeFragment : Fragment() {
return inflater.inflate(R.layout.fragment_home, container, false)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
toolbar_wrapper.clipToOutline = false
}
companion object {
fun create() = HomeFragment()

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#FFFFFF"/>
<stroke android:width="1dp"
android:color="@color/searchStroke"/>
<padding android:left="2dp"
android:top="2dp"
android:right="2dp"
android:bottom="2dp"/>
<corners android:bottomRightRadius="8dp"
android:bottomLeftRadius="8dp"
android:topLeftRadius="8dp"
android:topRightRadius="8dp"/>
</shape>

@ -2,11 +2,14 @@
<!-- 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/. -->
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".home.HomeFragment">
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".home.HomeFragment"
android:clipToPadding="false">
<ImageButton
@ -28,7 +31,7 @@
app:layout_constraintTop_toTopOf="@id/menuButton" />
<ImageView
android:id="@+id/imageView"
android:id="@+id/wordmark"
android:src="@drawable/ic_logo_wordmark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -37,4 +40,28 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/menuButton" />
<FrameLayout
android:id="@+id/toolbar_wrapper"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="64dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:background="@drawable/home_search_background"
app:layout_constraintTop_toBottomOf="@id/wordmark"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:outlineProvider="paddedBounds"
android:clipToPadding="false"
android:elevation="5dp">
<mozilla.components.browser.toolbar.BrowserToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_margin="8dp"
android:background="@android:color/white" />
</FrameLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

@ -3,4 +3,6 @@
<color name="colorPrimary">#008577</color>
<color name="colorPrimaryDark">#00574B</color>
<color name="colorAccent">#D81B60</color>
<color name="searchStroke">#331b215e</color>
</resources>

@ -10,6 +10,8 @@ private object Versions {
const val androidx_appcompat = "1.0.2"
const val androidx_constraint_layout = "1.1.3"
const val mozilla_android_components = "0.37.0"
const val junit = "4.12"
const val test_tools = "1.0.2"
const val espresso_core = "2.2.2"
@ -27,6 +29,9 @@ object Deps {
const val androidx_appcompat = "androidx.appcompat:appcompat:${Versions.androidx_appcompat}"
const val androidx_constraintlayout = "androidx.constraintlayout:constraintlayout:${Versions.androidx_constraint_layout}"
const val mozilla_browser_awesomebar = "org.mozilla.components:browser-awesomebar:${Versions.mozilla_android_components}"
const val mozilla_browser_toolbar = "org.mozilla.components:browser-toolbar:${Versions.mozilla_android_components}"
const val junit = "junit:junit:${Versions.junit}"
const val tools_test_runner = "com.android.support.test:runner:${Versions.test_tools}"
const val tools_espresso_core = "com.android.support.test.espresso:espresso-core:${Versions.espresso_core}"

Loading…
Cancel
Save