whitespace
[mobile-ledger.git] / app / src / main / res / layout / activity_main.xml
1 <?xml version="1.0" encoding="utf-8"?><!--
2   ~ Copyright © 2018 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         <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
40             xmlns:tools="http://schemas.android.com/tools"
41             android:id="@+id/root_frame"
42             android:layout_width="match_parent"
43             android:layout_height="match_parent">
44
45             <android.support.design.widget.FloatingActionButton
46                 android:id="@+id/btn_add_transaction"
47                 android:layout_width="wrap_content"
48                 android:layout_height="wrap_content"
49                 android:layout_gravity="bottom|end"
50                 android:layout_margin="@dimen/fab_margin"
51                 android:onClick="fab_new_transaction_clicked"
52                 app:backgroundTint="@color/colorPrimary"
53                 app:srcCompat="@drawable/svg_thick_plus_white" />
54         </FrameLayout>
55
56
57         <android.support.design.widget.NavigationView
58             android:id="@+id/nav_view"
59             android:layout_width="wrap_content"
60             android:layout_height="match_parent"
61             android:layout_gravity="start"
62             android:fitsSystemWindows="true"
63             android:theme="@style/ThemeOverlay.AppCompat.Light">
64
65             <ScrollView
66                 android:layout_width="match_parent"
67                 android:layout_height="match_parent"
68                 android:scrollbars="vertical"
69                 app:layout_constraintBottom_toBottomOf="parent"
70                 app:layout_constraintTop_toTopOf="parent">
71
72                 <android.support.constraint.ConstraintLayout
73                     android:layout_width="match_parent"
74                     android:layout_height="wrap_content"
75                     android:layout_marginBottom="0dp"
76                     android:orientation="vertical">
77
78                     <LinearLayout
79                         android:id="@+id/nav_header"
80                         android:layout_width="match_parent"
81                         android:layout_height="wrap_content"
82                         android:background="@drawable/side_nav_bar"
83                         android:gravity="bottom"
84                         android:orientation="vertical"
85                         android:paddingLeft="@dimen/activity_horizontal_margin"
86                         android:paddingTop="@dimen/activity_vertical_margin"
87                         android:paddingRight="@dimen/activity_horizontal_margin"
88                         android:paddingBottom="@dimen/activity_vertical_margin"
89                         android:theme="@style/ThemeOverlay.AppCompat.Dark"
90                         app:layout_constraintTop_toTopOf="parent">
91
92                         <ImageView
93                             android:id="@+id/imageView"
94                             android:layout_width="wrap_content"
95                             android:layout_height="wrap_content"
96                             android:contentDescription="@string/nav_header_desc"
97                             android:paddingTop="@dimen/nav_header_vertical_spacing"
98                             app:srcCompat="@mipmap/ic_launcher_round" />
99
100                         <TextView
101                             android:layout_width="match_parent"
102                             android:layout_height="wrap_content"
103                             android:paddingTop="@dimen/nav_header_vertical_spacing"
104                             android:text="@string/app_name"
105                             android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
106
107                         <TextView
108                             android:id="@+id/drawer_version_text"
109                             android:layout_width="wrap_content"
110                             android:layout_height="wrap_content"
111                             android:text="@string/nav_header_subtitle" />
112
113                     </LinearLayout>
114
115                     <LinearLayout
116                         android:id="@+id/nav_actions"
117                         android:layout_width="match_parent"
118                         android:layout_height="wrap_content"
119                         android:orientation="vertical"
120                         app:layout_constraintBottom_toTopOf="@+id/nav_fixed_items"
121                         app:layout_constraintTop_toBottomOf="@+id/nav_header">
122
123                         <TextView
124                             android:id="@+id/nav_account_summary"
125                             style="@style/nav_button"
126                             android:drawableStart="@drawable/ic_home_black_24dp"
127                             android:onClick="onAccountSummaryClicked"
128                             android:text="@string/account_summary_title" />
129
130                         <TextView
131                             android:id="@+id/nav_latest_transactions"
132                             style="@style/nav_button"
133                             android:drawableStart="@drawable/ic_event_note_black_24dp"
134                             android:onClick="onLatestTransactionsClicked"
135                             android:text="@string/nav_latest_transactions_title" />
136
137                         <TextView
138                             android:id="@+id/textView5"
139                             style="@style/nav_button"
140                             android:drawableStart="@drawable/ic_assignment_black_24dp"
141                             android:text="@string/nav_reports_title" />
142
143                     </LinearLayout>
144
145                     <LinearLayout
146                         android:id="@+id/nav_fixed_items"
147                         android:layout_width="match_parent"
148                         android:layout_height="wrap_content"
149                         android:divider="@drawable/list_divider"
150                         android:elevation="2dp"
151                         android:orientation="vertical"
152                         android:showDividers="beginning"
153                         app:layout_constraintBottom_toBottomOf="parent">
154
155                         <TextView
156                             android:id="@+id/textView2"
157                             style="@style/nav_button"
158                             android:layout_weight="1"
159                             android:drawableStart="@drawable/ic_settings_black_24dp"
160                             android:onClick="nav_settings_clicked"
161                             android:text="@string/action_settings" />
162
163                         <TextView
164                             android:id="@+id/nav_exit"
165                             style="@style/nav_button"
166                             android:layout_weight="1"
167                             android:drawableStart="@drawable/ic_exit_to_app_black_24dp"
168                             android:onClick="nav_exit_clicked"
169                             android:text="@string/nav_exit_title" />
170
171                     </LinearLayout>
172
173                 </android.support.constraint.ConstraintLayout>
174             </ScrollView>
175
176         </android.support.design.widget.NavigationView>
177
178     </android.support.v4.widget.DrawerLayout>
179 </LinearLayout>