9a1acc8b58d919379dacb62546bd99814c1285d3
[mobile-ledger.git] / app / src / main / res / layout / main_navigation.xml
1 <?xml version="1.0" encoding="utf-8"?><!--
2   ~ Copyright © 2019 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
18 <com.google.android.material.navigation.NavigationView xmlns:android="http://schemas.android.com/apk/res/android"
19     xmlns:app="http://schemas.android.com/apk/res-auto"
20     xmlns:tools="http://schemas.android.com/tools"
21     android:id="@+id/nav_view"
22     android:layout_width="wrap_content"
23     android:layout_height="match_parent"
24     android:layout_gravity="start"
25     android:fitsSystemWindows="true"
26     android:theme="@style/ThemeOverlay.AppCompat.Light"
27     tools:showIn="@layout/activity_main">
28
29
30     <androidx.constraintlayout.widget.ConstraintLayout
31         android:layout_width="match_parent"
32         android:layout_height="match_parent"
33         android:layout_marginBottom="0dp"
34         android:animateLayoutChanges="true"
35         android:orientation="vertical">
36
37         <LinearLayout
38             android:id="@+id/nav_fixed_items"
39             android:layout_width="match_parent"
40             android:layout_height="wrap_content"
41             android:divider="@drawable/list_divider"
42             android:elevation="2dp"
43             android:orientation="vertical"
44             android:showDividers="beginning"
45             app:layout_constraintBottom_toBottomOf="parent">
46
47             <TextView
48                 android:id="@+id/textView2"
49                 style="@style/nav_button"
50                 android:layout_weight="1"
51                 android:drawableStart="@drawable/ic_settings_black_24dp"
52                 android:onClick="navSettingsClicked"
53                 android:text="@string/action_settings" />
54
55         </LinearLayout>
56
57         <ScrollView
58             android:layout_width="0dp"
59             android:layout_height="0dp"
60             app:layout_constraintBottom_toTopOf="@+id/nav_fixed_items"
61             app:layout_constraintEnd_toEndOf="parent"
62             app:layout_constraintLeft_toLeftOf="parent"
63             app:layout_constraintStart_toStartOf="parent"
64             app:layout_constraintTop_toTopOf="parent">
65
66             <LinearLayout
67                 android:id="@+id/nav_upper"
68                 android:layout_width="match_parent"
69                 android:layout_height="wrap_content"
70                 android:animateLayoutChanges="true"
71                 android:divider="@drawable/list_divider_inside_out"
72                 android:orientation="vertical"
73                 android:showDividers="beginning"
74                 app:layout_constraintBottom_toTopOf="@+id/nav_fixed_items"
75                 app:layout_constraintTop_toBottomOf="@+id/nav_header">
76
77                 <LinearLayout
78                     android:id="@+id/nav_header"
79                     android:layout_width="match_parent"
80                     android:layout_height="wrap_content"
81                     android:background="@drawable/side_nav_bar"
82                     android:gravity="center_vertical"
83                     android:orientation="horizontal"
84                     android:padding="@dimen/activity_vertical_margin"
85                     android:theme="@style/ThemeOverlay.AppCompat.Dark"
86                     app:layout_constraintTop_toTopOf="parent">
87
88                     <include layout="@layout/nav_header_logo" />
89
90                     <LinearLayout
91                         android:layout_width="match_parent"
92                         android:layout_height="match_parent"
93                         android:layout_marginStart="@dimen/activity_horizontal_margin"
94                         android:layout_marginEnd="@dimen/activity_horizontal_margin"
95                         android:gravity="center_vertical"
96                         android:orientation="vertical">
97
98                         <TextView
99                             android:layout_width="match_parent"
100                             android:layout_height="wrap_content"
101                             android:text="@string/app_name"
102                             android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
103
104                         <TextView
105                             android:id="@+id/drawer_version_text"
106                             android:layout_width="wrap_content"
107                             android:layout_height="wrap_content"
108                             android:text="dummy version"
109                             tools:ignore="HardcodedText" />
110                     </LinearLayout>
111
112                 </LinearLayout>
113
114                 <LinearLayout
115                     android:id="@+id/nav_actions"
116                     android:layout_width="match_parent"
117                     android:layout_height="match_parent"
118                     android:orientation="vertical">
119
120                     <TextView
121                         android:id="@+id/nav_account_summary"
122                         style="@style/nav_button"
123                         android:drawableStart="@drawable/ic_home_black_24dp"
124                         android:onClick="onAccountSummaryClicked"
125                         android:text="@string/account_summary_title" />
126
127                     <TextView
128                         android:id="@+id/nav_latest_transactions"
129                         style="@style/nav_button"
130                         android:drawableStart="@drawable/ic_event_note_black_24dp"
131                         android:onClick="onLatestTransactionsClicked"
132                         android:text="@string/nav_latest_transactions_title" />
133
134                     <TextView
135                         android:id="@+id/textView5"
136                         style="@style/nav_button"
137                         android:drawableStart="@drawable/ic_assignment_black_24dp"
138                         android:text="@string/nav_reports_title"
139                         android:visibility="gone" />
140
141                     <include
142                         android:id="@+id/nav_profile_list_head_layout"
143                         layout="@layout/nav_profile_list_head" />
144
145                     <LinearLayout
146                         android:id="@+id/nav_profile_list_container"
147                         android:layout_width="match_parent"
148                         android:layout_height="wrap_content"
149                         android:animateLayoutChanges="true"
150                         android:nestedScrollingEnabled="false"
151                         android:orientation="vertical"
152                         android:visibility="gone">
153
154                         <androidx.recyclerview.widget.RecyclerView
155                             android:id="@+id/nav_profile_list"
156                             android:layout_width="match_parent"
157                             android:layout_height="wrap_content"
158                             android:isScrollContainer="false"
159                             android:nestedScrollingEnabled="false"
160                             android:orientation="vertical"
161                             android:paddingStart="0dp">
162
163                         </androidx.recyclerview.widget.RecyclerView>
164
165                         <include layout="@layout/nav_profile_list_new_profile_row" />
166                     </LinearLayout>
167
168                 </LinearLayout>
169
170             </LinearLayout>
171         </ScrollView>
172
173     </androidx.constraintlayout.widget.ConstraintLayout>
174
175 </com.google.android.material.navigation.NavigationView>