]> git.ktnx.net Git - mobile-ledger.git/blob - app/src/main/res/layout/new_transaction_row.xml
rework comments: add clear icon, italics, visible when populated, grayed-out when...
[mobile-ledger.git] / app / src / main / res / layout / new_transaction_row.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 <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="false"
24     android:orientation="vertical">
25
26     <LinearLayout
27         android:id="@+id/ntr_data"
28         android:layout_width="match_parent"
29         android:layout_height="wrap_content">
30
31         <EditText
32             android:id="@+id/new_transaction_date"
33             android:layout_width="94dp"
34             android:layout_height="wrap_content"
35             android:accessibilityTraversalBefore="@+id/new_transaction_description"
36             android:drawableStart="@drawable/ic_event_gray_24dp"
37             android:ems="10"
38             android:enabled="true"
39             android:focusable="false"
40             android:gravity="bottom|center"
41             android:hint="@string/new_transaction_date_hint"
42             android:inputType="none"
43             android:nextFocusDown="@+id/new_transaction_acc_1"
44             android:nextFocusForward="@+id/new_transaction_description"
45             android:textAlignment="gravity"
46             android:textCursorDrawable="@android:color/transparent"
47             app:layout_constrainedHeight="true"
48             app:layout_constraintBottom_toBottomOf="parent"
49             app:layout_constraintHorizontal_weight="8"
50             app:layout_constraintStart_toStartOf="parent"
51             app:layout_constraintTop_toTopOf="parent"
52             tools:ignore="TextFields" />
53
54         <net.ktnx.mobileledger.ui.AutoCompleteTextViewWithClear
55             android:id="@+id/new_transaction_description"
56             android:layout_width="match_parent"
57             android:layout_height="wrap_content"
58             android:layout_gravity="bottom"
59             android:layout_marginStart="8dp"
60             android:accessibilityTraversalAfter="@+id/new_transaction_date"
61             android:ems="10"
62             android:foregroundGravity="bottom"
63             android:gravity="bottom"
64             android:hint="@string/new_transaction_description_hint"
65             android:imeOptions="actionNext"
66             android:inputType="text"
67             android:nextFocusLeft="@+id/new_transaction_date"
68             android:nextFocusUp="@+id/new_transaction_date"
69             android:selectAllOnFocus="false"
70             android:singleLine="true"
71             app:layout_constraintBottom_toBottomOf="parent"
72             app:layout_constraintEnd_toEndOf="parent"
73             app:layout_constraintHorizontal_weight="30"
74             app:layout_constraintStart_toEndOf="@+id/new_transaction_date"
75             app:layout_constraintTop_toTopOf="parent" />
76     </LinearLayout>
77
78     <androidx.constraintlayout.widget.ConstraintLayout
79         android:id="@+id/ntr_account"
80         android:layout_width="match_parent"
81         android:layout_height="wrap_content"
82         android:animateLayoutChanges="true">
83
84         <net.ktnx.mobileledger.ui.AutoCompleteTextViewWithClear
85             android:id="@+id/account_row_acc_name"
86             android:layout_width="0dp"
87             android:layout_height="wrap_content"
88             android:layout_weight="9"
89             android:width="0dp"
90             android:hint="@string/new_transaction_account_hint"
91             android:imeOptions="actionNext"
92             android:inputType="text"
93             android:selectAllOnFocus="false"
94             app:layout_constraintEnd_toEndOf="parent"
95             app:layout_constraintStart_toStartOf="parent"
96             app:layout_constraintTop_toTopOf="parent" />
97
98         <androidx.constraintlayout.widget.ConstraintLayout
99             android:id="@+id/comment_layout"
100             android:layout_width="0dp"
101             android:layout_height="wrap_content"
102             android:alpha="0.50"
103             app:layout_constraintEnd_toStartOf="@id/amount_layout"
104             app:layout_constraintStart_toStartOf="parent"
105             app:layout_constraintTop_toBottomOf="@id/account_row_acc_name">
106
107             <TextView
108                 android:id="@+id/comment_button"
109                 android:layout_width="wrap_content"
110                 android:layout_height="wrap_content"
111                 android:background="@drawable/ic_comment_gray_24dp"
112                 app:layout_constraintBottom_toBottomOf="parent"
113                 app:layout_constraintStart_toStartOf="parent"
114                 app:layout_constraintTop_toTopOf="parent" />
115
116             <net.ktnx.mobileledger.ui.EditTextWithClear
117                 android:id="@+id/comment"
118                 android:layout_width="0dp"
119                 android:layout_height="wrap_content"
120                 android:imeOptions="actionNext"
121                 android:inputType="text"
122                 android:visibility="invisible"
123                 app:layout_constraintEnd_toEndOf="parent"
124                 app:layout_constraintStart_toEndOf="@id/comment_button"
125                 app:layout_constraintTop_toTopOf="parent" />
126         </androidx.constraintlayout.widget.ConstraintLayout>
127
128         <androidx.constraintlayout.widget.ConstraintLayout
129             android:id="@+id/amount_layout"
130             android:layout_width="wrap_content"
131             android:layout_height="wrap_content"
132             app:layout_constraintEnd_toEndOf="parent"
133             app:layout_constraintTop_toBottomOf="@id/account_row_acc_name">
134
135             <EditText
136                 android:id="@+id/account_row_acc_amounts"
137                 android:layout_width="wrap_content"
138                 android:layout_height="wrap_content"
139                 android:layout_gravity="bottom|end"
140                 android:layout_weight="0"
141                 android:width="0dp"
142                 android:foregroundGravity="bottom"
143                 android:gravity="bottom|end"
144                 android:hint="@string/zero_amount"
145                 android:imeOptions="actionNext"
146                 android:inputType="numberSigned|numberDecimal|number"
147                 android:minWidth="80sp"
148                 android:selectAllOnFocus="true"
149                 android:textAlignment="viewEnd"
150                 app:layout_constraintBottom_toBottomOf="parent"
151                 app:layout_constraintLeft_toLeftOf="parent"
152                 app:layout_constraintRight_toLeftOf="@id/currency"
153                 app:layout_constraintTop_toTopOf="parent"
154                 app:layout_constraintWidth_min="@dimen/text_margin" />
155
156             <TextView
157                 android:id="@+id/currency"
158                 style="@style/TextAppearance.AppCompat.Widget.Button"
159                 android:layout_width="wrap_content"
160                 android:layout_height="wrap_content"
161                 android:layout_gravity="center_vertical"
162                 android:gravity="center_horizontal"
163                 android:minWidth="24dp"
164                 android:text="@string/currency_symbol"
165                 android:textAllCaps="false"
166                 android:visibility="gone"
167                 app:layout_constraintBottom_toBottomOf="parent"
168                 app:layout_constraintRight_toRightOf="parent"
169                 app:layout_constraintTop_toTopOf="parent" />
170         </androidx.constraintlayout.widget.ConstraintLayout>
171
172     </androidx.constraintlayout.widget.ConstraintLayout>
173
174     <FrameLayout
175         android:id="@+id/ntr_padding"
176         android:layout_width="match_parent"
177         android:layout_height="80dp"
178         android:minHeight="80dp">
179
180     </FrameLayout>
181
182 </LinearLayout>