1 <?xml version="1.0" encoding="utf-8"?>
2 <!-- This Source Code Form is subject to the terms of the Mozilla Public
3 - License, v. 2.0. If a copy of the MPL was not distributed with this
4 - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
6 <!-- using an AppBarLayout to replace MotionLayout was done in order to improve Fenix
7 start up performance. The use of a MotionLayout was worsening our layout measures, especially
8 with the recycler view -->
9 <androidx.coordinatorlayout.widget.CoordinatorLayout
10 xmlns:android="http://schemas.android.com/apk/res/android"
11 xmlns:app="http://schemas.android.com/apk/res-auto"
12 xmlns:tools="http://schemas.android.com/tools"
13 android:id="@+id/homeLayout"
14 android:layout_width="match_parent"
15 android:layout_height="match_parent"
16 android:background="?homeBackground">
18 <androidx.appcompat.widget.AppCompatImageView
19 android:id="@+id/wallpaperImageView"
20 android:layout_width="match_parent"
21 android:layout_height="match_parent"
22 android:visibility="gone"/>
24 <com.google.android.material.appbar.AppBarLayout
25 android:id="@+id/homeAppBar"
26 android:layout_width="match_parent"
27 android:layout_height="wrap_content"
28 android:background="@null"
30 android:fitsSystemWindows="false">
32 <com.google.android.material.appbar.CollapsingToolbarLayout
33 android:layout_width="match_parent"
34 android:layout_height="match_parent"
35 app:layout_scrollFlags="scroll">
38 android:id="@+id/privateBrowsingButton"
39 android:layout_width="@dimen/glyph_button_height"
40 android:layout_height="@dimen/glyph_button_height"
41 android:layout_marginTop="14dp"
42 android:layout_marginEnd="12dp"
43 android:layout_gravity="end"
44 android:background="?android:attr/selectableItemBackgroundBorderless"
45 android:contentDescription="@string/content_description_private_browsing_button"
46 app:srcCompat="@drawable/mozac_ic_private_mode_circle_fill_48"
47 app:layout_collapseMode="parallax"
48 app:layout_collapseParallaxMultiplier=".167"/>
49 <!-- This value needs to be 1.67 * the wordmark parallax value as its 24dp vs 40 -->
52 android:id="@+id/wordmark"
53 android:layout_width="wrap_content"
54 android:layout_height="40dp"
55 android:layout_marginStart="16dp"
56 android:layout_marginTop="18dp"
57 android:layout_marginBottom="32dp"
58 android:clickable="false"
59 android:focusable="false"
60 android:importantForAccessibility="no"
61 android:orientation="horizontal"
62 app:layout_collapseMode="parallax"
63 app:layout_collapseParallaxMultiplier=".1">
66 android:id="@+id/wordmarkLogo"
67 android:layout_width="wrap_content"
68 android:layout_height="match_parent"
69 android:layout_marginEnd="10.dp"
70 android:adjustViewBounds="true"
71 android:contentDescription="@null"
72 app:srcCompat="?fenixWordmarkLogo"
73 tools:ignore="ImageContrastCheck" />
76 android:id="@+id/wordmarkText"
77 android:layout_width="wrap_content"
78 android:layout_height="@dimen/wordmark_text_height"
79 android:adjustViewBounds="true"
80 android:contentDescription="@null"
81 android:layout_marginTop="@dimen/wordmark_text_margin_top"
82 app:srcCompat="?fenixWordmarkText" />
85 </com.google.android.material.appbar.CollapsingToolbarLayout>
87 </com.google.android.material.appbar.AppBarLayout>
89 <androidx.recyclerview.widget.RecyclerView
90 android:id="@+id/sessionControlRecyclerView"
91 android:layout_width="match_parent"
92 android:layout_height="wrap_content"
93 android:clipChildren="false"
94 android:clipToPadding="false"
95 android:paddingVertical="16dp"
96 android:scrollbars="none"
97 android:transitionGroup="false"
98 android:importantForAccessibility="yes"
99 android:overScrollMode="never"
100 tools:listitem="@layout/collection_home_list_row"
102 app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"/>
104 <androidx.constraintlayout.widget.ConstraintLayout
105 android:id="@+id/toolbarLayout"
106 android:elevation="5dp"
107 android:layout_width="match_parent"
108 android:layout_height="wrap_content"
109 android:layout_gravity="bottom"
110 tools:context=".home.HomeFragment">
113 android:id="@+id/bottom_bar"
114 android:layout_width="0dp"
115 android:layout_height="56dp"
116 android:background="?bottomBarBackground"
117 android:foregroundGravity="bottom"
118 app:layout_constraintBottom_toBottomOf="parent"
119 app:layout_constraintEnd_toEndOf="parent"
120 app:layout_constraintStart_toStartOf="parent" />
123 android:id="@+id/toolbar_wrapper"
124 android:layout_width="0dp"
125 android:layout_height="40dp"
126 android:layout_marginStart="8dp"
127 android:layout_marginEnd="0dp"
128 android:background="@drawable/home_search_background"
129 android:clickable="true"
130 android:contentDescription="@string/search_hint"
131 android:focusable="true"
132 app:layout_constraintBottom_toBottomOf="@id/bottom_bar"
133 app:layout_constraintEnd_toStartOf="@+id/accessory_button_barrier"
134 app:layout_constraintStart_toStartOf="parent"
135 app:layout_constraintTop_toTopOf="@id/bottom_bar">
137 <org.mozilla.fenix.search.toolbar.SearchSelector
138 android:id="@+id/search_selector_button"
139 android:layout_width="wrap_content"
140 android:layout_height="wrap_content"
141 android:layout_gravity="start|center_vertical"
142 android:background="?selectableItemBackgroundBorderless" />
145 android:id="@+id/toolbar"
146 android:layout_width="wrap_content"
147 android:layout_height="wrap_content"
148 android:layout_gravity="start|center_vertical"
149 android:clickable="false"
150 android:ellipsize="end"
151 android:focusable="false"
152 android:importantForAccessibility="no"
154 android:text="@string/search_hint"
155 android:textColor="?attr/textPrimary"
156 android:textSize="15sp" />
159 <androidx.constraintlayout.widget.Barrier
160 android:id="@+id/accessory_button_barrier"
161 android:layout_width="wrap_content"
162 android:layout_height="wrap_content"
163 app:barrierDirection="start"
164 app:constraint_referenced_ids="tab_button" />
166 <mozilla.components.ui.tabcounter.TabCounter
167 android:id="@+id/tab_button"
168 android:layout_width="48dp"
169 android:layout_height="48dp"
170 android:clipChildren="false"
171 app:layout_constraintTop_toTopOf="@id/bottom_bar"
172 app:layout_constraintBottom_toBottomOf="@id/bottom_bar"
173 app:layout_constraintEnd_toStartOf="@+id/menuButton"
174 app:layout_constraintStart_toEndOf="@id/toolbar_wrapper"/>
176 <mozilla.components.browser.menu.view.MenuButton
177 android:id="@+id/menuButton"
178 android:layout_width="36dp"
179 android:layout_height="48dp"
180 app:layout_constraintEnd_toEndOf="parent"
181 app:layout_constraintTop_toTopOf="@id/bottom_bar"
182 app:layout_constraintBottom_toBottomOf="@id/bottom_bar"/>
185 android:id="@+id/bottomBarShadow"
186 android:layout_width="0dp"
187 android:layout_height="1dp"
188 android:background="@color/bottom_bar_shadow"
189 app:layout_constraintEnd_toEndOf="parent"
190 app:layout_constraintStart_toStartOf="parent"
191 app:layout_constraintBottom_toTopOf="@id/bottom_bar" />
193 </androidx.constraintlayout.widget.ConstraintLayout>
195 </androidx.coordinatorlayout.widget.CoordinatorLayout>