]> git.ktnx.net Git - mobile-ledger.git/commitdiff
visual improvements in template editor
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sat, 13 Feb 2021 15:45:35 +0000 (17:45 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 18 Feb 2021 07:19:43 +0000 (07:19 +0000)
more air between independent elements, consistent look for sub-section
headings, clear icon

app/src/main/res/layout/template_details_account.xml
app/src/main/res/layout/template_details_header.xml

index 2bed3700d314ab776ee24a688392bb428ba605d8..a55a4e12106cc94e35087080ac6c4d0128eeccdf 100644 (file)
@@ -29,6 +29,7 @@
         android:gravity="end"
         android:paddingTop="@dimen/text_margin"
         android:text="@string/template_details_account_row_label"
+        android:textAppearance="?attr/textAppearanceListItem"
         app:drawableBottomCompat="@drawable/dashed_border_8dp"
         />
     <TextView
         android:layout_height="wrap_content"
         android:layout_marginHorizontal="@dimen/text_margin"
         android:textAppearance="?attr/textAppearanceListItem"
+        app:endIconMode="clear_text"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toBottomOf="@id/template_details_account_name_source"
-        app:endIconMode="clear_text"
         >
         <com.google.android.material.textfield.MaterialAutoCompleteTextView
-            style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
             android:id="@+id/template_details_account_name"
+            style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:hint="@string/template_details_account_name_label"
         android:layout_height="wrap_content"
         android:layout_marginHorizontal="@dimen/text_margin"
         android:textAppearance="?attr/textAppearanceListItem"
+        app:endIconMode="clear_text"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toBottomOf="@id/template_details_account_comment_source"
             android:layout_height="wrap_content"
             android:hint="@string/template_details_account_amount_label"
             android:inputType="number|numberDecimal|numberSigned"
+            android:selectAllOnFocus="true"
             />
     </com.google.android.material.textfield.TextInputLayout>
 
index f610da339b54c6bcb462b0886215b114b127b8fe..44b80ecb46b9c32ebd491c0d363102b972d51b7f 100644 (file)
     android:id="@+id/pattern_details_item_head"
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
-    android:paddingHorizontal="@dimen/text_margin"
+    android:padding="@dimen/text_margin"
     >
     <com.google.android.material.textfield.TextInputLayout
         android:id="@+id/pattern_name_layout"
         android:layout_width="0dp"
         android:layout_height="wrap_content"
+        android:layout_marginBottom="@dimen/text_margin"
+        app:endIconMode="clear_text"
+        app:layout_constraintBottom_toTopOf="@id/pattern_layout"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toTopOf="parent"
@@ -42,6 +45,7 @@
         android:id="@+id/pattern_layout"
         android:layout_width="0dp"
         android:layout_height="wrap_content"
+        android:layout_marginBottom="@dimen/text_margin"
         android:textAppearance="?attr/textAppearanceListItem"
         app:endIconMode="clear_text"
         app:layout_constraintBottom_toTopOf="@id/pattern_hint_title"
         android:id="@+id/test_text_layout"
         android:layout_width="0dp"
         android:layout_height="wrap_content"
+        android:layout_marginBottom="@dimen/text_margin"
         android:textAppearance="?attr/textAppearanceListItem"
+        app:endIconMode="clear_text"
+        app:layout_constraintBottom_toTopOf="@id/transaction_parameters_label"
         app:layout_constraintEnd_toStartOf="@id/template_details_head_scan_qr_button"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toBottomOf="@id/pattern_hint_text"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:gravity="end"
-        android:paddingTop="@dimen/text_margin"
         android:text="@string/template_transaction_parameters_label"
+        android:textAppearance="?attr/textAppearanceListItem"
+        app:layout_constraintBottom_toTopOf="@+id/pattern_transaction_date_label"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toBottomOf="@id/test_text_layout"
         />
     <TextView
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:text="@string/template_details_date_label"
+        android:textAppearance="?attr/textAppearanceListItem"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toBottomOf="@id/transaction_parameters_label"
         />
     <TextView
         android:layout_height="wrap_content"
         android:text="@string/template_details_date_year_source_label"
         android:textAlignment="center"
+        android:textAppearance="?attr/textAppearanceListItem"
+        app:layout_constraintBottom_toTopOf="@+id/template_details_year_source"
         app:layout_constraintEnd_toStartOf="@id/template_details_month_source_label"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toBottomOf="@id/pattern_transaction_date_label"
         android:layout_height="wrap_content"
         android:text="@string/template_details_date_month_source_label"
         android:textAlignment="center"
+        android:textAppearance="?attr/textAppearanceListItem"
+        app:layout_constraintBottom_toTopOf="@+id/template_details_month_source"
         app:layout_constraintEnd_toStartOf="@id/template_details_day_source_label"
         app:layout_constraintStart_toEndOf="@id/template_details_year_source_label"
         app:layout_constraintTop_toBottomOf="@id/pattern_transaction_date_label"
         android:layout_height="wrap_content"
         android:text="@string/template_details_date_day_source_label"
         android:textAlignment="center"
+        android:textAppearance="?attr/textAppearanceListItem"
+        app:layout_constraintBottom_toTopOf="@+id/template_details_day_source"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toEndOf="@id/template_details_month_source_label"
         app:layout_constraintTop_toBottomOf="@id/pattern_transaction_date_label"
         android:layout_height="wrap_content"
         android:text="@string/template_details_source_literal"
         android:textAlignment="center"
+        android:textAppearance="?attr/textAppearanceListItemSecondary"
+        app:layout_constraintBottom_toTopOf="@+id/template_details_date_year_layout"
         app:layout_constraintEnd_toStartOf="@id/template_details_month_source"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toBottomOf="@id/template_details_day_source_label"
         android:layout_height="wrap_content"
         android:text=""
         android:textAlignment="center"
+        android:textAppearance="?attr/textAppearanceListItemSecondary"
+        app:layout_constraintBottom_toTopOf="@+id/template_details_date_month_layout"
         app:layout_constraintEnd_toStartOf="@id/template_details_day_source"
         app:layout_constraintStart_toEndOf="@id/template_details_year_source"
         app:layout_constraintTop_toBottomOf="@id/template_details_month_source_label"
         android:layout_height="wrap_content"
         android:text=""
         android:textAlignment="center"
+        android:textAppearance="?attr/textAppearanceListItemSecondary"
+        app:layout_constraintBottom_toTopOf="@+id/template_details_date_day_layout"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toEndOf="@id/template_details_month_source"
         app:layout_constraintTop_toBottomOf="@id/template_details_day_source_label"
         android:id="@+id/template_details_date_year_layout"
         android:layout_width="0dp"
         android:layout_height="wrap_content"
+        android:layout_marginBottom="@dimen/text_margin"
         app:layout_constraintEnd_toEndOf="@id/template_details_year_source"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toBottomOf="@id/barrier_before_date_inputs"
         android:id="@+id/template_details_date_month_layout"
         android:layout_width="0dp"
         android:layout_height="wrap_content"
+        android:layout_marginBottom="@dimen/text_margin"
         app:layout_constraintEnd_toEndOf="@id/template_details_month_source"
         app:layout_constraintStart_toStartOf="@id/template_details_month_source"
         app:layout_constraintTop_toBottomOf="@id/barrier_before_date_inputs"
         android:id="@+id/template_details_date_day_layout"
         android:layout_width="0dp"
         android:layout_height="wrap_content"
+        android:layout_marginBottom="@dimen/text_margin"
         app:layout_constraintBottom_toTopOf="@id/barrier_before_description"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="@id/template_details_day_source"
         android:id="@+id/template_transaction_description_source_label"
         android:layout_width="0dp"
         android:layout_height="match_parent"
-        android:paddingTop="@dimen/text_margin"
         android:text="@string/transaction_description_source_label"
         android:textAppearance="?attr/textAppearanceListItem"
+        app:layout_constraintBottom_toTopOf="@+id/template_transaction_description_source"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toBottomOf="@id/barrier_before_description"
         android:layout_height="wrap_content"
         android:minWidth="100dp"
         android:textAppearance="?attr/textAppearanceListItemSecondary"
+        app:layout_constraintBottom_toTopOf="@+id/transaction_description_layout"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toBottomOf="@id/template_transaction_description_source_label"
         android:id="@+id/transaction_description_layout"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
+        android:layout_marginBottom="@dimen/text_margin"
+        app:endIconMode="clear_text"
+        app:layout_constraintBottom_toTopOf="@+id/template_transaction_comment_source_label"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toBottomOf="@id/template_transaction_description_source"
         >
         <com.google.android.material.textfield.TextInputEditText
         android:id="@+id/template_transaction_comment_source_label"
         android:layout_width="0dp"
         android:layout_height="match_parent"
-        android:paddingTop="@dimen/text_margin"
         android:text="@string/transaction_comment_source_label"
         android:textAppearance="?attr/textAppearanceListItem"
+        app:layout_constraintBottom_toTopOf="@+id/template_transaction_comment_source"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toBottomOf="@id/transaction_description_layout"
         android:layout_height="wrap_content"
         android:minWidth="100dp"
         android:textAppearance="?attr/textAppearanceListItemSecondary"
+        app:layout_constraintBottom_toTopOf="@+id/transaction_comment_layout"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toBottomOf="@id/template_transaction_comment_source_label"
         android:id="@+id/transaction_comment_layout"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
+        app:endIconMode="clear_text"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toBottomOf="@id/template_transaction_comment_source"
         >
         <com.google.android.material.textfield.TextInputEditText