]> git.ktnx.net Git - mobile-ledger.git/blob - app/src/main/res/layout/activity_main.xml
drop unnecessary namespace declarations after layout merger
[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                 <LinearLayout
151                     android:id="@+id/main_header"
152                     android:layout_width="match_parent"
153                     android:layout_height="wrap_content"
154                     android:orientation="vertical"
155                     app:layout_constraintEnd_toEndOf="parent"
156                     app:layout_constraintStart_toStartOf="parent"
157                     app:layout_constraintTop_toBottomOf="@id/toolbar"
158                     >
159
160                     <LinearLayout
161                         android:id="@+id/transaction_progress_layout"
162                         android:layout_width="match_parent"
163                         android:layout_height="wrap_content"
164                         android:gravity="center_vertical"
165                         android:orientation="horizontal"
166                         android:visibility="gone"
167                         >
168
169                         <ProgressBar
170                             android:id="@+id/transaction_list_progress_bar"
171                             style="?android:attr/progressBarStyleHorizontal"
172                             android:layout_width="0dp"
173                             android:layout_height="wrap_content"
174                             android:layout_marginTop="-8dp"
175                             android:layout_marginBottom="-7dp"
176                             android:layout_weight="1"
177                             android:indeterminate="true"
178                             android:min="0"
179                             android:padding="0dp"
180                             android:progressTint="?colorPrimary"
181                             app:layout_constraintEnd_toEndOf="parent"
182                             app:layout_constraintStart_toStartOf="parent"
183                             />
184
185                         <TextView
186                             android:id="@+id/transaction_list_cancel_download"
187                             android:layout_width="wrap_content"
188                             android:layout_height="wrap_content"
189                             android:background="@drawable/ic_clear_accent_24dp"
190                             android:clickable="true"
191                             android:focusable="true"
192                             />
193                     </LinearLayout>
194
195                 </LinearLayout>
196
197                 <androidx.viewpager2.widget.ViewPager2
198                     android:id="@+id/main_pager"
199                     android:layout_width="match_parent"
200                     android:layout_height="0dp"
201                     app:layout_constraintBottom_toBottomOf="parent"
202                     app:layout_constraintEnd_toEndOf="parent"
203                     app:layout_constraintStart_toStartOf="parent"
204                     app:layout_constraintTop_toBottomOf="@+id/main_header"
205                     >
206
207                 </androidx.viewpager2.widget.ViewPager2>
208
209                 <View
210                     android:layout_width="0dp"
211                     android:layout_height="?attr/main_header_shadow_height"
212                     android:background="@drawable/drop_shadow"
213                     app:layout_constraintEnd_toEndOf="parent"
214                     app:layout_constraintStart_toStartOf="parent"
215                     app:layout_constraintTop_toBottomOf="@id/main_header"
216                     />
217
218
219             </androidx.constraintlayout.widget.ConstraintLayout>
220
221             <com.google.android.material.navigation.NavigationView xmlns:app="http://schemas.android.com/apk/res-auto"
222                 android:id="@+id/nav_view"
223                 android:layout_width="wrap_content"
224                 android:layout_height="match_parent"
225                 android:layout_gravity="start"
226                 android:fitsSystemWindows="true"
227                 >
228
229
230                 <androidx.constraintlayout.widget.ConstraintLayout
231                     android:layout_width="match_parent"
232                     android:layout_height="match_parent"
233                     android:layout_marginBottom="0dp"
234                     android:animateLayoutChanges="true"
235                     android:orientation="vertical"
236                     >
237
238                     <LinearLayout
239                         android:id="@+id/nav_fixed_items"
240                         android:layout_width="match_parent"
241                         android:layout_height="wrap_content"
242                         android:divider="@drawable/list_divider"
243                         android:elevation="2dp"
244                         android:orientation="vertical"
245                         android:showDividers="beginning"
246                         android:visibility="gone"
247                         app:layout_constraintBottom_toBottomOf="parent"
248                         >
249
250                         <TextView
251                             android:id="@+id/textView2"
252                             style="@style/nav_button"
253                             android:layout_weight="1"
254                             android:text="@string/action_settings"
255                             app:drawableStartCompat="@drawable/ic_settings_black_24dp"
256                             />
257
258                     </LinearLayout>
259
260                     <ScrollView
261                         android:layout_width="0dp"
262                         android:layout_height="0dp"
263                         app:layout_constraintBottom_toTopOf="@+id/nav_fixed_items"
264                         app:layout_constraintEnd_toEndOf="parent"
265                         app:layout_constraintLeft_toLeftOf="parent"
266                         app:layout_constraintStart_toStartOf="parent"
267                         app:layout_constraintTop_toTopOf="parent"
268                         >
269
270                         <LinearLayout
271                             android:id="@+id/nav_upper"
272                             android:layout_width="match_parent"
273                             android:layout_height="wrap_content"
274                             android:animateLayoutChanges="true"
275                             android:orientation="vertical"
276                             android:showDividers="beginning"
277                             app:layout_constraintBottom_toTopOf="@+id/nav_fixed_items"
278                             app:layout_constraintTop_toBottomOf="@+id/nav_header"
279                             >
280
281                             <include layout="@layout/nav_header_layout" />
282
283                             <LinearLayout
284                                 android:id="@+id/nav_actions"
285                                 android:layout_width="match_parent"
286                                 android:layout_height="match_parent"
287                                 android:orientation="vertical"
288                                 >
289
290                                 <TextView
291                                     android:id="@+id/nav_account_summary"
292                                     style="@style/nav_button"
293                                     android:text="@string/account_summary_title"
294                                     app:drawableStartCompat="@drawable/ic_home_black_24dp"
295                                     />
296
297                                 <TextView
298                                     android:id="@+id/nav_latest_transactions"
299                                     style="@style/nav_button"
300                                     android:text="@string/nav_transactions_title"
301                                     app:drawableStartCompat="@drawable/ic_event_note_black_24dp"
302                                     />
303
304                                 <TextView
305                                     android:id="@+id/textView5"
306                                     style="@style/nav_button"
307                                     android:text="@string/nav_reports_title"
308                                     android:visibility="gone"
309                                     app:drawableStartCompat="@drawable/ic_assignment_black_24dp"
310                                     />
311
312                                 <androidx.constraintlayout.widget.ConstraintLayout
313                                     android:id="@+id/nav_profile_list_head_layout"
314                                     android:layout_width="match_parent"
315                                     android:layout_height="@dimen/thumb_row_height"
316                                     >
317
318                                     <ImageView
319                                         android:id="@+id/nav_new_profile_button"
320                                         android:layout_width="wrap_content"
321                                         android:layout_height="wrap_content"
322                                         android:layout_gravity="center"
323                                         android:contentDescription="@string/icon"
324                                         android:paddingStart="8dp"
325                                         android:paddingEnd="8dp"
326                                         android:visibility="gone"
327                                         app:layout_constraintBottom_toBottomOf="parent"
328                                         app:layout_constraintEnd_toStartOf="@id/nav_profile_list_head_buttons"
329                                         app:layout_constraintStart_toEndOf="@id/nav_profiles_label"
330                                         app:layout_constraintTop_toTopOf="parent"
331                                         app:srcCompat="@drawable/ic_add_circle_white_24dp"
332                                         />
333
334                                     <LinearLayout
335                                         android:id="@+id/nav_profile_list_head_buttons"
336                                         android:layout_width="wrap_content"
337                                         android:layout_height="0dp"
338                                         android:gravity="center_vertical"
339                                         android:orientation="horizontal"
340                                         android:paddingStart="16dp"
341                                         android:paddingEnd="16dp"
342                                         app:layout_constraintBottom_toBottomOf="parent"
343                                         app:layout_constraintEnd_toEndOf="parent"
344                                         app:layout_constraintTop_toTopOf="parent"
345                                         >
346
347                                         <ImageView
348                                             android:id="@+id/nav_profiles_cancel_edit"
349                                             android:layout_width="wrap_content"
350                                             android:layout_height="wrap_content"
351                                             android:background="@drawable/ic_clear_accent_24dp"
352                                             android:contentDescription="@string/icon"
353                                             android:gravity="end|center_vertical"
354                                             android:paddingStart="8dp"
355                                             android:paddingEnd="8dp"
356                                             android:visibility="gone"
357                                             app:layout_constraintBottom_toBottomOf="parent"
358                                             app:layout_constraintEnd_toEndOf="parent"
359                                             app:layout_constraintTop_toTopOf="parent"
360                                             />
361
362                                         <ImageView
363                                             android:id="@+id/nav_profiles_start_edit"
364                                             android:layout_width="wrap_content"
365                                             android:layout_height="wrap_content"
366                                             android:background="@drawable/ic_settings_black_24dp"
367                                             android:contentDescription="@string/icon"
368                                             android:gravity="end|center_vertical"
369                                             android:paddingStart="8dp"
370                                             android:paddingEnd="8dp"
371                                             app:layout_constraintBottom_toBottomOf="parent"
372                                             app:layout_constraintEnd_toEndOf="parent"
373                                             app:layout_constraintTop_toTopOf="parent"
374                                             />
375
376                                     </LinearLayout>
377
378                                     <TextView
379                                         android:id="@+id/nav_profiles_label"
380                                         style="@style/nav_button"
381                                         android:layout_width="wrap_content"
382                                         android:layout_height="0dp"
383                                         android:gravity="start|center_vertical"
384                                         android:text="@string/profiles"
385                                         app:layout_constraintBottom_toBottomOf="parent"
386                                         app:layout_constraintStart_toStartOf="parent"
387                                         app:layout_constraintTop_toTopOf="parent"
388                                         />
389
390                                 </androidx.constraintlayout.widget.ConstraintLayout>
391                                 <LinearLayout
392                                     android:id="@+id/nav_profile_list_container"
393                                     android:layout_width="match_parent"
394                                     android:layout_height="wrap_content"
395                                     android:animateLayoutChanges="true"
396                                     android:nestedScrollingEnabled="false"
397                                     android:orientation="vertical"
398                                     >
399
400                                     <androidx.recyclerview.widget.RecyclerView
401                                         android:id="@+id/nav_profile_list"
402                                         android:layout_width="match_parent"
403                                         android:layout_height="wrap_content"
404                                         android:isScrollContainer="false"
405                                         android:nestedScrollingEnabled="false"
406                                         android:orientation="vertical"
407                                         >
408
409                                     </androidx.recyclerview.widget.RecyclerView>
410
411                                 </LinearLayout>
412
413                             </LinearLayout>
414
415                         </LinearLayout>
416                     </ScrollView>
417
418                 </androidx.constraintlayout.widget.ConstraintLayout>
419
420             </com.google.android.material.navigation.NavigationView>
421         </androidx.drawerlayout.widget.DrawerLayout>
422     </androidx.coordinatorlayout.widget.CoordinatorLayout>
423 </FrameLayout>