]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/res/layout/new_transaction_row.xml
stop
[mobile-ledger.git] / app / src / main / res / layout / new_transaction_row.xml
index 508eea9892b1529a7ae7e58d6625689d1bd2e66a..af8281e2b065f461aecb1ed3d2d5371a91ef7ca8 100644 (file)
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:animateLayoutChanges="false"
+    android:animateLayoutChanges="true"
     android:orientation="vertical">
 
-    <LinearLayout
+    <androidx.constraintlayout.widget.ConstraintLayout
         android:id="@+id/ntr_data"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content">
+        android:layout_height="wrap_content"
+        android:animateLayoutChanges="true"
+        android:orientation="horizontal">
 
         <EditText
             android:id="@+id/new_transaction_date"
@@ -45,7 +47,6 @@
             android:textAlignment="gravity"
             android:textCursorDrawable="@android:color/transparent"
             app:layout_constrainedHeight="true"
-            app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintHorizontal_weight="8"
             app:layout_constraintStart_toStartOf="parent"
             app:layout_constraintTop_toTopOf="parent"
@@ -53,7 +54,7 @@
 
         <net.ktnx.mobileledger.ui.AutoCompleteTextViewWithClear
             android:id="@+id/new_transaction_description"
-            android:layout_width="match_parent"
+            android:layout_width="0dp"
             android:layout_height="wrap_content"
             android:layout_gravity="bottom"
             android:layout_marginStart="8dp"
             android:nextFocusUp="@+id/new_transaction_date"
             android:selectAllOnFocus="false"
             android:singleLine="true"
-            app:layout_constraintBottom_toBottomOf="parent"
             app:layout_constraintEnd_toEndOf="parent"
             app:layout_constraintHorizontal_weight="30"
-            app:layout_constraintStart_toEndOf="@+id/new_transaction_date"
+            app:layout_constraintStart_toEndOf="@id/new_transaction_date"
             app:layout_constraintTop_toTopOf="parent" />
-    </LinearLayout>
+
+        <androidx.constraintlayout.widget.ConstraintLayout
+            android:id="@+id/transaction_comment_layout"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            app:layout_constraintEnd_toEndOf="parent"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toBottomOf="@id/new_transaction_description">
+
+            <TextView
+                android:id="@+id/comment_button"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:background="@drawable/ic_comment_gray_24dp"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent" />
+
+            <net.ktnx.mobileledger.ui.EditTextWithClear
+                android:id="@+id/transaction_comment"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:imeOptions="actionNext"
+                android:inputType="text"
+                android:visibility="invisible"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toEndOf="@id/comment_button"
+                app:layout_constraintTop_toTopOf="parent" />
+        </androidx.constraintlayout.widget.ConstraintLayout>
+
+    </androidx.constraintlayout.widget.ConstraintLayout>
 
     <androidx.constraintlayout.widget.ConstraintLayout
         android:id="@+id/ntr_account"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content">
+        android:layout_height="wrap_content"
+        android:animateLayoutChanges="true">
 
         <net.ktnx.mobileledger.ui.AutoCompleteTextViewWithClear
             android:id="@+id/account_row_acc_name"
             app:layout_constraintStart_toStartOf="parent"
             app:layout_constraintTop_toTopOf="parent" />
 
-        <TextView
-            android:id="@+id/comment_button"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:alpha="0.5"
-            android:drawableStart="@drawable/ic_comment_black_24dp"
-            app:layout_constraintBottom_toBottomOf="@+id/comment"
-            app:layout_constraintStart_toStartOf="@+id/ntr_account"
-            app:layout_constraintTop_toBottomOf="@+id/account_row_acc_name" />
-
-        <EditText
-            android:id="@+id/comment"
+        <androidx.constraintlayout.widget.ConstraintLayout
+            android:id="@+id/comment_layout"
             android:layout_width="0dp"
             android:layout_height="wrap_content"
-            android:hint="@string/transaction_account_comment_hint"
-            android:imeOptions="actionNext"
-            android:inputType="text"
-            app:layout_constraintEnd_toEndOf="@+id/ntr_account"
-            app:layout_constraintStart_toEndOf="@id/comment_button"
-            app:layout_constraintTop_toBottomOf="@id/account_row_acc_name" />
+            app:layout_constraintEnd_toStartOf="@id/amount_layout"
+            app:layout_constraintStart_toStartOf="parent"
+            app:layout_constraintTop_toBottomOf="@id/account_row_acc_name">
 
-        <LinearLayout
+            <TextView
+                android:id="@id/comment_button"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:background="@drawable/ic_comment_gray_24dp"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent" />
+
+            <net.ktnx.mobileledger.ui.EditTextWithClear
+                android:id="@+id/comment"
+                android:layout_width="0dp"
+                android:layout_height="wrap_content"
+                android:imeOptions="actionNext"
+                android:inputType="text"
+                android:visibility="invisible"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toEndOf="@id/comment_button"
+                app:layout_constraintTop_toTopOf="parent" />
+        </androidx.constraintlayout.widget.ConstraintLayout>
+
+        <androidx.constraintlayout.widget.ConstraintLayout
             android:id="@+id/amount_layout"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             app:layout_constraintEnd_toEndOf="parent"
-            app:layout_constraintTop_toBottomOf="@id/comment">
+            app:layout_constraintTop_toBottomOf="@id/account_row_acc_name">
 
             <EditText
                 android:id="@+id/account_row_acc_amounts"
                 android:gravity="bottom|end"
                 android:hint="@string/zero_amount"
                 android:imeOptions="actionNext"
-                android:inputType="numberSigned|numberDecimal|number"
-                android:minWidth="80sp"
+                android:inputType="number|numberSigned|numberDecimal"
+                android:minEms="4"
                 android:selectAllOnFocus="true"
-                android:textAlignment="viewEnd" />
-        </LinearLayout>
+                android:textAlignment="viewEnd"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintLeft_toLeftOf="parent"
+                app:layout_constraintRight_toLeftOf="@id/currency"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintWidth_min="@dimen/text_margin" />
+
+            <TextView
+                android:id="@+id/currency"
+                style="@style/TextAppearance.AppCompat.Widget.Button"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center_vertical"
+                android:gravity="center_horizontal"
+                android:minWidth="24dp"
+                android:text="@string/currency_symbol"
+                android:textAllCaps="false"
+                android:visibility="gone"
+                app:layout_constraintBottom_toBottomOf="parent"
+                app:layout_constraintRight_toRightOf="parent"
+                app:layout_constraintTop_toTopOf="parent" />
+        </androidx.constraintlayout.widget.ConstraintLayout>
 
     </androidx.constraintlayout.widget.ConstraintLayout>