]> git.ktnx.net Git - mobile-ledger.git/blob - app/src/main/res/layout/new_transaction_row.xml
new transaction: bigger currency button area
[mobile-ledger.git] / app / src / main / res / layout / new_transaction_row.xml
1 <?xml version="1.0" encoding="utf-8"?><!--
2   ~ Copyright © 2021 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 <LinearLayout 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:layout_width="match_parent"
22     android:layout_height="wrap_content"
23     android:animateLayoutChanges="true"
24     android:orientation="vertical"
25     >
26
27     <androidx.constraintlayout.widget.ConstraintLayout
28         android:id="@+id/ntr_data"
29         android:layout_width="match_parent"
30         android:layout_height="wrap_content"
31         android:animateLayoutChanges="true"
32         android:orientation="horizontal"
33         >
34
35         <TextView
36             android:id="@+id/dummy_text"
37             android:layout_width="wrap_content"
38             android:layout_height="wrap_content"
39             android:visibility="gone"
40             tools:ignore="MissingConstraints"
41             />
42         <EditText
43             android:id="@+id/new_transaction_date"
44             android:layout_width="94dp"
45             android:layout_height="wrap_content"
46             android:accessibilityTraversalBefore="@+id/new_transaction_description"
47             android:drawableStart="@drawable/ic_event_gray_24dp"
48             android:enabled="true"
49             android:focusable="false"
50             android:gravity="bottom|center"
51             android:hint="@string/new_transaction_date_hint"
52             android:inputType="none"
53             android:nextFocusDown="@+id/new_transaction_acc_1"
54             android:nextFocusForward="@+id/new_transaction_description"
55             android:textAlignment="gravity"
56             android:textCursorDrawable="@android:color/transparent"
57             app:layout_constrainedHeight="true"
58             app:layout_constraintHorizontal_weight="8"
59             app:layout_constraintStart_toStartOf="parent"
60             app:layout_constraintTop_toTopOf="parent"
61             tools:ignore="TextFields"
62             />
63
64         <net.ktnx.mobileledger.ui.AutoCompleteTextViewWithClear
65             android:id="@+id/new_transaction_description"
66             android:layout_width="0dp"
67             android:layout_height="wrap_content"
68             android:layout_gravity="bottom"
69             android:layout_marginStart="8dp"
70             android:accessibilityTraversalAfter="@+id/new_transaction_date"
71             android:foregroundGravity="bottom"
72             android:gravity="bottom"
73             android:hint="@string/new_transaction_description_hint"
74             android:imeOptions="actionNext"
75             android:inputType="text"
76             android:nextFocusLeft="@+id/new_transaction_date"
77             android:nextFocusUp="@+id/new_transaction_date"
78             android:selectAllOnFocus="false"
79             android:singleLine="true"
80             app:layout_constraintEnd_toEndOf="parent"
81             app:layout_constraintHorizontal_weight="30"
82             app:layout_constraintStart_toEndOf="@id/new_transaction_date"
83             app:layout_constraintTop_toTopOf="parent"
84             />
85
86         <androidx.constraintlayout.widget.ConstraintLayout
87             android:id="@+id/transaction_comment_layout"
88             android:layout_width="0dp"
89             android:layout_height="wrap_content"
90             app:layout_constraintEnd_toEndOf="parent"
91             app:layout_constraintStart_toStartOf="parent"
92             app:layout_constraintTop_toBottomOf="@id/new_transaction_description"
93             >
94
95             <TextView
96                 android:id="@+id/comment_button"
97                 android:layout_width="wrap_content"
98                 android:layout_height="wrap_content"
99                 android:background="@drawable/ic_comment_gray_24dp"
100                 app:layout_constraintBottom_toBottomOf="parent"
101                 app:layout_constraintStart_toStartOf="parent"
102                 app:layout_constraintTop_toTopOf="parent"
103                 />
104
105             <net.ktnx.mobileledger.ui.EditTextWithClear
106                 android:id="@+id/transaction_comment"
107                 android:layout_width="0dp"
108                 android:layout_height="wrap_content"
109                 android:imeOptions="actionNext"
110                 android:inputType="text"
111                 android:visibility="invisible"
112                 app:layout_constraintEnd_toEndOf="parent"
113                 app:layout_constraintStart_toEndOf="@id/comment_button"
114                 app:layout_constraintTop_toTopOf="parent"
115                 />
116         </androidx.constraintlayout.widget.ConstraintLayout>
117
118     </androidx.constraintlayout.widget.ConstraintLayout>
119
120     <androidx.constraintlayout.widget.ConstraintLayout
121         android:id="@+id/ntr_account"
122         android:layout_width="match_parent"
123         android:layout_height="wrap_content"
124         android:animateLayoutChanges="true"
125         >
126
127         <net.ktnx.mobileledger.ui.AutoCompleteTextViewWithClear
128             android:id="@+id/account_row_acc_name"
129             android:layout_width="0dp"
130             android:layout_height="wrap_content"
131             android:layout_weight="9"
132             android:width="0dp"
133             android:hint="@string/new_transaction_account_hint"
134             android:imeOptions="actionNext"
135             android:inputType="text"
136             android:selectAllOnFocus="false"
137             app:layout_constraintEnd_toEndOf="parent"
138             app:layout_constraintStart_toStartOf="parent"
139             app:layout_constraintTop_toTopOf="parent"
140             />
141
142         <androidx.constraintlayout.widget.ConstraintLayout
143             android:id="@+id/comment_layout"
144             android:layout_width="0dp"
145             android:layout_height="wrap_content"
146             app:layout_constraintEnd_toStartOf="@id/amount_layout"
147             app:layout_constraintStart_toStartOf="parent"
148             app:layout_constraintTop_toBottomOf="@id/account_row_acc_name"
149             >
150
151             <TextView
152                 android:id="@id/comment_button"
153                 android:layout_width="wrap_content"
154                 android:layout_height="wrap_content"
155                 android:background="@drawable/ic_comment_gray_24dp"
156                 app:layout_constraintBottom_toBottomOf="parent"
157                 app:layout_constraintStart_toStartOf="parent"
158                 app:layout_constraintTop_toTopOf="parent"
159                 />
160
161             <net.ktnx.mobileledger.ui.EditTextWithClear
162                 android:id="@+id/comment"
163                 android:layout_width="0dp"
164                 android:layout_height="wrap_content"
165                 android:imeOptions="actionNext"
166                 android:inputType="text"
167                 android:visibility="invisible"
168                 app:layout_constraintEnd_toEndOf="parent"
169                 app:layout_constraintStart_toEndOf="@id/comment_button"
170                 app:layout_constraintTop_toTopOf="parent"
171                 />
172         </androidx.constraintlayout.widget.ConstraintLayout>
173
174         <androidx.constraintlayout.widget.ConstraintLayout
175             android:id="@+id/amount_layout"
176             android:layout_width="wrap_content"
177             android:layout_height="wrap_content"
178             app:layout_constraintEnd_toEndOf="parent"
179             app:layout_constraintTop_toBottomOf="@id/account_row_acc_name"
180             >
181
182             <TextView
183                 android:id="@+id/currencyButton"
184                 android:layout_width="wrap_content"
185                 android:layout_height="0dp"
186                 android:minWidth="30dp"
187                 app:layout_constraintBottom_toBottomOf="parent"
188                 app:layout_constraintEnd_toEndOf="@id/currency"
189                 app:layout_constraintStart_toStartOf="@id/currency"
190                 app:layout_constraintTop_toTopOf="parent"
191                 />
192             <EditText
193                 android:id="@+id/account_row_acc_amounts"
194                 android:layout_width="wrap_content"
195                 android:layout_height="wrap_content"
196                 android:layout_gravity="bottom|end"
197                 android:layout_weight="0"
198                 android:width="0dp"
199                 android:foregroundGravity="bottom"
200                 android:gravity="bottom|end"
201                 android:hint="@string/zero_amount"
202                 android:imeOptions="actionNext"
203                 android:inputType="number|numberSigned|numberDecimal"
204                 android:minEms="4"
205                 android:selectAllOnFocus="true"
206                 android:textAlignment="viewEnd"
207                 app:layout_constraintBottom_toBottomOf="parent"
208                 app:layout_constraintLeft_toLeftOf="parent"
209                 app:layout_constraintRight_toLeftOf="@id/currency"
210                 app:layout_constraintTop_toTopOf="parent"
211                 app:layout_constraintWidth_min="@dimen/text_margin"
212                 />
213
214             <TextView
215                 android:id="@+id/currency"
216                 style="@style/TextAppearance.AppCompat.Widget.Button"
217                 android:layout_width="wrap_content"
218                 android:layout_height="wrap_content"
219                 android:layout_gravity="center_vertical"
220                 android:gravity="center_horizontal"
221                 android:minWidth="30dp"
222                 android:text="@string/currency_symbol"
223                 android:textAllCaps="false"
224                 app:layout_constraintBottom_toBottomOf="parent"
225                 app:layout_constraintRight_toRightOf="parent"
226                 app:layout_constraintTop_toTopOf="parent"
227                 />
228         </androidx.constraintlayout.widget.ConstraintLayout>
229
230     </androidx.constraintlayout.widget.ConstraintLayout>
231
232     <FrameLayout
233         android:id="@+id/ntr_padding"
234         android:layout_width="match_parent"
235         android:layout_height="80dp"
236         android:minHeight="80dp"
237         >
238
239     </FrameLayout>
240
241 </LinearLayout>