]> git.ktnx.net Git - mobile-ledger.git/blob - app/src/main/res/layout/activity_main.xml
d30b88a1015dd95dffed8db4a71e3dd2dac56518
[mobile-ledger.git] / app / src / main / res / layout / activity_main.xml
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.
8   ~
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.
13   ~
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/>.
16   -->
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"
22     >
23
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"
30         >
31
32         <FrameLayout
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"
39             >
40
41             <include layout="@layout/nav_header_layout" />
42         </FrameLayout>
43
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"
52             >
53
54             <TextView
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"
65                 />
66
67             <TextView
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"
80                 />
81
82             <Button
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"
98                 />
99         </androidx.constraintlayout.widget.ConstraintLayout>
100     </androidx.constraintlayout.widget.ConstraintLayout>
101
102     <androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:app="http://schemas.android.com/apk/res-auto"
103         android:id="@+id/main_app_layout"
104         android:layout_width="match_parent"
105         android:layout_height="match_parent"
106         android:background="?android:attr/colorBackground"
107         android:orientation="vertical"
108         android:visibility="gone"
109         >
110
111         <com.google.android.material.floatingactionbutton.FloatingActionButton
112             android:id="@+id/btn_add_transaction"
113             android:layout_width="wrap_content"
114             android:layout_height="wrap_content"
115             android:layout_gravity="bottom|end"
116             android:layout_margin="@dimen/fab_margin"
117             android:contentDescription="@string/new_transaction_fab_description"
118             app:backgroundTint="?colorSecondary"
119             app:layout_constraintBottom_toBottomOf="parent"
120             app:layout_constraintEnd_toEndOf="parent"
121             app:maxImageSize="36dp"
122             app:srcCompat="@drawable/ic_add_white_24dp"
123             />
124
125         <androidx.drawerlayout.widget.DrawerLayout
126             android:id="@+id/drawer_layout"
127             android:layout_width="match_parent"
128             android:layout_height="match_parent"
129             tools:openDrawer="start"
130             >
131
132             <androidx.constraintlayout.widget.ConstraintLayout
133                 android:id="@+id/pager_layout"
134                 android:layout_width="match_parent"
135                 android:layout_height="match_parent"
136                 >
137
138                 <androidx.appcompat.widget.Toolbar
139                     android:id="@+id/toolbar"
140                     android:layout_width="match_parent"
141                     android:layout_height="@dimen/toolbar_height"
142                     android:background="?colorPrimary"
143                     android:theme="@style/AppTheme.AppBarOverlay"
144                     app:layout_constraintEnd_toEndOf="parent"
145                     app:layout_constraintStart_toStartOf="parent"
146                     app:layout_constraintTop_toTopOf="parent"
147                     app:popupTheme="@style/AppTheme.PopupOverlay"
148                     />
149
150
151                 <LinearLayout
152                     android:id="@+id/transaction_progress_layout"
153                     android:layout_width="match_parent"
154                     android:layout_height="wrap_content"
155                     android:gravity="center_vertical"
156                     android:orientation="horizontal"
157                     android:visibility="gone"
158                     app:layout_constraintEnd_toEndOf="parent"
159                     app:layout_constraintStart_toStartOf="parent"
160                     app:layout_constraintTop_toBottomOf="@id/toolbar"
161                     >
162
163                     <ProgressBar
164                         android:id="@+id/transaction_list_progress_bar"
165                         style="?android:attr/progressBarStyleHorizontal"
166                         android:layout_width="0dp"
167                         android:layout_height="wrap_content"
168                         android:layout_marginTop="-8dp"
169                         android:layout_marginBottom="-7dp"
170                         android:layout_weight="1"
171                         android:indeterminate="true"
172                         android:min="0"
173                         android:padding="0dp"
174                         android:progressTint="?colorPrimary"
175                         app:layout_constraintEnd_toEndOf="parent"
176                         app:layout_constraintStart_toStartOf="parent"
177                         />
178
179                     <TextView
180                         android:id="@+id/transaction_list_cancel_download"
181                         android:layout_width="wrap_content"
182                         android:layout_height="wrap_content"
183                         android:background="@drawable/ic_clear_accent_24dp"
184                         android:clickable="true"
185                         android:focusable="true"
186                         />
187                 </LinearLayout>
188
189                 <androidx.viewpager2.widget.ViewPager2
190                     android:id="@+id/main_pager"
191                     android:layout_width="match_parent"
192                     android:layout_height="0dp"
193                     app:layout_constraintBottom_toBottomOf="parent"
194                     app:layout_constraintEnd_toEndOf="parent"
195                     app:layout_constraintStart_toStartOf="parent"
196                     app:layout_constraintTop_toBottomOf="@id/transaction_progress_layout"
197                     >
198
199                 </androidx.viewpager2.widget.ViewPager2>
200
201                 <View
202                     android:layout_width="0dp"
203                     android:layout_height="?attr/main_header_shadow_height"
204                     android:background="@drawable/drop_shadow"
205                     app:layout_constraintEnd_toEndOf="parent"
206                     app:layout_constraintStart_toStartOf="parent"
207                     app:layout_constraintTop_toBottomOf="@id/transaction_progress_layout"
208                     />
209
210
211             </androidx.constraintlayout.widget.ConstraintLayout>
212
213             <com.google.android.material.navigation.NavigationView xmlns:app="http://schemas.android.com/apk/res-auto"
214                 android:id="@+id/nav_view"
215                 android:layout_width="wrap_content"
216                 android:layout_height="match_parent"
217                 android:layout_gravity="start"
218                 android:fitsSystemWindows="true"
219                 >
220
221
222                 <androidx.constraintlayout.widget.ConstraintLayout
223                     android:layout_width="match_parent"
224                     android:layout_height="match_parent"
225                     android:layout_marginBottom="0dp"
226                     android:animateLayoutChanges="true"
227                     android:orientation="vertical"
228                     >
229
230                     <LinearLayout
231                         android:id="@+id/nav_fixed_items"
232                         android:layout_width="match_parent"
233                         android:layout_height="wrap_content"
234                         android:divider="@drawable/list_divider"
235                         android:elevation="2dp"
236                         android:orientation="vertical"
237                         android:showDividers="beginning"
238                         android:visibility="gone"
239                         app:layout_constraintBottom_toBottomOf="parent"
240                         >
241
242                         <TextView
243                             android:id="@+id/textView2"
244                             style="@style/nav_button"
245                             android:layout_weight="1"
246                             android:text="@string/action_settings"
247                             app:drawableStartCompat="@drawable/ic_settings_black_24dp"
248                             />
249
250                     </LinearLayout>
251
252                     <ScrollView
253                         android:layout_width="0dp"
254                         android:layout_height="0dp"
255                         app:layout_constraintBottom_toTopOf="@+id/nav_fixed_items"
256                         app:layout_constraintEnd_toEndOf="parent"
257                         app:layout_constraintLeft_toLeftOf="parent"
258                         app:layout_constraintStart_toStartOf="parent"
259                         app:layout_constraintTop_toTopOf="parent"
260                         >
261
262                         <LinearLayout
263                             android:id="@+id/nav_upper"
264                             android:layout_width="match_parent"
265                             android:layout_height="wrap_content"
266                             android:animateLayoutChanges="true"
267                             android:orientation="vertical"
268                             android:showDividers="beginning"
269                             app:layout_constraintBottom_toTopOf="@+id/nav_fixed_items"
270                             app:layout_constraintTop_toBottomOf="@+id/nav_header"
271                             >
272
273                             <include layout="@layout/nav_header_layout" />
274
275                             <LinearLayout
276                                 android:id="@+id/nav_actions"
277                                 android:layout_width="match_parent"
278                                 android:layout_height="match_parent"
279                                 android:orientation="vertical"
280                                 >
281
282                                 <TextView
283                                     android:id="@+id/nav_account_summary"
284                                     style="@style/nav_button"
285                                     android:text="@string/account_summary_title"
286                                     app:drawableStartCompat="@drawable/ic_home_black_24dp"
287                                     />
288
289                                 <TextView
290                                     android:id="@+id/nav_latest_transactions"
291                                     style="@style/nav_button"
292                                     android:text="@string/nav_transactions_title"
293                                     app:drawableStartCompat="@drawable/ic_event_note_black_24dp"
294                                     />
295
296                                 <TextView
297                                     android:id="@+id/textView5"
298                                     style="@style/nav_button"
299                                     android:text="@string/nav_reports_title"
300                                     android:visibility="gone"
301                                     app:drawableStartCompat="@drawable/ic_assignment_black_24dp"
302                                     />
303
304                                 <androidx.constraintlayout.widget.ConstraintLayout
305                                     android:id="@+id/nav_profile_list_head_layout"
306                                     android:layout_width="match_parent"
307                                     android:layout_height="@dimen/thumb_row_height"
308                                     >
309
310                                     <ImageView
311                                         android:id="@+id/nav_new_profile_button"
312                                         android:layout_width="wrap_content"
313                                         android:layout_height="wrap_content"
314                                         android:layout_gravity="center"
315                                         android:contentDescription="@string/icon"
316                                         android:paddingStart="8dp"
317                                         android:paddingEnd="8dp"
318                                         android:visibility="gone"
319                                         app:layout_constraintBottom_toBottomOf="parent"
320                                         app:layout_constraintEnd_toStartOf="@id/nav_profile_list_head_buttons"
321                                         app:layout_constraintStart_toEndOf="@id/nav_profiles_label"
322                                         app:layout_constraintTop_toTopOf="parent"
323                                         app:srcCompat="@drawable/ic_add_circle_white_24dp"
324                                         />
325
326                                     <LinearLayout
327                                         android:id="@+id/nav_profile_list_head_buttons"
328                                         android:layout_width="wrap_content"
329                                         android:layout_height="0dp"
330                                         android:gravity="center_vertical"
331                                         android:orientation="horizontal"
332                                         android:paddingStart="16dp"
333                                         android:paddingEnd="16dp"
334                                         app:layout_constraintBottom_toBottomOf="parent"
335                                         app:layout_constraintEnd_toEndOf="parent"
336                                         app:layout_constraintTop_toTopOf="parent"
337                                         >
338
339                                         <ImageView
340                                             android:id="@+id/nav_profiles_cancel_edit"
341                                             android:layout_width="wrap_content"
342                                             android:layout_height="wrap_content"
343                                             android:background="@drawable/ic_clear_accent_24dp"
344                                             android:contentDescription="@string/icon"
345                                             android:gravity="end|center_vertical"
346                                             android:paddingStart="8dp"
347                                             android:paddingEnd="8dp"
348                                             android:visibility="gone"
349                                             app:layout_constraintBottom_toBottomOf="parent"
350                                             app:layout_constraintEnd_toEndOf="parent"
351                                             app:layout_constraintTop_toTopOf="parent"
352                                             />
353
354                                         <ImageView
355                                             android:id="@+id/nav_profiles_start_edit"
356                                             android:layout_width="wrap_content"
357                                             android:layout_height="wrap_content"
358                                             android:background="@drawable/ic_settings_black_24dp"
359                                             android:contentDescription="@string/icon"
360                                             android:gravity="end|center_vertical"
361                                             android:paddingStart="8dp"
362                                             android:paddingEnd="8dp"
363                                             app:layout_constraintBottom_toBottomOf="parent"
364                                             app:layout_constraintEnd_toEndOf="parent"
365                                             app:layout_constraintTop_toTopOf="parent"
366                                             />
367
368                                     </LinearLayout>
369
370                                     <TextView
371                                         android:id="@+id/nav_profiles_label"
372                                         style="@style/nav_button"
373                                         android:layout_width="wrap_content"
374                                         android:layout_height="0dp"
375                                         android:gravity="start|center_vertical"
376                                         android:text="@string/profiles"
377                                         app:layout_constraintBottom_toBottomOf="parent"
378                                         app:layout_constraintStart_toStartOf="parent"
379                                         app:layout_constraintTop_toTopOf="parent"
380                                         />
381
382                                 </androidx.constraintlayout.widget.ConstraintLayout>
383                                 <LinearLayout
384                                     android:id="@+id/nav_profile_list_container"
385                                     android:layout_width="match_parent"
386                                     android:layout_height="wrap_content"
387                                     android:animateLayoutChanges="true"
388                                     android:nestedScrollingEnabled="false"
389                                     android:orientation="vertical"
390                                     >
391
392                                     <androidx.recyclerview.widget.RecyclerView
393                                         android:id="@+id/nav_profile_list"
394                                         android:layout_width="match_parent"
395                                         android:layout_height="wrap_content"
396                                         android:isScrollContainer="false"
397                                         android:nestedScrollingEnabled="false"
398                                         android:orientation="vertical"
399                                         >
400
401                                     </androidx.recyclerview.widget.RecyclerView>
402
403                                 </LinearLayout>
404
405                             </LinearLayout>
406
407                         </LinearLayout>
408                     </ScrollView>
409
410                 </androidx.constraintlayout.widget.ConstraintLayout>
411
412             </com.google.android.material.navigation.NavigationView>
413         </androidx.drawerlayout.widget.DrawerLayout>
414     </androidx.coordinatorlayout.widget.CoordinatorLayout>
415 </FrameLayout>