]> git.ktnx.net Git - mobile-ledger.git/blob - app/src/main/res/layout/activity_main.xml
a welcome screen directs to the new profile activity when there are no profiles defined
[mobile-ledger.git] / app / src / main / res / layout / activity_main.xml
1 <?xml version="1.0" encoding="utf-8"?><!--
2   ~ Copyright © 2019 Damyan Ivanov.
3   ~ This file is part of Mobile-Ledger.
4   ~ Mobile-Ledger 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   ~ Mobile-Ledger 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 Mobile-Ledger. If not, see <https://www.gnu.org/licenses/>.
16   -->
17 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
18     xmlns:app="http://schemas.android.com/apk/res-auto"
19     xmlns:tools="http://schemas.android.com/tools"
20     android:layout_width="match_parent"
21     android:layout_height="match_parent"
22     android:orientation="vertical"
23     android:theme="@style/AppTheme.AppBarOverlay"
24     tools:context=".ui.activity.MainActivity">
25
26     <android.support.v7.widget.Toolbar
27         android:id="@+id/toolbar"
28         android:layout_width="match_parent"
29         android:layout_height="?attr/actionBarSize"
30         android:background="@color/colorPrimary"
31         app:popupTheme="@style/AppTheme.PopupOverlay" />
32
33     <android.support.v4.widget.DrawerLayout
34         android:id="@+id/drawer_layout"
35         android:layout_width="match_parent"
36         android:layout_height="match_parent"
37         tools:openDrawer="start">
38
39         <android.support.constraint.ConstraintLayout
40             android:layout_width="match_parent"
41             android:layout_height="match_parent">
42
43             <android.support.constraint.ConstraintLayout
44                 android:id="@+id/pager_layout"
45                 android:layout_width="match_parent"
46                 android:layout_height="match_parent">
47
48                 <android.support.design.widget.FloatingActionButton
49                     android:id="@+id/btn_add_transaction"
50                     android:layout_width="wrap_content"
51                     android:layout_height="wrap_content"
52                     android:layout_gravity="bottom|end"
53                     android:layout_margin="@dimen/fab_margin"
54                     android:onClick="fabNewTransactionClicked"
55                     app:backgroundTint="@color/colorPrimary"
56                     app:layout_constraintBottom_toBottomOf="parent"
57                     app:layout_constraintEnd_toEndOf="parent"
58                     app:srcCompat="@drawable/svg_thick_plus_white" />
59
60                 <LinearLayout
61                     android:id="@+id/main_header"
62                     android:layout_width="match_parent"
63                     android:layout_height="wrap_content"
64                     android:orientation="vertical"
65                     android:theme="@style/AppTheme"
66                     app:layout_constraintEnd_toEndOf="parent"
67                     app:layout_constraintStart_toStartOf="parent"
68                     app:layout_constraintTop_toTopOf="parent">
69
70                     <LinearLayout
71                         android:id="@+id/transaction_list_account_name_filter"
72                         android:layout_width="match_parent"
73                         android:layout_height="match_parent"
74                         android:orientation="horizontal"
75                         android:visibility="gone">
76
77                         <TextView
78                             android:layout_width="wrap_content"
79                             android:layout_height="wrap_content"
80                             android:background="@drawable/ic_filter_list_black_24dp" />
81
82                         <AutoCompleteTextView
83                             android:id="@+id/transaction_filter_account_name"
84                             android:layout_width="0dp"
85                             android:layout_height="wrap_content"
86                             android:layout_weight="1" />
87
88                         <TextView
89                             android:id="@+id/clearAccountNameFilter"
90                             android:layout_width="wrap_content"
91                             android:layout_height="wrap_content"
92                             android:background="@drawable/ic_clear_black_24dp"
93                             android:clickable="true"
94                             android:focusable="true" />
95
96                     </LinearLayout>
97
98                     <LinearLayout
99                         android:layout_width="match_parent"
100                         android:layout_height="wrap_content"
101                         android:elevation="24dp"
102                         android:orientation="horizontal">
103
104                         <TextView
105                             android:id="@+id/transaction_last_update_label"
106                             android:layout_width="wrap_content"
107                             android:layout_height="wrap_content"
108                             android:paddingStart="8dp"
109                             android:paddingEnd="8dp"
110                             android:text="@string/transactions_last_update_label"
111                             android:textColor="@android:color/tertiary_text_light" />
112
113                         <TextView
114                             android:id="@+id/transactions_last_update"
115                             style="@android:style/Widget.DeviceDefault.Light.TextView"
116                             android:layout_width="0dp"
117                             android:layout_height="wrap_content"
118                             android:layout_weight="1"
119                             android:text="\?"
120                             android:textColor="@android:color/tertiary_text_light"
121                             tools:ignore="HardcodedText" />
122                     </LinearLayout>
123
124                     <LinearLayout
125                         android:id="@+id/transaction_progress_layout"
126                         android:layout_width="match_parent"
127                         android:layout_height="wrap_content"
128                         android:gravity="center_vertical"
129                         android:orientation="horizontal"
130                         android:visibility="gone">
131
132                         <ProgressBar
133                             android:id="@+id/transaction_list_progress_bar"
134                             style="?android:attr/progressBarStyleHorizontal"
135                             android:layout_width="0dp"
136                             android:layout_height="wrap_content"
137                             android:layout_marginTop="-8dp"
138                             android:layout_marginBottom="-7dp"
139                             android:layout_weight="1"
140                             android:indeterminate="true"
141                             android:padding="0dp"
142                             android:progressTint="@color/colorPrimary"
143                             app:layout_constraintEnd_toEndOf="parent"
144                             app:layout_constraintStart_toStartOf="parent" />
145
146                         <TextView
147                             android:id="@+id/transaction_list_cancel_download"
148                             android:layout_width="wrap_content"
149                             android:layout_height="wrap_content"
150                             android:background="@drawable/ic_clear_black_24dp"
151                             android:clickable="true"
152                             android:focusable="true"
153                             android:onClick="onStopTransactionRefreshClick" />
154                     </LinearLayout>
155
156                 </LinearLayout>
157
158                 <android.support.v4.view.ViewPager
159                     android:id="@+id/root_frame"
160                     android:layout_width="match_parent"
161                     android:layout_height="0dp"
162                     app:layout_behavior="@string/appbar_scrolling_view_behavior"
163                     app:layout_constraintBottom_toBottomOf="parent"
164                     app:layout_constraintTop_toBottomOf="@+id/main_header">
165
166                 </android.support.v4.view.ViewPager>
167
168                 <View
169                     android:layout_width="0dp"
170                     android:layout_height="4dp"
171                     android:background="@drawable/drop_shadow"
172                     app:layout_constraintEnd_toEndOf="parent"
173                     app:layout_constraintStart_toStartOf="parent"
174                     app:layout_constraintTop_toBottomOf="@id/main_header" />
175
176
177             </android.support.constraint.ConstraintLayout>
178
179             <include layout="@layout/no_profiles" />
180         </android.support.constraint.ConstraintLayout>
181
182         <android.support.design.widget.NavigationView
183             android:id="@+id/nav_view"
184             android:layout_width="wrap_content"
185             android:layout_height="match_parent"
186             android:layout_gravity="start"
187             android:fitsSystemWindows="true"
188             android:theme="@style/ThemeOverlay.AppCompat.Light">
189
190
191             <android.support.constraint.ConstraintLayout
192                 android:layout_width="match_parent"
193                 android:layout_height="match_parent"
194                 android:layout_marginBottom="0dp"
195                 android:orientation="vertical">
196
197                 <LinearLayout
198                     android:id="@+id/nav_fixed_items"
199                     android:layout_width="match_parent"
200                     android:layout_height="wrap_content"
201                     android:divider="@drawable/list_divider"
202                     android:elevation="2dp"
203                     android:orientation="vertical"
204                     android:showDividers="beginning"
205                     app:layout_constraintBottom_toBottomOf="parent">
206
207                     <TextView
208                         android:id="@+id/nav_profiles"
209                         style="@style/nav_button"
210                         android:layout_width="match_parent"
211                         android:layout_weight="1"
212                         android:drawableStart="@drawable/ic_view_list_black_24dp"
213                         android:onClick="navProfilesClicked"
214                         android:text="@string/profiles" />
215
216                     <TextView
217                         android:id="@+id/textView2"
218                         style="@style/nav_button"
219                         android:layout_weight="1"
220                         android:drawableStart="@drawable/ic_settings_black_24dp"
221                         android:onClick="navSettingsClicked"
222                         android:text="@string/action_settings" />
223
224                 </LinearLayout>
225
226                 <ScrollView
227                     android:layout_width="0dp"
228                     android:layout_height="0dp"
229                     app:layout_constraintBottom_toTopOf="@+id/nav_fixed_items"
230                     app:layout_constraintEnd_toEndOf="parent"
231                     app:layout_constraintLeft_toLeftOf="parent"
232                     app:layout_constraintStart_toStartOf="parent"
233                     app:layout_constraintTop_toTopOf="parent">
234
235                     <LinearLayout
236                         android:id="@+id/nav_upper"
237                         android:layout_width="match_parent"
238                         android:layout_height="wrap_content"
239                         android:orientation="vertical"
240                         app:layout_constraintBottom_toTopOf="@+id/nav_fixed_items"
241                         app:layout_constraintTop_toBottomOf="@+id/nav_header">
242
243                         <LinearLayout
244                             android:id="@+id/nav_header"
245                             android:layout_width="match_parent"
246                             android:layout_height="wrap_content"
247                             android:background="@drawable/side_nav_bar"
248                             android:gravity="center_vertical"
249                             android:orientation="horizontal"
250                             android:padding="@dimen/activity_vertical_margin"
251                             android:theme="@style/ThemeOverlay.AppCompat.Dark"
252                             app:layout_constraintTop_toTopOf="parent">
253
254                             <include layout="@layout/nav_header_logo" />
255
256                             <LinearLayout
257                                 android:layout_width="match_parent"
258                                 android:layout_height="match_parent"
259                                 android:layout_marginStart="@dimen/activity_horizontal_margin"
260                                 android:layout_marginEnd="@dimen/activity_horizontal_margin"
261                                 android:gravity="center_vertical"
262                                 android:orientation="vertical">
263
264                                 <TextView
265                                     android:layout_width="match_parent"
266                                     android:layout_height="wrap_content"
267                                     android:text="@string/app_name"
268                                     android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
269
270                                 <TextView
271                                     android:id="@+id/drawer_version_text"
272                                     android:layout_width="wrap_content"
273                                     android:layout_height="wrap_content"
274                                     android:text="dummy version"
275                                     tools:ignore="HardcodedText" />
276                             </LinearLayout>
277
278                         </LinearLayout>
279
280                         <LinearLayout
281                             android:id="@+id/nav_actions"
282                             android:layout_width="match_parent"
283                             android:layout_height="match_parent"
284                             android:orientation="vertical">
285
286                             <TextView
287                                 android:id="@+id/nav_account_summary"
288                                 style="@style/nav_button"
289                                 android:drawableStart="@drawable/ic_home_black_24dp"
290                                 android:onClick="onAccountSummaryClicked"
291                                 android:text="@string/account_summary_title" />
292
293                             <TextView
294                                 android:id="@+id/nav_latest_transactions"
295                                 style="@style/nav_button"
296                                 android:drawableStart="@drawable/ic_event_note_black_24dp"
297                                 android:onClick="onLatestTransactionsClicked"
298                                 android:text="@string/nav_latest_transactions_title" />
299
300                             <TextView
301                                 android:id="@+id/textView5"
302                                 style="@style/nav_button"
303                                 android:drawableStart="@drawable/ic_assignment_black_24dp"
304                                 android:text="@string/nav_reports_title" />
305
306                         </LinearLayout>
307
308                     </LinearLayout>
309                 </ScrollView>
310
311             </android.support.constraint.ConstraintLayout>
312
313         </android.support.design.widget.NavigationView>
314
315     </android.support.v4.widget.DrawerLayout>
316 </LinearLayout>