1 <?xml version="1.0" encoding="utf-8"?><!--
2 ~ Copyright © 2020 Damyan Ivanov.
3 ~ This file is part of MoLe.
4 ~ MoLe is free software: you can distribute it and/or modify it
5 ~ under the term of the GNU General Public License as published by
6 ~ the Free Software Foundation, either version 3 of the License, or
7 ~ (at your opinion), any later version.
9 ~ MoLe is distributed in the hope that it will be useful,
10 ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ~ GNU General Public License terms for details.
14 ~ You should have received a copy of the GNU General Public License
15 ~ along with MoLe. If not, see <https://www.gnu.org/licenses/>.
17 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
18 xmlns:tools="http://schemas.android.com/tools"
19 android:layout_width="match_parent"
20 android:layout_height="match_parent"
21 tools:context=".ui.activity.MainActivity"
24 <androidx.constraintlayout.widget.ConstraintLayout xmlns:app="http://schemas.android.com/apk/res-auto"
25 android:id="@+id/no_profiles_layout"
26 android:layout_width="match_parent"
27 android:layout_height="match_parent"
28 android:background="?table_row_dark_bg"
29 android:visibility="gone"
33 android:id="@+id/welcome_header"
34 android:layout_width="match_parent"
35 android:layout_height="wrap_content"
36 app:layout_constraintEnd_toEndOf="parent"
37 app:layout_constraintStart_toStartOf="parent"
38 app:layout_constraintTop_toTopOf="parent"
41 <include layout="@layout/nav_header_layout" />
44 <androidx.constraintlayout.widget.ConstraintLayout
45 android:layout_width="0dp"
46 android:layout_height="0dp"
47 android:padding="@dimen/activity_horizontal_margin"
48 app:layout_constraintBottom_toBottomOf="parent"
49 app:layout_constraintEnd_toEndOf="parent"
50 app:layout_constraintStart_toStartOf="parent"
51 app:layout_constraintTop_toBottomOf="@id/welcome_header"
55 android:id="@+id/textView"
56 android:layout_width="wrap_content"
57 android:layout_height="wrap_content"
58 android:layout_marginTop="48dp"
59 android:text="@string/text_welcome"
60 android:textColor="?textColor"
61 android:textSize="48sp"
62 app:layout_constraintEnd_toEndOf="parent"
63 app:layout_constraintStart_toStartOf="parent"
64 app:layout_constraintTop_toTopOf="parent"
68 android:id="@+id/textView3"
69 android:layout_width="wrap_content"
70 android:layout_height="wrap_content"
71 android:layout_marginStart="8dp"
72 android:layout_marginTop="24dp"
73 android:layout_marginEnd="8dp"
74 android:text="@string/text_welcome_profile_needed"
75 android:textColor="?textColor"
76 android:textSize="20sp"
77 app:layout_constraintEnd_toEndOf="parent"
78 app:layout_constraintStart_toStartOf="parent"
79 app:layout_constraintTop_toBottomOf="@+id/textView"
83 android:id="@+id/btn_no_profiles_add"
84 android:layout_width="wrap_content"
85 android:layout_height="wrap_content"
86 android:layout_marginStart="8dp"
87 android:layout_marginTop="24dp"
88 android:layout_marginEnd="8dp"
89 android:layout_marginBottom="8dp"
90 android:backgroundTint="?colorSecondary"
91 android:drawablePadding="16dp"
92 android:text="@string/create_profile_label"
93 android:textColor="@color/design_default_color_on_primary"
94 app:layout_constraintBottom_toBottomOf="parent"
95 app:layout_constraintEnd_toEndOf="parent"
96 app:layout_constraintStart_toStartOf="parent"
97 app:layout_constraintTop_toBottomOf="@+id/textView3"
99 </androidx.constraintlayout.widget.ConstraintLayout>
100 </androidx.constraintlayout.widget.ConstraintLayout>
102 <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:app="http://schemas.android.com/apk/res-auto"
103 xmlns:tools="http://schemas.android.com/tools"
104 android:id="@+id/main_app_layout"
105 android:layout_width="match_parent"
106 android:layout_height="match_parent"
107 android:background="?android:attr/colorBackground"
108 android:orientation="vertical"
109 android:visibility="gone"
112 <com.google.android.material.floatingactionbutton.FloatingActionButton
113 android:id="@+id/btn_add_transaction"
114 android:layout_width="wrap_content"
115 android:layout_height="wrap_content"
116 android:layout_gravity="bottom|end"
117 android:layout_margin="@dimen/fab_margin"
118 android:contentDescription="@string/new_transaction_fab_description"
119 app:backgroundTint="?colorSecondary"
120 app:layout_constraintBottom_toBottomOf="parent"
121 app:layout_constraintEnd_toEndOf="parent"
122 app:maxImageSize="36dp"
123 app:srcCompat="@drawable/ic_add_white_24dp"
126 <androidx.drawerlayout.widget.DrawerLayout
127 android:id="@+id/drawer_layout"
128 android:layout_width="match_parent"
129 android:layout_height="match_parent"
130 tools:openDrawer="start"
133 <androidx.constraintlayout.widget.ConstraintLayout
134 android:id="@+id/pager_layout"
135 android:layout_width="match_parent"
136 android:layout_height="match_parent"
139 <androidx.appcompat.widget.Toolbar
140 android:id="@+id/toolbar"
141 android:layout_width="match_parent"
142 android:layout_height="@dimen/toolbar_height"
143 android:background="?colorPrimary"
144 android:theme="@style/AppTheme.AppBarOverlay"
145 app:layout_constraintEnd_toEndOf="parent"
146 app:layout_constraintStart_toStartOf="parent"
147 app:layout_constraintTop_toTopOf="parent"
148 app:popupTheme="@style/AppTheme.PopupOverlay"
152 android:id="@+id/main_header"
153 android:layout_width="match_parent"
154 android:layout_height="wrap_content"
155 android:orientation="vertical"
156 app:layout_constraintEnd_toEndOf="parent"
157 app:layout_constraintStart_toStartOf="parent"
158 app:layout_constraintTop_toBottomOf="@id/toolbar"
162 android:id="@+id/transaction_progress_layout"
163 android:layout_width="match_parent"
164 android:layout_height="wrap_content"
165 android:gravity="center_vertical"
166 android:orientation="horizontal"
167 android:visibility="gone"
171 android:id="@+id/transaction_list_progress_bar"
172 style="?android:attr/progressBarStyleHorizontal"
173 android:layout_width="0dp"
174 android:layout_height="wrap_content"
175 android:layout_marginTop="-8dp"
176 android:layout_marginBottom="-7dp"
177 android:layout_weight="1"
178 android:indeterminate="true"
180 android:padding="0dp"
181 android:progressTint="?colorPrimary"
182 app:layout_constraintEnd_toEndOf="parent"
183 app:layout_constraintStart_toStartOf="parent"
187 android:id="@+id/transaction_list_cancel_download"
188 android:layout_width="wrap_content"
189 android:layout_height="wrap_content"
190 android:background="@drawable/ic_clear_accent_24dp"
191 android:clickable="true"
192 android:focusable="true"
198 <androidx.viewpager2.widget.ViewPager2
199 android:id="@+id/main_pager"
200 android:layout_width="match_parent"
201 android:layout_height="0dp"
202 app:layout_constraintBottom_toBottomOf="parent"
203 app:layout_constraintEnd_toEndOf="parent"
204 app:layout_constraintStart_toStartOf="parent"
205 app:layout_constraintTop_toBottomOf="@+id/main_header"
208 </androidx.viewpager2.widget.ViewPager2>
211 android:layout_width="0dp"
212 android:layout_height="?attr/main_header_shadow_height"
213 android:background="@drawable/drop_shadow"
214 app:layout_constraintEnd_toEndOf="parent"
215 app:layout_constraintStart_toStartOf="parent"
216 app:layout_constraintTop_toBottomOf="@id/main_header"
220 </androidx.constraintlayout.widget.ConstraintLayout>
222 <com.google.android.material.navigation.NavigationView xmlns:android="http://schemas.android.com/apk/res/android"
223 xmlns:app="http://schemas.android.com/apk/res-auto"
224 android:id="@+id/nav_view"
225 android:layout_width="wrap_content"
226 android:layout_height="match_parent"
227 android:layout_gravity="start"
228 android:fitsSystemWindows="true"
232 <androidx.constraintlayout.widget.ConstraintLayout
233 android:layout_width="match_parent"
234 android:layout_height="match_parent"
235 android:layout_marginBottom="0dp"
236 android:animateLayoutChanges="true"
237 android:orientation="vertical"
241 android:id="@+id/nav_fixed_items"
242 android:layout_width="match_parent"
243 android:layout_height="wrap_content"
244 android:divider="@drawable/list_divider"
245 android:elevation="2dp"
246 android:orientation="vertical"
247 android:showDividers="beginning"
248 android:visibility="gone"
249 app:layout_constraintBottom_toBottomOf="parent"
253 android:id="@+id/textView2"
254 style="@style/nav_button"
255 android:layout_weight="1"
256 android:text="@string/action_settings"
257 app:drawableStartCompat="@drawable/ic_settings_black_24dp"
263 android:layout_width="0dp"
264 android:layout_height="0dp"
265 app:layout_constraintBottom_toTopOf="@+id/nav_fixed_items"
266 app:layout_constraintEnd_toEndOf="parent"
267 app:layout_constraintLeft_toLeftOf="parent"
268 app:layout_constraintStart_toStartOf="parent"
269 app:layout_constraintTop_toTopOf="parent"
273 android:id="@+id/nav_upper"
274 android:layout_width="match_parent"
275 android:layout_height="wrap_content"
276 android:animateLayoutChanges="true"
277 android:orientation="vertical"
278 android:showDividers="beginning"
279 app:layout_constraintBottom_toTopOf="@+id/nav_fixed_items"
280 app:layout_constraintTop_toBottomOf="@+id/nav_header"
283 <include layout="@layout/nav_header_layout" />
286 android:id="@+id/nav_actions"
287 android:layout_width="match_parent"
288 android:layout_height="match_parent"
289 android:orientation="vertical"
293 android:id="@+id/nav_account_summary"
294 style="@style/nav_button"
295 android:onClick="onAccountSummaryClicked"
296 android:text="@string/account_summary_title"
297 app:drawableStartCompat="@drawable/ic_home_black_24dp"
301 android:id="@+id/nav_latest_transactions"
302 style="@style/nav_button"
303 android:onClick="onLatestTransactionsClicked"
304 android:text="@string/nav_transactions_title"
305 app:drawableStartCompat="@drawable/ic_event_note_black_24dp"
309 android:id="@+id/textView5"
310 style="@style/nav_button"
311 android:text="@string/nav_reports_title"
312 android:visibility="gone"
313 app:drawableStartCompat="@drawable/ic_assignment_black_24dp"
316 <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
317 android:id="@+id/nav_profile_list_head_layout"
318 android:layout_width="match_parent"
319 android:layout_height="@dimen/thumb_row_height"
323 android:id="@+id/nav_new_profile_button"
324 android:layout_width="wrap_content"
325 android:layout_height="wrap_content"
326 android:layout_gravity="center"
327 android:contentDescription="@string/icon"
328 android:paddingStart="8dp"
329 android:paddingEnd="8dp"
330 android:visibility="gone"
331 app:layout_constraintBottom_toBottomOf="parent"
332 app:layout_constraintEnd_toStartOf="@id/nav_profile_list_head_buttons"
333 app:layout_constraintStart_toEndOf="@id/nav_profiles_label"
334 app:layout_constraintTop_toTopOf="parent"
335 app:srcCompat="@drawable/ic_add_circle_white_24dp"
339 android:id="@+id/nav_profile_list_head_buttons"
340 android:layout_width="wrap_content"
341 android:layout_height="0dp"
342 android:gravity="center_vertical"
343 android:orientation="horizontal"
344 android:paddingStart="16dp"
345 android:paddingEnd="16dp"
346 app:layout_constraintBottom_toBottomOf="parent"
347 app:layout_constraintEnd_toEndOf="parent"
348 app:layout_constraintTop_toTopOf="parent"
352 android:id="@+id/nav_profiles_cancel_edit"
353 android:layout_width="wrap_content"
354 android:layout_height="wrap_content"
355 android:background="@drawable/ic_clear_accent_24dp"
356 android:contentDescription="@string/icon"
357 android:gravity="end|center_vertical"
358 android:paddingStart="8dp"
359 android:paddingEnd="8dp"
360 android:visibility="gone"
361 app:layout_constraintBottom_toBottomOf="parent"
362 app:layout_constraintEnd_toEndOf="parent"
363 app:layout_constraintTop_toTopOf="parent"
367 android:id="@+id/nav_profiles_start_edit"
368 android:layout_width="wrap_content"
369 android:layout_height="wrap_content"
370 android:background="@drawable/ic_settings_black_24dp"
371 android:contentDescription="@string/icon"
372 android:gravity="end|center_vertical"
373 android:paddingStart="8dp"
374 android:paddingEnd="8dp"
375 app:layout_constraintBottom_toBottomOf="parent"
376 app:layout_constraintEnd_toEndOf="parent"
377 app:layout_constraintTop_toTopOf="parent"
383 android:id="@+id/nav_profiles_label"
384 style="@style/nav_button"
385 android:layout_width="wrap_content"
386 android:layout_height="0dp"
387 android:gravity="start|center_vertical"
388 android:text="@string/profiles"
389 app:layout_constraintBottom_toBottomOf="parent"
390 app:layout_constraintStart_toStartOf="parent"
391 app:layout_constraintTop_toTopOf="parent"
394 </androidx.constraintlayout.widget.ConstraintLayout>
396 android:id="@+id/nav_profile_list_container"
397 android:layout_width="match_parent"
398 android:layout_height="wrap_content"
399 android:animateLayoutChanges="true"
400 android:nestedScrollingEnabled="false"
401 android:orientation="vertical"
404 <androidx.recyclerview.widget.RecyclerView
405 android:id="@+id/nav_profile_list"
406 android:layout_width="match_parent"
407 android:layout_height="wrap_content"
408 android:isScrollContainer="false"
409 android:nestedScrollingEnabled="false"
410 android:orientation="vertical"
413 </androidx.recyclerview.widget.RecyclerView>
422 </androidx.constraintlayout.widget.ConstraintLayout>
424 </com.google.android.material.navigation.NavigationView>
425 </androidx.drawerlayout.widget.DrawerLayout>
426 </androidx.coordinatorlayout.widget.CoordinatorLayout>