]> git.ktnx.net Git - mobile-ledger.git/blob - app/src/main/res/layout/activity_main.xml
nice side-swipe switch between account summary and transaction list
[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="fab_new_transaction_clicked"
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                 app:layout_constraintEnd_toEndOf="parent"
61                 app:layout_constraintStart_toStartOf="parent"
62                 app:layout_constraintTop_toTopOf="parent">
63
64                 <LinearLayout
65                     android:layout_width="match_parent"
66                     android:layout_height="wrap_content"
67                     android:elevation="24dp"
68                     android:orientation="horizontal">
69
70                     <TextView
71                         android:id="@+id/transaction_last_update_label"
72                         android:layout_width="wrap_content"
73                         android:layout_height="wrap_content"
74                         android:paddingEnd="8dp"
75                         android:paddingStart="8dp"
76                         android:text="@string/transactions_last_update_label"
77                         android:textColor="@android:color/tertiary_text_light" />
78
79                     <TextView
80                         android:id="@+id/transactions_last_update"
81                         style="@android:style/Widget.DeviceDefault.Light.TextView"
82                         android:layout_width="0dp"
83                         android:layout_height="wrap_content"
84                         android:layout_weight="1"
85                         android:text="\?"
86                         android:textColor="@android:color/tertiary_text_light"
87                         tools:ignore="HardcodedText" />
88                 </LinearLayout>
89
90                 <LinearLayout
91                     android:id="@+id/transaction_progress_layout"
92                     android:layout_width="match_parent"
93                     android:layout_height="wrap_content"
94                     android:gravity="center_vertical"
95                     android:orientation="horizontal"
96                     android:visibility="gone">
97
98                     <ProgressBar
99                         android:id="@+id/transaction_list_progress_bar"
100                         style="?android:attr/progressBarStyleHorizontal"
101                         android:layout_width="0dp"
102                         android:layout_height="wrap_content"
103                         android:layout_marginTop="-8dp"
104                         android:layout_marginBottom="-7dp"
105                         android:layout_weight="1"
106                         android:indeterminate="true"
107                         android:padding="0dp"
108                         android:progressTint="@color/colorPrimary"
109                         app:layout_constraintEnd_toEndOf="parent"
110                         app:layout_constraintStart_toStartOf="parent"
111                         app:layout_constraintTop_toBottomOf="@+id/transaction_list_head" />
112
113                     <TextView
114                         android:id="@+id/transaction_list_cancel_download"
115                         android:layout_width="wrap_content"
116                         android:layout_height="wrap_content"
117                         android:background="@drawable/ic_clear_black_24dp"
118                         android:clickable="true"
119                         android:focusable="true"
120                         android:onClick="onStopTransactionRefreshClick" />
121                 </LinearLayout>
122
123             </LinearLayout>
124
125             <android.support.v4.view.ViewPager
126                 android:id="@+id/root_frame"
127                 android:layout_width="match_parent"
128                 android:layout_height="0dp"
129                 app:layout_constraintBottom_toBottomOf="parent"
130                 app:layout_constraintTop_toBottomOf="@+id/main_header"
131                 app:layout_behavior="@string/appbar_scrolling_view_behavior"
132                 >
133
134             </android.support.v4.view.ViewPager>
135
136             <View
137                 android:layout_width="0dp"
138                 android:layout_height="4dp"
139                 android:background="@drawable/drop_shadow"
140                 app:layout_constraintTop_toBottomOf="@id/main_header" />
141
142         </android.support.constraint.ConstraintLayout>
143
144
145         <android.support.design.widget.NavigationView
146             android:id="@+id/nav_view"
147             android:layout_width="wrap_content"
148             android:layout_height="match_parent"
149             android:layout_gravity="start"
150             android:fitsSystemWindows="true"
151             android:theme="@style/ThemeOverlay.AppCompat.Light">
152
153             <ScrollView
154                 android:layout_width="match_parent"
155                 android:layout_height="match_parent"
156                 android:scrollbars="vertical"
157                 app:layout_constraintBottom_toBottomOf="parent"
158                 app:layout_constraintTop_toTopOf="parent">
159
160                 <android.support.constraint.ConstraintLayout
161                     android:layout_width="match_parent"
162                     android:layout_height="wrap_content"
163                     android:layout_marginBottom="0dp"
164                     android:orientation="vertical">
165
166                     <LinearLayout
167                         android:id="@+id/nav_header"
168                         android:layout_width="match_parent"
169                         android:layout_height="wrap_content"
170                         android:background="@drawable/side_nav_bar"
171                         android:gravity="bottom"
172                         android:orientation="vertical"
173                         android:paddingLeft="@dimen/activity_horizontal_margin"
174                         android:paddingTop="@dimen/activity_vertical_margin"
175                         android:paddingRight="@dimen/activity_horizontal_margin"
176                         android:paddingBottom="@dimen/activity_vertical_margin"
177                         android:theme="@style/ThemeOverlay.AppCompat.Dark"
178                         app:layout_constraintTop_toTopOf="parent">
179
180                         <ImageView
181                             android:id="@+id/imageView"
182                             android:layout_width="wrap_content"
183                             android:layout_height="wrap_content"
184                             android:contentDescription="@string/nav_header_desc"
185                             android:paddingTop="@dimen/nav_header_vertical_spacing"
186                             app:srcCompat="@mipmap/ic_launcher_round" />
187
188                         <TextView
189                             android:layout_width="match_parent"
190                             android:layout_height="wrap_content"
191                             android:paddingTop="@dimen/nav_header_vertical_spacing"
192                             android:text="@string/app_name"
193                             android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
194
195                         <TextView
196                             android:id="@+id/drawer_version_text"
197                             android:layout_width="wrap_content"
198                             android:layout_height="wrap_content"
199                             android:text="@string/nav_header_subtitle" />
200
201                     </LinearLayout>
202
203                     <LinearLayout
204                         android:id="@+id/nav_actions"
205                         android:layout_width="match_parent"
206                         android:layout_height="wrap_content"
207                         android:orientation="vertical"
208                         app:layout_constraintBottom_toTopOf="@+id/nav_fixed_items"
209                         app:layout_constraintTop_toBottomOf="@+id/nav_header">
210
211                         <TextView
212                             android:id="@+id/nav_account_summary"
213                             style="@style/nav_button"
214                             android:drawableStart="@drawable/ic_home_black_24dp"
215                             android:onClick="onAccountSummaryClicked"
216                             android:text="@string/account_summary_title" />
217
218                         <TextView
219                             android:id="@+id/nav_latest_transactions"
220                             style="@style/nav_button"
221                             android:drawableStart="@drawable/ic_event_note_black_24dp"
222                             android:onClick="onLatestTransactionsClicked"
223                             android:text="@string/nav_latest_transactions_title" />
224
225                         <TextView
226                             android:id="@+id/textView5"
227                             style="@style/nav_button"
228                             android:drawableStart="@drawable/ic_assignment_black_24dp"
229                             android:text="@string/nav_reports_title" />
230
231                     </LinearLayout>
232
233                     <LinearLayout
234                         android:id="@+id/nav_fixed_items"
235                         android:layout_width="match_parent"
236                         android:layout_height="wrap_content"
237                         android:divider="@drawable/list_divider"
238                         android:elevation="2dp"
239                         android:orientation="vertical"
240                         android:showDividers="beginning"
241                         app:layout_constraintBottom_toBottomOf="parent">
242
243                         <TextView
244                             android:id="@+id/textView2"
245                             style="@style/nav_button"
246                             android:layout_weight="1"
247                             android:drawableStart="@drawable/ic_settings_black_24dp"
248                             android:onClick="nav_settings_clicked"
249                             android:text="@string/action_settings" />
250
251                         <TextView
252                             android:id="@+id/nav_exit"
253                             style="@style/nav_button"
254                             android:layout_weight="1"
255                             android:drawableStart="@drawable/ic_exit_to_app_black_24dp"
256                             android:onClick="nav_exit_clicked"
257                             android:text="@string/nav_exit_title" />
258
259                     </LinearLayout>
260
261                 </android.support.constraint.ConstraintLayout>
262             </ScrollView>
263
264         </android.support.design.widget.NavigationView>
265
266     </android.support.v4.widget.DrawerLayout>
267 </LinearLayout>