]> git.ktnx.net Git - mobile-ledger.git/blob - app/src/main/res/layout/new_transaction_row.xml
NT: keep cursor position while setting account name text
[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             android:animateLayoutChanges="true"
91             app:layout_constraintEnd_toEndOf="parent"
92             app:layout_constraintStart_toStartOf="parent"
93             app:layout_constraintTop_toBottomOf="@id/new_transaction_description"
94             >
95
96             <TextView
97                 android:id="@+id/transaction_comment_button"
98                 android:layout_width="wrap_content"
99                 android:layout_height="wrap_content"
100                 android:background="@drawable/ic_comment_gray_24dp"
101                 app:layout_constraintBottom_toBottomOf="parent"
102                 app:layout_constraintStart_toStartOf="parent"
103                 app:layout_constraintTop_toTopOf="parent"
104                 />
105
106             <net.ktnx.mobileledger.ui.EditTextWithClear
107                 android:id="@+id/transaction_comment"
108                 android:layout_width="0dp"
109                 android:layout_height="wrap_content"
110                 android:imeOptions="actionNext"
111                 android:inputType="text"
112                 android:visibility="invisible"
113                 app:layout_constraintEnd_toEndOf="parent"
114                 app:layout_constraintStart_toEndOf="@id/transaction_comment_button"
115                 app:layout_constraintTop_toTopOf="parent"
116                 />
117         </androidx.constraintlayout.widget.ConstraintLayout>
118
119     </androidx.constraintlayout.widget.ConstraintLayout>
120
121     <androidx.constraintlayout.widget.ConstraintLayout
122         android:id="@+id/ntr_account"
123         android:layout_width="match_parent"
124         android:layout_height="wrap_content"
125         android:animateLayoutChanges="true"
126         >
127
128         <net.ktnx.mobileledger.ui.AutoCompleteTextViewWithClear
129             android:id="@+id/account_row_acc_name"
130             android:layout_width="0dp"
131             android:layout_height="wrap_content"
132             android:layout_weight="9"
133             android:width="0dp"
134             android:hint="@string/new_transaction_account_hint"
135             android:imeOptions="actionNext"
136             android:inputType="text"
137             android:selectAllOnFocus="false"
138             app:layout_constraintEnd_toEndOf="parent"
139             app:layout_constraintStart_toStartOf="parent"
140             app:layout_constraintTop_toTopOf="parent"
141             />
142
143         <androidx.constraintlayout.widget.ConstraintLayout
144             android:id="@+id/comment_layout"
145             android:layout_width="0dp"
146             android:layout_height="wrap_content"
147             android:animateLayoutChanges="true"
148             app:layout_constraintEnd_toStartOf="@id/amount_layout"
149             app:layout_constraintStart_toStartOf="parent"
150             app:layout_constraintTop_toBottomOf="@id/account_row_acc_name"
151             >
152
153             <TextView
154                 android:id="@+id/account_comment_button"
155                 android:layout_width="wrap_content"
156                 android:layout_height="wrap_content"
157                 android:background="@drawable/ic_comment_gray_24dp"
158                 app:layout_constraintBottom_toBottomOf="parent"
159                 app:layout_constraintStart_toStartOf="parent"
160                 app:layout_constraintTop_toTopOf="parent"
161                 />
162
163             <net.ktnx.mobileledger.ui.EditTextWithClear
164                 android:id="@+id/comment"
165                 android:layout_width="0dp"
166                 android:layout_height="wrap_content"
167                 android:imeOptions="actionNext"
168                 android:inputType="text"
169                 android:visibility="invisible"
170                 app:layout_constraintEnd_toEndOf="parent"
171                 app:layout_constraintStart_toEndOf="@id/account_comment_button"
172                 app:layout_constraintTop_toTopOf="parent"
173                 />
174         </androidx.constraintlayout.widget.ConstraintLayout>
175
176         <androidx.constraintlayout.widget.ConstraintLayout
177             android:id="@+id/amount_layout"
178             android:layout_width="wrap_content"
179             android:layout_height="wrap_content"
180             android:animateLayoutChanges="true"
181             app:layout_constraintEnd_toEndOf="parent"
182             app:layout_constraintTop_toBottomOf="@id/account_row_acc_name"
183             >
184
185             <TextView
186                 android:id="@+id/currencyButton"
187                 android:layout_width="wrap_content"
188                 android:layout_height="0dp"
189                 android:minWidth="30dp"
190                 app:layout_constraintBottom_toBottomOf="parent"
191                 app:layout_constraintEnd_toEndOf="@id/currency"
192                 app:layout_constraintStart_toStartOf="@id/currency"
193                 app:layout_constraintTop_toTopOf="parent"
194                 />
195             <EditText
196                 android:id="@+id/account_row_acc_amounts"
197                 android:layout_width="wrap_content"
198                 android:layout_height="wrap_content"
199                 android:layout_gravity="bottom|end"
200                 android:layout_weight="0"
201                 android:width="0dp"
202                 android:foregroundGravity="bottom"
203                 android:gravity="bottom|end"
204                 android:hint="@string/zero_amount"
205                 android:imeOptions="actionNext"
206                 android:inputType="number|numberSigned|numberDecimal"
207                 android:minEms="4"
208                 android:selectAllOnFocus="true"
209                 android:textAlignment="viewEnd"
210                 app:layout_constraintBottom_toBottomOf="parent"
211                 app:layout_constraintLeft_toLeftOf="parent"
212                 app:layout_constraintRight_toLeftOf="@id/currency"
213                 app:layout_constraintTop_toTopOf="parent"
214                 app:layout_constraintWidth_min="@dimen/text_margin"
215                 />
216
217             <TextView
218                 android:id="@+id/currency"
219                 style="@style/TextAppearance.AppCompat.Widget.Button"
220                 android:layout_width="wrap_content"
221                 android:layout_height="wrap_content"
222                 android:layout_gravity="center_vertical"
223                 android:gravity="center_horizontal"
224                 android:minWidth="30dp"
225                 android:text="@string/currency_symbol"
226                 android:textAllCaps="false"
227                 app:layout_constraintBottom_toBottomOf="parent"
228                 app:layout_constraintRight_toRightOf="parent"
229                 app:layout_constraintTop_toTopOf="parent"
230                 />
231         </androidx.constraintlayout.widget.ConstraintLayout>
232
233     </androidx.constraintlayout.widget.ConstraintLayout>
234
235 </LinearLayout>