]> git.ktnx.net Git - mobile-ledger-staging.git/blob - app/src/main/res/layout/main_app_layout.xml
migrate from ViewPager to ViewPager2
[mobile-ledger-staging.git] / app / src / main / res / layout / main_app_layout.xml
1 <?xml version="1.0" encoding="utf-8"?><!--
2   ~ Copyright © 2020 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 <androidx.coordinatorlayout.widget.CoordinatorLayout 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/main_app_layout"
22     android:layout_width="match_parent"
23     android:layout_height="match_parent"
24     android:background="?android:attr/colorBackground"
25     android:orientation="vertical"
26     tools:context=".ui.activity.MainActivity">
27
28
29     <com.google.android.material.floatingactionbutton.FloatingActionButton
30         android:id="@+id/btn_add_transaction"
31         android:layout_width="wrap_content"
32         android:layout_height="wrap_content"
33         android:layout_gravity="bottom|end"
34         android:layout_margin="@dimen/fab_margin"
35         app:backgroundTint="?colorSecondary"
36         app:layout_constraintBottom_toBottomOf="parent"
37         app:layout_constraintEnd_toEndOf="parent"
38         app:maxImageSize="36dp"
39         app:srcCompat="@drawable/ic_add_white_24dp"
40         android:contentDescription="@string/new_transaction_fab_description"
41         />
42
43     <androidx.drawerlayout.widget.DrawerLayout
44         android:id="@+id/drawer_layout"
45         android:layout_width="match_parent"
46         android:layout_height="match_parent"
47         tools:openDrawer="start">
48
49         <androidx.constraintlayout.widget.ConstraintLayout
50             android:id="@+id/pager_layout"
51             android:layout_width="match_parent"
52             android:layout_height="match_parent">
53
54             <androidx.appcompat.widget.Toolbar
55                 android:id="@+id/toolbar"
56                 android:layout_width="match_parent"
57                 android:layout_height="@dimen/toolbar_height"
58                 android:background="?colorPrimary"
59                 android:theme="@style/AppTheme.AppBarOverlay"
60                 app:popupTheme="@style/AppTheme.PopupOverlay"
61                 app:layout_constraintTop_toTopOf="parent"
62                 app:layout_constraintStart_toStartOf="parent"
63                 app:layout_constraintEnd_toEndOf="parent"/>
64
65             <LinearLayout
66                 android:id="@+id/main_header"
67                 android:layout_width="match_parent"
68                 android:layout_height="wrap_content"
69                 android:orientation="vertical"
70                 app:layout_constraintEnd_toEndOf="parent"
71                 app:layout_constraintStart_toStartOf="parent"
72                 app:layout_constraintTop_toBottomOf="@id/toolbar">
73
74                 <LinearLayout
75                     android:id="@+id/transaction_progress_layout"
76                     android:layout_width="match_parent"
77                     android:layout_height="wrap_content"
78                     android:gravity="center_vertical"
79                     android:orientation="horizontal"
80                     android:visibility="gone">
81
82                     <ProgressBar
83                         android:id="@+id/transaction_list_progress_bar"
84                         style="?android:attr/progressBarStyleHorizontal"
85                         android:layout_width="0dp"
86                         android:layout_height="wrap_content"
87                         android:layout_marginTop="-8dp"
88                         android:layout_marginBottom="-7dp"
89                         android:layout_weight="1"
90                         android:indeterminate="true"
91                         android:padding="0dp"
92                         android:min="0"
93                         android:progressTint="?colorPrimary"
94                         app:layout_constraintEnd_toEndOf="parent"
95                         app:layout_constraintStart_toStartOf="parent" />
96
97                     <TextView
98                         android:id="@+id/transaction_list_cancel_download"
99                         android:layout_width="wrap_content"
100                         android:layout_height="wrap_content"
101                         android:background="@drawable/ic_clear_accent_24dp"
102                         android:clickable="true"
103                         android:focusable="true"
104                         />
105                 </LinearLayout>
106
107             </LinearLayout>
108
109             <androidx.viewpager2.widget.ViewPager2
110                 android:id="@+id/root_frame"
111                 android:layout_width="match_parent"
112                 android:layout_height="0dp"
113                 app:layout_constraintBottom_toBottomOf="parent"
114                 app:layout_constraintEnd_toEndOf="parent"
115                 app:layout_constraintStart_toStartOf="parent"
116                 app:layout_constraintTop_toBottomOf="@+id/main_header">
117
118             </androidx.viewpager2.widget.ViewPager2>
119
120             <View
121                 android:layout_width="0dp"
122                 android:layout_height="?attr/main_header_shadow_height"
123                 android:background="@drawable/drop_shadow"
124                 app:layout_constraintEnd_toEndOf="parent"
125                 app:layout_constraintStart_toStartOf="parent"
126                 app:layout_constraintTop_toBottomOf="@id/main_header" />
127
128
129         </androidx.constraintlayout.widget.ConstraintLayout>
130
131         <include layout="@layout/main_navigation" />
132
133     </androidx.drawerlayout.widget.DrawerLayout>
134 </androidx.coordinatorlayout.widget.CoordinatorLayout>