]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/res/layout/transaction_list_row.xml
more pronounced day/month delimiters in the transaction list
[mobile-ledger.git] / app / src / main / res / layout / transaction_list_row.xml
index a9e6c9b7ca578025f971540d04d76d770bc83381..a91456ccc7c27c061cfc71a0a60b026810b29101 100644 (file)
 <?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
+  ~ Copyright © 2021 Damyan Ivanov.
+  ~ This file is part of MoLe.
+  ~ MoLe 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,
+  ~ MoLe 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/>.
+  ~ along with MoLe. If not, see <https://www.gnu.org/licenses/>.
   -->
 
-<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<FrameLayout 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"
-    android:id="@+id/transaction_row"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:gravity="center_vertical"
-    android:minHeight="36dp"
-    android:orientation="horizontal"
-    android:paddingStart="8dp"
-    android:paddingEnd="8dp">
-
-    <!--android:button="@drawable/checkbox_star_black"-->
+    >
 
-    <LinearLayout
-        android:id="@+id/transaction_row_head"
+    <com.google.android.material.card.MaterialCardView
+        android:id="@+id/transaction_card_view"
+        style="@style/Widget.MaterialComponents.CardView"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:orientation="horizontal"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent">
-
-        <TextView
-            android:id="@+id/transaction_row_description"
-            style="@style/account_summary_account_name"
-            android:layout_width="0dp"
-            android:layout_height="wrap_content"
-            android:layout_weight="5"
-            android:text="Sample description goes here."
-            android:textStyle="bold"
-            tools:ignore="HardcodedText" />
+        android:layout_margin="8dp"
+        android:visibility="visible"
+        app:cardCornerRadius="0dp"
+        app:cardElevation="2dp"
+        app:cardUseCompatPadding="false"
+        >
 
-        <TextView
-            android:id="@+id/transaction_row_date"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_marginEnd="0dp"
-            app:layout_constraintEnd_toEndOf="parent" />
-    </LinearLayout>
-
-    <LinearLayout
-        android:id="@+id/transaction_row_header_border"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:background="@drawable/dashed_border_1dp"
-        android:minHeight="2dp"
-        android:orientation="horizontal"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/transaction_row_head" />
-
-    <LinearLayout
-        android:id="@+id/transaction_row_acc_amounts"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:layout_weight="5"
-        android:orientation="vertical"
-        app:layout_constraintEnd_toEndOf="parent"
-        app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/transaction_row_header_border">
-
-        <LinearLayout
+        <androidx.constraintlayout.widget.ConstraintLayout
+            android:id="@+id/transaction_row"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:gravity="center_vertical"
-            android:orientation="horizontal"
-            android:paddingStart="8dp"
-            android:paddingEnd="0dp">
+            android:minHeight="36dp"
+            android:padding="8dp"
+            >
 
-            <TextView
+            <LinearLayout
+                android:id="@+id/transaction_row_head"
                 android:layout_width="0dp"
                 android:layout_height="wrap_content"
-                android:layout_weight="5"
-                android:text="Account name, a really long one. A very very very long one. It may even spawn on more than two lines -- three, four or more."
-                android:textAlignment="viewStart"
-                tools:ignore="HardcodedText" />
+                android:orientation="vertical"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toTopOf="parent"
+                >
 
-            <TextView
-                android:layout_width="wrap_content"
+                <TextView
+                    android:id="@+id/transaction_row_description"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:text="---."
+                    android:textAppearance="@android:style/TextAppearance.Material.Medium"
+                    android:textStyle="bold"
+                    tools:ignore="HardcodedText"
+                    />
+                <TextView
+                    android:id="@+id/transaction_comment"
+                    style="@style/transaction_list_comment"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginStart="0dp"
+                    android:layout_marginTop="0dp"
+                    android:text="Comment text"
+                    tools:ignore="HardcodedText"
+                    />
+            </LinearLayout>
+
+            <LinearLayout
+                android:id="@+id/transaction_row_acc_amounts"
+                android:layout_width="0dp"
                 android:layout_height="wrap_content"
-                android:layout_marginEnd="0dp"
-                android:minWidth="60dp"
-                android:text="123,45\n-14 678,90"
-                android:textAlignment="viewEnd"
-                tools:ignore="HardcodedText" />
-        </LinearLayout>
+                android:layout_marginTop="8dp"
+                android:orientation="vertical"
+                app:layout_constraintEnd_toStartOf="@id/transaction_running_total"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintTop_toBottomOf="@+id/transaction_row_head"
+                >
 
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:gravity="center_vertical"
-            android:orientation="horizontal"
-            android:paddingStart="8dp"
-            android:paddingEnd="0dp">
+                <include layout="@layout/transaction_list_row_accounts_table_row" />
+                <include layout="@layout/transaction_list_row_accounts_table_row" />
 
-            <TextView
-                android:layout_width="0dp"
+            </LinearLayout>
+            <androidx.constraintlayout.widget.Barrier
+                android:id="@+id/barrier"
+                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_weight="5"
-                android:text="Account name, a really long one. A very very very long one. It may even spawn on more than two lines -- three, four or more."
-                android:textAlignment="viewStart"
-                tools:ignore="HardcodedText" />
+                app:barrierDirection="top"
+                app:constraint_referenced_ids="transaction_row_acc_amounts,transaction_running_total"
+                />
 
             <TextView
+                android:id="@+id/transaction_running_total"
+                style="@style/transaction_list_comment"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_marginEnd="0dp"
-                android:minWidth="60dp"
-                android:text="123,45\n-14 678,90"
-                android:textAlignment="viewEnd"
-                tools:ignore="HardcodedText" />
-        </LinearLayout>
-    </LinearLayout>
-</android.support.constraint.ConstraintLayout>
\ No newline at end of file
+                android:layout_marginStart="@dimen/half_text_margin"
+                android:gravity="bottom|end"
+                android:text="one two"
+                android:visibility="visible"
+                app:layout_constraintBottom_toBottomOf="@id/transaction_row_acc_amounts"
+                app:layout_constraintEnd_toEndOf="parent"
+                app:layout_constraintStart_toEndOf="@id/transaction_row_acc_amounts"
+                app:layout_goneMarginStart="0dp"
+                />
+            <View
+                android:id="@+id/transaction_running_total_divider"
+                android:layout_width="1dp"
+                android:layout_height="0dp"
+                android:layout_marginStart="@dimen/quarter_text_margin"
+                android:background="?commentColor"
+                app:layout_constraintBottom_toBottomOf="@id/transaction_running_total"
+                app:layout_constraintStart_toEndOf="@id/transaction_row_acc_amounts"
+                app:layout_constraintTop_toBottomOf="@id/barrier"
+                app:layout_goneMarginStart="0dp"
+                />
+
+        </androidx.constraintlayout.widget.ConstraintLayout>
+    </com.google.android.material.card.MaterialCardView>
+
+
+</FrameLayout>
\ No newline at end of file