Change search fab to search bar.

- Remove search fab from layout xml
- Change RelativeLayout to CoordinatorLayout so we can use prebuilt
  scrolling behavior
- Minor update to theme so search bar background works in dark mode for
  the homepage activity.

Change-Id: If7408c12684be65137e04ae3bb4137204c2d77e0
Fixes: 117508596
Test: robotests, visual
This commit is contained in:
Fan Zhang
2018-10-10 15:25:47 -07:00
parent a4c42eb024
commit 3181e1aceb
8 changed files with 53 additions and 39 deletions

View File

@@ -19,4 +19,4 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/card_container"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
android:layout_height="match_parent" />

View File

@@ -15,11 +15,34 @@
limitations under the License.
-->
<RelativeLayout
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:orientation="vertical">
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/homepage_appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:elevation="0dp">
<include layout="@layout/search_bar"/>
</com.google.android.material.appbar.AppBarLayout>
<FrameLayout
android:id="@id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/bottom_nav"
@@ -28,25 +51,8 @@
android:layout_marginEnd="0dp"
android:layout_marginStart="0dp"
android:background="?android:attr/windowBackground"
android:layout_alignParentBottom="true"
app:itemIconTint="@color/bottom_navigation_colors"
app:itemTextColor="@color/bottom_navigation_colors"
app:menu="@menu/home_bottom_navigation" />
app:menu="@menu/home_bottom_navigation"/>
<FrameLayout
android:id="@id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/bottom_nav" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/search_fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_search_24dp"
android:layout_margin="24dp"
android:layout_above="@id/bottom_nav"
android:layout_alignParentRight="true"
app:backgroundTint="?android:attr/colorAccent"
app:tint="@android:color/white" />
</RelativeLayout>
</LinearLayout>