Update Search Bar layout in Homepage
Bug: 340513864 Bug: 340773713 Bug: 340799397 Bug: 340759836 Test: visual Change-Id: I4bd5c3438aa55ca764f61b180a37c10206ee78be
This commit is contained in:
@@ -17,28 +17,34 @@
|
||||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
style="@style/SearchBarStyle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1">
|
||||
<Toolbar
|
||||
android:id="@+id/search_action_bar_unified"
|
||||
style="@style/SearchBarStyle_v2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/search_action_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/search_bar_height"
|
||||
android:paddingStart="8dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="72dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="24dp"
|
||||
android:paddingEnd="24dp"
|
||||
android:background="@drawable/search_bar_selected_background"
|
||||
android:touchscreenBlocksFocus="false"
|
||||
android:nextFocusForward="@+id/homepage_container"
|
||||
android:contentInsetStartWithNavigation="@dimen/search_bar_content_inset"
|
||||
android:navigationIcon="@drawable/ic_homepage_search">
|
||||
android:background="@drawable/search_bar_selected_background">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:importantForAccessibility="no"
|
||||
android:src="@drawable/ic_homepage_search" />
|
||||
<TextView
|
||||
android:id="@+id/search_bar_title"
|
||||
style="@style/TextAppearance.SearchBar"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="8dp"
|
||||
android:layout_gravity="start"
|
||||
android:paddingEnd="8dp"
|
||||
android:text="@string/search_settings"/>
|
||||
</Toolbar>
|
||||
</LinearLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
@@ -1,29 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2024 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/app_bar_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="16dp"
|
||||
android:padding="6dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<include layout="@layout/search_bar_unified_version"/>
|
||||
|
||||
</LinearLayout>
|
@@ -62,19 +62,21 @@
|
||||
android:id="@+id/app_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:elevation="0dp"
|
||||
android:touchscreenBlocksFocus="false"
|
||||
android:keyboardNavigationCluster="false">
|
||||
<LinearLayout
|
||||
android:id="@+id/app_bar_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:minHeight="76dp"
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed">
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="24dp"
|
||||
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
|
||||
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd">
|
||||
|
||||
<include layout="@layout/search_bar_unified_version"/>
|
||||
|
||||
<include
|
||||
android:id="@+id/homepage_app_bar_unified_view"
|
||||
layout="@layout/settings_homepage_app_bar_unified_layout"/>
|
||||
</LinearLayout>
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||
|
@@ -459,6 +459,13 @@
|
||||
<item name="cardElevation">0dp</item>
|
||||
</style>
|
||||
|
||||
<style name="SearchBarStyle_v2">
|
||||
<item name="cardCornerRadius">40dp</item>
|
||||
<item name="cardElevation">0dp</item>
|
||||
<item name="strokeWidth">1dp</item>
|
||||
<item name="strokeColor">@color/settingslib_materialColorOutlineVariant</item>
|
||||
</style>
|
||||
|
||||
<style name="ConditionCardBorderlessButton"
|
||||
parent="android:Widget.DeviceDefault.Button.Borderless">
|
||||
<item name="android:textColor">?android:attr/colorAccent</item>
|
||||
|
@@ -185,6 +185,7 @@
|
||||
<style name="Theme.Settings.HomeBase" parent="Theme.Settings.NoActionBar">
|
||||
<item name="colorPrimary">@*android:color/primary_device_default_settings_light</item>
|
||||
<item name="colorAccent">@*android:color/accent_device_default_light</item>
|
||||
<item name="android:listPreferredItemPaddingStart">16dp</item>
|
||||
<item name="preferenceTheme">@style/SettingsPreferenceTheme</item>
|
||||
|
||||
<!-- action bar, needed for search bar icon tinting -->
|
||||
|
Reference in New Issue
Block a user