]> git.ktnx.net Git - mobile-ledger.git/blob - app/src/main/res/layout/content_new_transaction.xml
improved layout on multi-line account names
[mobile-ledger.git] / app / src / main / res / layout / content_new_transaction.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3     xmlns:app="http://schemas.android.com/apk/res-auto"
4     xmlns:tools="http://schemas.android.com/tools"
5     android:layout_width="match_parent"
6     android:layout_height="match_parent"
7     app:layout_behavior="@string/appbar_scrolling_view_behavior"
8     tools:context=".NewTransactionActivity"
9     tools:showIn="@layout/activity_new_transaction">
10
11     <ScrollView
12         android:id="@+id/transaction_details"
13         android:layout_width="match_parent"
14         android:layout_height="0dp"
15         app:layout_constraintEnd_toEndOf="parent"
16         app:layout_constraintStart_toStartOf="parent"
17         app:layout_constraintTop_toTopOf="parent">
18
19         <LinearLayout
20             android:layout_width="match_parent"
21             android:layout_height="wrap_content"
22             android:orientation="vertical">
23
24             <android.support.constraint.ConstraintLayout
25                 android:layout_width="match_parent"
26                 android:layout_height="match_parent">
27
28                 <EditText
29                     android:id="@+id/new_transaction_date"
30                     android:layout_width="94dp"
31                     android:layout_height="wrap_content"
32                     android:ems="10"
33                     android:hint="@string/new_transaction_date_hint"
34                     android:inputType="date"
35                     android:onClick="pickTransactionDate"
36                     android:textAlignment="center"
37                     app:layout_constraintHorizontal_weight="8"
38                     app:layout_constraintStart_toStartOf="parent"
39                     app:layout_constraintTop_toTopOf="parent" />
40
41                 <AutoCompleteTextView
42                     android:id="@+id/new_transaction_description"
43                     android:layout_width="0dp"
44                     android:layout_height="wrap_content"
45                     android:layout_marginStart="8dp"
46                     android:ems="10"
47                     android:hint="@string/new_transaction_description_hint"
48                     android:inputType="textPersonName"
49                     app:layout_constraintEnd_toEndOf="parent"
50                     app:layout_constraintHorizontal_weight="30"
51                     app:layout_constraintStart_toEndOf="@+id/new_transaction_date"
52                     app:layout_constraintTop_toTopOf="parent" />
53             </android.support.constraint.ConstraintLayout>
54
55             <TableLayout
56                 android:id="@+id/new_transaction_accounts_table"
57                 android:layout_width="match_parent"
58                 android:layout_height="match_parent">
59
60                 <TableRow
61                     android:layout_width="match_parent"
62                     android:layout_height="match_parent">
63
64                     <AutoCompleteTextView
65                         android:id="@+id/new_transaction_acc_1"
66                         android:layout_width="match_parent"
67                         android:layout_height="wrap_content"
68                         android:layout_gravity="bottom"
69                         android:layout_weight="9"
70                         android:width="0dp"
71                         android:hint="@string/new_transaction_account_hint"
72                         android:nextFocusDown="@id/new_transaction_amt_1"
73                         android:nextFocusForward="@id/new_transaction_amt_1"
74                         android:text="This is a sample account name, deliberately long" />
75
76                     <EditText
77                         android:id="@+id/new_transaction_amt_1"
78                         android:layout_width="wrap_content"
79                         android:layout_height="match_parent"
80                         android:layout_gravity="bottom"
81                         android:layout_weight="1"
82                         android:width="0dp"
83                         android:hint="@string/new_transaction_amount_hint"
84                         android:inputType="numberDecimal|numberSigned"
85                         android:minWidth="40dp"
86                         android:nextFocusDown="@id/new_transaction_acc_2"
87                         android:nextFocusForward="@id/new_transaction_acc_2"
88                         android:textAlignment="viewEnd" />
89                 </TableRow>
90
91                 <TableRow
92                     android:layout_width="match_parent"
93                     android:layout_height="match_parent">
94
95                     <AutoCompleteTextView
96                         android:id="@+id/new_transaction_acc_2"
97                         android:layout_width="match_parent"
98                         android:layout_height="wrap_content"
99                         android:layout_gravity="bottom"
100                         android:layout_weight="9"
101                         android:width="0dp"
102                         android:hint="@string/new_transaction_account_hint"
103                         android:nextFocusDown="@id/new_transaction_amt_2"
104                         android:nextFocusForward="@id/new_transaction_amt_2" />
105
106                     <EditText
107                         android:id="@+id/new_transaction_amt_2"
108                         android:layout_width="wrap_content"
109                         android:layout_height="wrap_content"
110                         android:layout_gravity="bottom"
111                         android:layout_weight="1"
112                         android:width="0dp"
113                         android:hint="@string/new_transaction_amount_hint"
114                         android:inputType="numberDecimal|numberSigned"
115                         android:minWidth="40dp"
116                         android:textAlignment="viewEnd" />
117                 </TableRow>
118
119             </TableLayout>
120
121         </LinearLayout>
122     </ScrollView>
123
124 </android.support.constraint.ConstraintLayout>