|
17 | 17 |
|
18 | 18 | <com.google.android.material.card.MaterialCardView |
19 | 19 | xmlns:android="http://schemas.android.com/apk/res/android" |
| 20 | + xmlns:app="http://schemas.android.com/apk/res-auto" |
20 | 21 | style="@style/SearchBarStyle_v2" |
21 | 22 | android:layout_width="match_parent" |
22 | 23 | android:layout_height="wrap_content"> |
23 | 24 |
|
24 | | - <LinearLayout |
25 | | - android:id="@+id/search_action_bar" |
26 | | - android:layout_width="match_parent" |
| 25 | +<androidx.constraintlayout.widget.ConstraintLayout |
| 26 | + android:id="@+id/search_action_bar" |
| 27 | + android:layout_width="match_parent" |
| 28 | + android:layout_height="wrap_content" |
| 29 | + android:minHeight="72dp" |
| 30 | + android:paddingStart="24dp" |
| 31 | + android:paddingEnd="24dp" |
| 32 | + android:gravity="center_vertical" |
| 33 | + android:focusedByDefault="true" |
| 34 | + android:background="@drawable/search_bar_selected_background_v2"> |
| 35 | + |
| 36 | + <!-- Search Icon --> |
| 37 | + <ImageView |
| 38 | + android:id="@+id/imageView" |
| 39 | + android:layout_width="wrap_content" |
| 40 | + android:layout_height="wrap_content" |
| 41 | + android:src="@drawable/ic_homepage_search" |
| 42 | + android:tint="@color/top_level_preference_text_color_primary" |
| 43 | + android:importantForAccessibility="no" |
| 44 | + app:layout_constraintStart_toStartOf="parent" |
| 45 | + app:layout_constraintTop_toTopOf="parent" |
| 46 | + app:layout_constraintBottom_toBottomOf="parent"/> |
| 47 | + |
| 48 | + <!-- Search Text --> |
| 49 | + <TextView |
| 50 | + android:id="@+id/search_bar_title" |
| 51 | + style="@style/TextAppearance.SearchBar" |
| 52 | + android:layout_width="wrap_content" |
27 | 53 | android:layout_height="wrap_content" |
28 | | - android:minHeight="72dp" |
29 | | - android:gravity="center_vertical" |
30 | | - android:orientation="horizontal" |
31 | | - android:paddingStart="24dp" |
32 | | - android:paddingEnd="24dp" |
33 | | - android:focusedByDefault="true" |
34 | | - android:background="@drawable/search_bar_selected_background_v2"> |
35 | | - |
36 | | - <ImageView |
37 | | - android:id="@+id/imageView" |
38 | | - android:layout_width="wrap_content" |
39 | | - android:layout_height="wrap_content" |
40 | | - android:importantForAccessibility="no" |
41 | | - android:src="@drawable/ic_homepage_search" |
42 | | - android:tint="@color/top_level_preference_text_color_primary" /> |
43 | | - <TextView |
44 | | - android:id="@+id/search_bar_title" |
45 | | - style="@style/TextAppearance.SearchBar" |
46 | | - android:layout_width="wrap_content" |
47 | | - android:layout_height="wrap_content" |
48 | | - android:layout_marginStart="8dp" |
49 | | - android:paddingEnd="8dp" |
50 | | - android:text="@string/search_settings" |
51 | | - android:textColor="@color/top_level_preference_text_color_primary"/> |
52 | | - </LinearLayout> |
| 54 | + android:layout_marginStart="8dp" |
| 55 | + android:paddingEnd="8dp" |
| 56 | + android:text="@string/search_settings" |
| 57 | + android:textColor="@color/top_level_preference_text_color_primary" |
| 58 | + app:layout_constraintStart_toEndOf="@id/imageView" |
| 59 | + app:layout_constraintTop_toTopOf="parent" |
| 60 | + app:layout_constraintBottom_toBottomOf="parent" |
| 61 | + app:layout_constraintEnd_toStartOf="@id/account_avatar"/> |
| 62 | + |
| 63 | + <!-- Avatar aligned to end --> |
| 64 | + <ImageView |
| 65 | + android:id="@+id/account_avatar" |
| 66 | + android:layout_width="@dimen/custom_avatar_length" |
| 67 | + android:layout_height="@dimen/custom_avatar_length" |
| 68 | + android:layout_marginStart="8dp" |
| 69 | + android:layout_marginEnd="-16dp" |
| 70 | + android:visibility="invisible" |
| 71 | + android:contentDescription="@string/search_bar_account_avatar_content_description" |
| 72 | + app:layout_constraintEnd_toEndOf="parent" |
| 73 | + app:layout_constraintTop_toTopOf="parent" |
| 74 | + app:layout_constraintBottom_toBottomOf="parent"/> |
| 75 | + |
| 76 | +</androidx.constraintlayout.widget.ConstraintLayout> |
53 | 77 | </com.google.android.material.card.MaterialCardView> |
0 commit comments