|
| 1 | +<?xml version="1.0" encoding="utf-8"?> |
| 2 | +<!-- |
| 3 | + Copyright 2025 The Android Open Source Project |
| 4 | +
|
| 5 | + Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | + you may not use this file except in compliance with the License. |
| 7 | + You may obtain a copy of the License at |
| 8 | +
|
| 9 | + https://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +
|
| 11 | + Unless required by applicable law or agreed to in writing, software |
| 12 | + distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | + See the License for the specific language governing permissions and |
| 15 | + limitations under the License. |
| 16 | + --> |
| 17 | +<androidx.coordinatorlayout.widget.CoordinatorLayout |
| 18 | + xmlns:android="http://schemas.android.com/apk/res/android" |
| 19 | + xmlns:app="http://schemas.android.com/apk/res-auto" |
| 20 | + android:layout_width="match_parent" |
| 21 | + android:layout_height="match_parent" |
| 22 | + android:fitsSystemWindows="true"> |
| 23 | + |
| 24 | + <com.google.android.material.appbar.AppBarLayout |
| 25 | + android:id="@+id/app_bar_layout" |
| 26 | + android:layout_width="match_parent" |
| 27 | + android:layout_height="wrap_content" |
| 28 | + android:fitsSystemWindows="true" |
| 29 | + app:statusBarForeground="?attr/colorSurface"> |
| 30 | + |
| 31 | + <LinearLayout |
| 32 | + android:layout_width="match_parent" |
| 33 | + android:layout_height="wrap_content" |
| 34 | + android:layout_gravity="center_vertical"> |
| 35 | + <ImageView |
| 36 | + android:id="@+id/product_logo" |
| 37 | + android:layout_width="48dp" |
| 38 | + android:layout_height="48dp" |
| 39 | + android:scaleType="center" |
| 40 | + android:layout_marginStart="4dp" |
| 41 | + android:layout_marginEnd="8dp" |
| 42 | + android:contentDescription="@string/cat_searchbar_home_icon_description" |
| 43 | + android:layout_gravity="center_vertical" |
| 44 | + android:src="@drawable/ic_home_default_24px"/> |
| 45 | + <com.google.android.material.search.SearchBar |
| 46 | + android:id="@+id/cat_search_bar" |
| 47 | + android:layout_width="0dp" |
| 48 | + android:layout_height="wrap_content" |
| 49 | + android:layout_weight="1" |
| 50 | + android:layout_marginVertical="4dp" |
| 51 | + android:layout_gravity="center_vertical" |
| 52 | + app:defaultMarginsEnabled="false" |
| 53 | + android:hint="@string/cat_searchbar_hint"/> |
| 54 | + <ImageView |
| 55 | + android:layout_width="48dp" |
| 56 | + android:layout_height="48dp" |
| 57 | + android:scaleType="center" |
| 58 | + android:layout_marginStart="8dp" |
| 59 | + android:layout_marginEnd="4dp" |
| 60 | + android:contentDescription="@string/cat_searchbar_cast_icon_description" |
| 61 | + android:layout_gravity="center_vertical" |
| 62 | + android:src="@drawable/ic_cast_vd_theme_24" /> |
| 63 | + </LinearLayout> |
| 64 | + |
| 65 | + </com.google.android.material.appbar.AppBarLayout> |
| 66 | + |
| 67 | + <androidx.core.widget.NestedScrollView |
| 68 | + android:id="@+id/nested_scroll_view" |
| 69 | + android:layout_width="match_parent" |
| 70 | + android:layout_height="match_parent" |
| 71 | + app:layout_behavior="@string/appbar_scrolling_view_behavior"> |
| 72 | + |
| 73 | + <TextView |
| 74 | + android:layout_width="match_parent" |
| 75 | + android:layout_height="wrap_content" |
| 76 | + android:layout_margin="16dp" |
| 77 | + android:lineSpacingMultiplier="1.2" |
| 78 | + android:text="@string/cat_searchbar_lorem_ipsum"/> |
| 79 | + </androidx.core.widget.NestedScrollView> |
| 80 | + |
| 81 | + <com.google.android.material.search.SearchView |
| 82 | + android:id="@+id/cat_search_view" |
| 83 | + android:layout_width="match_parent" |
| 84 | + android:layout_height="match_parent" |
| 85 | + android:hint="@string/cat_searchbar_hint" |
| 86 | + app:layout_anchor="@id/cat_search_bar"> |
| 87 | + |
| 88 | + <!-- Content goes here (ScrollView, RecyclerView, etc.). --> |
| 89 | + <ScrollView |
| 90 | + android:layout_width="match_parent" |
| 91 | + android:layout_height="match_parent" |
| 92 | + android:scrollbars="none"> |
| 93 | + |
| 94 | + <LinearLayout |
| 95 | + android:id="@+id/cat_search_view_suggestion_container" |
| 96 | + android:layout_width="match_parent" |
| 97 | + android:layout_height="wrap_content" |
| 98 | + android:orientation="vertical"/> |
| 99 | + </ScrollView> |
| 100 | + </com.google.android.material.search.SearchView> |
| 101 | +</androidx.coordinatorlayout.widget.CoordinatorLayout> |
0 commit comments