]> git.ktnx.net Git - mobile-ledger.git/blob - app/src/main/res/layout/activity_main.xml
pad last update label from the left
[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="auto"
120                         android:onClick="onStopTransactionRefreshClick" />
121                 </LinearLayout>
122
123             </LinearLayout>
124
125             <FrameLayout
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
132             </FrameLayout>
133
134             <View
135                 android:layout_width="0dp"
136                 android:layout_height="4dp"
137                 android:background="@drawable/drop_shadow"
138                 app:layout_constraintTop_toBottomOf="@id/main_header" />
139
140         </android.support.constraint.ConstraintLayout>
141
142
143         <android.support.design.widget.NavigationView
144             android:id="@+id/nav_view"
145             android:layout_width="wrap_content"
146             android:layout_height="match_parent"
147             android:layout_gravity="start"
148             android:fitsSystemWindows="true"
149             android:theme="@style/ThemeOverlay.AppCompat.Light">
150
151             <ScrollView
152                 android:layout_width="match_parent"
153                 android:layout_height="match_parent"
154                 android:scrollbars="vertical"
155                 app:layout_constraintBottom_toBottomOf="parent"
156                 app:layout_constraintTop_toTopOf="parent">
157
158                 <android.support.constraint.ConstraintLayout
159                     android:layout_width="match_parent"
160                     android:layout_height="wrap_content"
161                     android:layout_marginBottom="0dp"
162                     android:orientation="vertical">
163
164                     <LinearLayout
165                         android:id="@+id/nav_header"
166                         android:layout_width="match_parent"
167                         android:layout_height="wrap_content"
168                         android:background="@drawable/side_nav_bar"
169                         android:gravity="bottom"
170                         android:orientation="vertical"
171                         android:paddingLeft="@dimen/activity_horizontal_margin"
172                         android:paddingTop="@dimen/activity_vertical_margin"
173                         android:paddingRight="@dimen/activity_horizontal_margin"
174                         android:paddingBottom="@dimen/activity_vertical_margin"
175                         android:theme="@style/ThemeOverlay.AppCompat.Dark"
176                         app:layout_constraintTop_toTopOf="parent">
177
178                         <ImageView
179                             android:id="@+id/imageView"
180                             android:layout_width="wrap_content"
181                             android:layout_height="wrap_content"
182                             android:contentDescription="@string/nav_header_desc"
183                             android:paddingTop="@dimen/nav_header_vertical_spacing"
184                             app:srcCompat="@mipmap/ic_launcher_round" />
185
186                         <TextView
187                             android:layout_width="match_parent"
188                             android:layout_height="wrap_content"
189                             android:paddingTop="@dimen/nav_header_vertical_spacing"
190                             android:text="@string/app_name"
191                             android:textAppearance="@style/TextAppearance.AppCompat.Body1" />
192
193                         <TextView
194                             android:id="@+id/drawer_version_text"
195                             android:layout_width="wrap_content"
196                             android:layout_height="wrap_content"
197                             android:text="@string/nav_header_subtitle" />
198
199                     </LinearLayout>
200
201                     <LinearLayout
202                         android:id="@+id/nav_actions"
203                         android:layout_width="match_parent"
204                         android:layout_height="wrap_content"
205                         android:orientation="vertical"
206                         app:layout_constraintBottom_toTopOf="@+id/nav_fixed_items"
207                         app:layout_constraintTop_toBottomOf="@+id/nav_header">
208
209                         <TextView
210                             android:id="@+id/nav_account_summary"
211                             style="@style/nav_button"
212                             android:drawableStart="@drawable/ic_home_black_24dp"
213                             android:onClick="onAccountSummaryClicked"
214                             android:text="@string/account_summary_title" />
215
216                         <TextView
217                             android:id="@+id/nav_latest_transactions"
218                             style="@style/nav_button"
219                             android:drawableStart="@drawable/ic_event_note_black_24dp"
220                             android:onClick="onLatestTransactionsClicked"
221                             android:text="@string/nav_latest_transactions_title" />
222
223                         <TextView
224                             android:id="@+id/textView5"
225                             style="@style/nav_button"
226                             android:drawableStart="@drawable/ic_assignment_black_24dp"
227                             android:text="@string/nav_reports_title" />
228
229                     </LinearLayout>
230
231                     <LinearLayout
232                         android:id="@+id/nav_fixed_items"
233                         android:layout_width="match_parent"
234                         android:layout_height="wrap_content"
235                         android:divider="@drawable/list_divider"
236                         android:elevation="2dp"
237                         android:orientation="vertical"
238                         android:showDividers="beginning"
239                         app:layout_constraintBottom_toBottomOf="parent">
240
241                         <TextView
242                             android:id="@+id/textView2"
243                             style="@style/nav_button"
244                             android:layout_weight="1"
245                             android:drawableStart="@drawable/ic_settings_black_24dp"
246                             android:onClick="nav_settings_clicked"
247                             android:text="@string/action_settings" />
248
249                         <TextView
250                             android:id="@+id/nav_exit"
251                             style="@style/nav_button"
252                             android:layout_weight="1"
253                             android:drawableStart="@drawable/ic_exit_to_app_black_24dp"
254                             android:onClick="nav_exit_clicked"
255                             android:text="@string/nav_exit_title" />
256
257                     </LinearLayout>
258
259                 </android.support.constraint.ConstraintLayout>
260             </ScrollView>
261
262         </android.support.design.widget.NavigationView>
263
264     </android.support.v4.widget.DrawerLayout>
265 </LinearLayout>