]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/res/layout/content_new_transaction.xml
add license boilerplates for authored content
[mobile-ledger.git] / app / src / main / res / layout / content_new_transaction.xml
index f5cd330e72b28b1ba62f9568cebf09272e536c42..dd7e3ff7d9b6ee27dfad98dc14d090b1488093fb 100644 (file)
@@ -1,4 +1,21 @@
 <?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright © 2018 Damyan Ivanov.
+  ~ This file is part of Mobile-Ledger.
+  ~ Mobile-Ledger is free software: you can distribute it and/or modify it
+  ~ under the term of the GNU General Public License as published by
+  ~ the Free Software Foundation, either version 3 of the License, or
+  ~ (at your opinion), any later version.
+  ~
+  ~ Mobile-Ledger is distributed in the hope that it will be useful,
+  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+  ~ GNU General Public License terms for details.
+  ~
+  ~ You should have received a copy of the GNU General Public License
+  ~ along with Mobile-Ledger. If not, see <https://www.gnu.org/licenses/>.
+  -->
+
 <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
     tools:showIn="@layout/activity_new_transaction">
 
     <ScrollView
+        android:id="@+id/transaction_details"
         android:layout_width="match_parent"
-        android:layout_height="match_parent">
+        android:layout_height="0dp"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent">
 
         <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:orientation="vertical">
 
-            <EditText
-                android:id="@+id/new_transaction_date"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:ems="10"
-                android:hint="@string/new_transaction_date_hint"
-                android:inputType="date"
-                android:onClick="pickTransactionDate"
-                android:textAlignment="center" />
-
-            <LinearLayout
-                android:id="@+id/new_transaction_accounts"
+            <android.support.constraint.ConstraintLayout
                 android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:orientation="vertical">
-
-                <AutoCompleteTextView
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:layout_weight="1"
-                    android:hint="@string/new_transaction_account_label"
-                    android:text="" />
+                android:layout_height="match_parent">
 
                 <EditText
-                    android:layout_width="match_parent"
+                    android:id="@+id/new_transaction_date"
+                    android:layout_width="94dp"
+                    android:layout_height="0dp"
+                    android:accessibilityTraversalBefore="@+id/new_transaction_description"
+                    android:ems="10"
+                    android:foregroundGravity="bottom"
+                    android:gravity="bottom"
+                    android:hint="@string/new_transaction_date_hint"
+                    android:imeOptions="actionNext"
+                    android:inputType="date"
+                    android:nextFocusDown="@+id/new_transaction_acc_1"
+                    android:nextFocusForward="@+id/new_transaction_description"
+                    android:onClick="pickTransactionDate"
+                    android:textAlignment="center"
+                    app:layout_constrainedHeight="true"
+                    app:layout_constraintBottom_toBottomOf="parent"
+                    app:layout_constraintHorizontal_weight="8"
+                    app:layout_constraintStart_toStartOf="parent"
+                    app:layout_constraintTop_toTopOf="parent" />
+
+                <AutoCompleteTextView
+                    android:id="@+id/new_transaction_description"
+                    android:layout_width="0dp"
                     android:layout_height="wrap_content"
-                    android:layout_weight="1"
+                    android:layout_marginStart="8dp"
+                    android:accessibilityTraversalAfter="@+id/new_transaction_date"
+                    android:accessibilityTraversalBefore="@+id/new_transaction_acc_1"
                     android:ems="10"
-                    android:hint="@string/new_transaction_amount_hint"
-                    android:inputType="numberSigned|numberDecimal"
-                    android:textAlignment="viewEnd" />
-            </LinearLayout>
+                    android:hint="@string/new_transaction_description_hint"
+                    android:imeOptions="actionNext"
+                    android:nextFocusLeft="@+id/new_transaction_date"
+                    android:nextFocusRight="@+id/new_transaction_acc_1"
+                    android:nextFocusUp="@+id/new_transaction_date"
+                    android:nextFocusDown="@+id/new_transaction_acc_1"
+                    android:nextFocusForward="@+id/new_transaction_acc_1"
+                    android:singleLine="true"
+                    app:layout_constraintEnd_toEndOf="parent"
+                    app:layout_constraintHorizontal_weight="30"
+                    app:layout_constraintStart_toEndOf="@+id/new_transaction_date"
+                    app:layout_constraintTop_toTopOf="parent" />
+            </android.support.constraint.ConstraintLayout>
 
-            <LinearLayout
-                android:id="@+id/new_transaction_accounts"
+            <TableLayout
+                android:id="@+id/new_transaction_accounts_table"
                 android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:orientation="vertical">
+                android:layout_height="match_parent">
 
-                <AutoCompleteTextView
+                <TableRow
                     android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:layout_weight="1"
-                    android:hint="@string/new_transaction_account_label"
-                    android:text="" />
+                    android:layout_height="match_parent">
 
-                <EditText
+                    <AutoCompleteTextView
+                        android:id="@+id/new_transaction_acc_1"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="bottom"
+                        android:layout_weight="9"
+                        android:width="0dp"
+                        android:accessibilityTraversalAfter="@+id/new_transaction_description"
+                        android:accessibilityTraversalBefore="@+id/new_transaction_amt_1"
+                        android:hint="@string/new_transaction_account_hint"
+                        android:imeOptions="actionNext"
+                        android:nextFocusLeft="@+id/new_transaction_description"
+                        android:nextFocusRight="@+id/new_transaction_amt_1"
+                        android:nextFocusUp="@+id/new_transaction_description"
+                        android:nextFocusDown="@+id/new_transaction_amt_1"
+                        android:nextFocusForward="@+id/new_transaction_amt_1"
+                        android:singleLine="true" />
+
+                    <EditText
+                        android:id="@+id/new_transaction_amt_1"
+                        android:layout_width="wrap_content"
+                        android:layout_height="match_parent"
+                        android:layout_gravity="bottom"
+                        android:layout_weight="1"
+                        android:width="0dp"
+                        android:hint="@string/new_transaction_amount_hint"
+                        android:imeOptions="actionNext"
+                        android:inputType="numberDecimal|numberSigned"
+                        android:minWidth="40dp"
+                        android:accessibilityTraversalAfter="@+id/new_transaction_acc_1"
+                        android:accessibilityTraversalBefore="@+id/new_transaction_acc_2"
+                        android:nextFocusLeft="@+id/new_transaction_acc_1"
+                        android:nextFocusRight="@+id/new_transaction_acc_2"
+                        android:nextFocusUp="@+id/new_transaction_acc_1"
+                        android:nextFocusDown="@+id/new_transaction_acc_2"
+                        android:nextFocusForward="@+id/new_transaction_acc_2"
+                        android:textAlignment="viewEnd" />
+                </TableRow>
+
+                <TableRow
                     android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:layout_weight="1"
-                    android:ems="10"
-                    android:hint="@string/new_transaction_amount_hint"
-                    android:inputType="numberSigned|numberDecimal"
-                    android:textAlignment="viewEnd" />
-            </LinearLayout>
+                    android:layout_height="match_parent">
+
+                    <AutoCompleteTextView
+                        android:id="@+id/new_transaction_acc_2"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="bottom"
+                        android:layout_weight="9"
+                        android:width="0dp"
+                        android:accessibilityTraversalAfter="@+id/new_transaction_amt_1"
+                        android:accessibilityTraversalBefore="@+id/new_transaction_amt_2"
+                        android:hint="@string/new_transaction_account_hint"
+                        android:imeOptions="actionNext"
+                        android:nextFocusLeft="@+id/new_transaction_amt_1"
+                        android:nextFocusRight="@+id/new_transaction_amt_2"
+                        android:nextFocusUp="@+id/new_transaction_acc_1"
+                        android:nextFocusDown="@+id/new_transaction_amt_2"
+                        android:nextFocusForward="@+id/new_transaction_amt_2"
+                        android:singleLine="true" />
+
+                    <EditText
+                        android:id="@+id/new_transaction_amt_2"
+                        android:layout_width="wrap_content"
+                        android:layout_height="match_parent"
+                        android:layout_gravity="bottom"
+                        android:layout_weight="1"
+                        android:width="0dp"
+                        android:hint="@string/new_transaction_amount_hint"
+                        android:imeOptions="actionDone"
+                        android:inputType="numberDecimal|numberSigned"
+                        android:minWidth="40dp"
+                        android:accessibilityTraversalAfter="@+id/new_transaction_acc_1"
+                        android:nextFocusLeft="@+id/new_transaction_acc_2"
+                        android:nextFocusUp="@+id/new_transaction_amt_1"
+                        android:textAlignment="viewEnd" />
+                </TableRow>
+
+            </TableLayout>
 
         </LinearLayout>
     </ScrollView>