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