]> git.ktnx.net Git - mobile-ledger.git/commitdiff
provide some guidance for template parameters
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sat, 6 Mar 2021 16:11:29 +0000 (18:11 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sat, 6 Mar 2021 16:11:29 +0000 (18:11 +0200)
app/src/main/res/drawable-anydpi/ic_baseline_help_outline_24_primary.xml [new file with mode: 0644]
app/src/main/res/layout/template_details_header.xml
app/src/main/res/values-bg/arrays.xml
app/src/main/res/values-bg/strings.xml
app/src/main/res/values/arrays.xml
app/src/main/res/values/strings.xml

diff --git a/app/src/main/res/drawable-anydpi/ic_baseline_help_outline_24_primary.xml b/app/src/main/res/drawable-anydpi/ic_baseline_help_outline_24_primary.xml
new file mode 100644 (file)
index 0000000..e67a7ec
--- /dev/null
@@ -0,0 +1,31 @@
+<!--
+  ~ Copyright Google Inc.
+  ~
+  ~ Licensed under the Apache License, version 2.0 ("the License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the license at:
+  ~
+  ~ https://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distribution under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  ~
+  ~ Modified/adapted by Damyan Ivanov for MoLe
+  -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:autoMirrored="true"
+    android:tint="?colorPrimary"
+    android:viewportWidth="24"
+    android:viewportHeight="24"
+    >
+    <path
+        android:fillColor="@android:color/white"
+        android:pathData="M11,18h2v-2h-2v2zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM12,6c-2.21,0 -4,1.79 -4,4h2c0,-1.1 0.9,-2 2,-2s2,0.9 2,2c0,2 -3,1.75 -3,5h2c0,-2.25 3,-2.5 3,-5 0,-2.21 -1.79,-4 -4,-4z"
+        />
+</vector>
index 2a2f4f43a9164eec5909faa45a3f384f7648ec89..c8617518d6d7005ee12fbb2f2f8e875bb293cc77 100644 (file)
     android:animateLayoutChanges="true"
     android:padding="@dimen/text_margin"
     >
+    <ImageButton
+        android:id="@+id/template_details_template_params_help_button"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:background="@android:color/transparent"
+        android:contentDescription="@string/template_details_template_params_help_description"
+        android:minWidth="@dimen/thumb_row_height"
+        android:src="@drawable/ic_baseline_help_outline_24_primary"
+        app:layout_constraintBottom_toBottomOf="@id/template_details_template_params_label"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintTop_toTopOf="@id/template_details_template_params_label"
+        />
+    <TextView
+        android:id="@+id/template_details_template_params_label"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginBottom="@dimen/text_margin"
+        android:gravity="end"
+        android:text="@string/template_details_template_params_label"
+        android:textAppearance="@android:style/TextAppearance.Material.Medium"
+        app:layout_constraintBottom_toTopOf="@id/pattern_name_layout"
+        app:layout_constraintEnd_toStartOf="@id/template_details_template_params_help_button"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        />
     <com.google.android.material.textfield.TextInputLayout
         android:id="@+id/pattern_name_layout"
         android:layout_width="0dp"
@@ -32,7 +57,7 @@
         app:layout_constraintBottom_toTopOf="@id/pattern_layout"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
-        app:layout_constraintTop_toTopOf="parent"
+        app:layout_constraintTop_toBottomOf="@id/template_details_template_params_label"
         >
         <com.google.android.material.textfield.TextInputEditText
             android:id="@+id/template_name"
         android:id="@+id/transaction_parameters_label"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
+        android:layout_marginBottom="@dimen/text_margin"
         android:gravity="end"
         android:text="@string/template_transaction_parameters_label"
-        android:textAppearance="?attr/textAppearanceListItem"
+        android:textAppearance="@android:style/TextAppearance.Material.Medium"
         app:layout_constraintBottom_toTopOf="@+id/pattern_transaction_date_label"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
         android:layout_height="wrap_content"
         android:text="@string/template_details_date_label"
         android:textAppearance="?attr/textAppearanceListItem"
+        app:layout_constraintBottom_toTopOf="@id/template_details_year_source_label"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toStartOf="parent"
         app:layout_constraintTop_toBottomOf="@id/transaction_parameters_label"
         android:layout_height="wrap_content"
         android:text="@string/template_details_date_year_source_label"
         android:textAlignment="center"
-        android:textAppearance="?attr/textAppearanceListItem"
+        android:textAppearance="@android:style/TextAppearance.Material.Body1"
         app:layout_constraintBottom_toTopOf="@+id/template_details_year_source"
         app:layout_constraintEnd_toStartOf="@id/template_details_month_source_label"
         app:layout_constraintStart_toStartOf="parent"
         android:layout_height="wrap_content"
         android:text="@string/template_details_date_month_source_label"
         android:textAlignment="center"
-        android:textAppearance="?attr/textAppearanceListItem"
+        android:textAppearance="@android:style/TextAppearance.Material.Body1"
         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"
         android:layout_height="wrap_content"
         android:text="@string/template_details_date_day_source_label"
         android:textAlignment="center"
-        android:textAppearance="?attr/textAppearanceListItem"
+        android:textAppearance="@android:style/TextAppearance.Material.Body1"
         app:layout_constraintBottom_toTopOf="@+id/template_details_day_source"
         app:layout_constraintEnd_toEndOf="parent"
         app:layout_constraintStart_toEndOf="@id/template_details_month_source_label"
index cab808175d308d8d8b11e2013f280b8a501fdf64..88598bf65a4e2e107a3fae340c007338443fec47 100644 (file)
@@ -32,4 +32,8 @@
         <item>Макетите описват кои параметри на движението са фиксирани и кои идват от външния източник.</item>
         <item>Сканирането на QR код е единственият външен източник, който се поддържа в момента. В бъдеще е планирана работа с поставяне на текст от работния буфер и четене/прихващане на текстови съобщения (SMS).</item>
     </string-array>
+    <string-array name="template_params_help">
+        <item>Шаблонът е регулярен израз ([Уикипедия↗](https://bg.wikipedia.org/wiki/Регулярен_израз#Синтаксис)). При получаване на данни от външния източник, шаблонът се напасва към тях за да се определи кои макети отговарят на входните данни.</item>
+        <item>Поддържа се използването на разпознати групи за попълване на параметри на движението от входните данни.</item>
+    </string-array>
 </resources>
index d058ea500a496ddf52afa236ab2fffa6468046cf..10ba1cf8be04571c77abf3765524e3f85568bb70 100644 (file)
     <string name="template_is_fallback_no">Макетът не е резервен</string>
     <string name="fallback_templates_divider">Резервни макети</string>
     <string name="template_list_help_title">Макети</string>
+    <string name="template_details_template_params_label">Параметри на макета</string>
+    <string name="template_details_template_params_help_description">Помощна информация за пааметрите на макета</string>
 </resources>
index d471be3a184c420dd4cb38497a751ec868a397c4..ded168533667f9b0ce81cdb77b1b99dad0c40d19 100644 (file)
@@ -32,4 +32,8 @@
         <item>Templates describe which transaction parameters are fixed and which come from the external source.</item>
         <item>Currently, scanning QR codes is the only available source. Support for pasting from the clipboard and reading/intercepting text messages (SMS) is planned for the future.</item>
     </string-array>
+    <string-array name="template_params_help">
+        <item>The pattern is a Regular expression ([Wikipedia↗](https://en.wikipedia.org/wiki/Regular_expression#Syntax)). It must match the input from the external source, or the template won\'t be considered when looking for templates corresponding to the input from the external source.</item>
+        <item>Capture groups may be used for filling some transaction parameters.</item>
+    </string-array>
 </resources>
\ No newline at end of file
index 3c94703aeb1d03ed3fa7591e0d5714be500f0578..96a8dd8b36e50ff419773d9e7c158b3434691aeb 100644 (file)
     <string name="template_is_fallback_no">Template is a primary, high priority one, not a catch-all</string>
     <string name="fallback_templates_divider">Fallback templates</string>
     <string name="template_list_help_title">Templates</string>
+    <string name="template_details_template_params_label">Template parameters</string>
+    <string name="template_details_template_params_help_description">Show help on template parameters</string>
 </resources>