summaryrefslogtreecommitdiff
path: root/merchant-terminal/src/main/res
diff options
context:
space:
mode:
authorTorsten Grote <t@grobox.de>2023-03-08 15:55:07 -0300
committerTorsten Grote <t@grobox.de>2023-03-08 15:55:07 -0300
commite690df6d0eaacb60ca9edf1d4caf382711278b8b (patch)
tree2b07e0856413f482fe588d7956e6559a2f77dd3f /merchant-terminal/src/main/res
parent34954e4c0c730910ee45dec85a64117aa57023c2 (diff)
downloadtaler-android-e690df6d0eaacb60ca9edf1d4caf382711278b8b.tar.gz
taler-android-e690df6d0eaacb60ca9edf1d4caf382711278b8b.tar.bz2
taler-android-e690df6d0eaacb60ca9edf1d4caf382711278b8b.zip
[pos] add button for adding custom products
Diffstat (limited to 'merchant-terminal/src/main/res')
-rw-r--r--merchant-terminal/src/main/res/drawable/ic_dialpad.xml25
-rw-r--r--merchant-terminal/src/main/res/layout/fragment_custom_dialog.xml117
-rw-r--r--merchant-terminal/src/main/res/layout/fragment_order.xml13
-rw-r--r--merchant-terminal/src/main/res/values/strings.xml4
4 files changed, 158 insertions, 1 deletions
diff --git a/merchant-terminal/src/main/res/drawable/ic_dialpad.xml b/merchant-terminal/src/main/res/drawable/ic_dialpad.xml
new file mode 100644
index 0000000..33ba1d9
--- /dev/null
+++ b/merchant-terminal/src/main/res/drawable/ic_dialpad.xml
@@ -0,0 +1,25 @@
+<!--
+ ~ This file is part of GNU Taler
+ ~ (C) 2023 Taler Systems S.A.
+ ~
+ ~ GNU Taler is free software; you can redistribute it and/or modify it under the
+ ~ terms of the GNU General Public License as published by the Free Software
+ ~ Foundation; either version 3, or (at your option) any later version.
+ ~
+ ~ GNU Taler 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 for more details.
+ ~
+ ~ You should have received a copy of the GNU General Public License along with
+ ~ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+ <path
+ android:fillColor="@android:color/white"
+ android:pathData="M12,19c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM6,1c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM6,7c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM6,13c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM18,5c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM12,13c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM18,13c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM18,7c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,7c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,1c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2z" />
+</vector>
diff --git a/merchant-terminal/src/main/res/layout/fragment_custom_dialog.xml b/merchant-terminal/src/main/res/layout/fragment_custom_dialog.xml
new file mode 100644
index 0000000..8da50ad
--- /dev/null
+++ b/merchant-terminal/src/main/res/layout/fragment_custom_dialog.xml
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ ~ This file is part of GNU Taler
+ ~ (C) 2023 Taler Systems S.A.
+ ~
+ ~ GNU Taler is free software; you can redistribute it and/or modify it under the
+ ~ terms of the GNU General Public License as published by the Free Software
+ ~ Foundation; either version 3, or (at your option) any later version.
+ ~
+ ~ GNU Taler 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 for more details.
+ ~
+ ~ You should have received a copy of the GNU General Public License along with
+ ~ GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+ -->
+
+<androidx.constraintlayout.widget.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"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <TextView
+ android:id="@+id/titleView"
+ style="@style/TextAppearance.Material3.TitleMedium"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="16dp"
+ android:layout_marginTop="16dp"
+ android:layout_marginEnd="16dp"
+ android:text="@string/order_custom"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent" />
+
+ <com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/productNameLayout"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="16dp"
+ android:layout_marginTop="16dp"
+ android:layout_marginEnd="16dp"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/titleView">
+
+ <com.google.android.material.textfield.TextInputEditText
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:hint="@string/order_custom_product"
+ android:inputType="textShortMessage"
+ android:singleLine="true"
+ android:text="@string/order_custom_product_default" />
+ </com.google.android.material.textfield.TextInputLayout>
+
+ <com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/amountLayout"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="16dp"
+ android:layout_marginTop="16dp"
+ android:layout_marginEnd="8dp"
+ android:minEms="5"
+ app:layout_constraintEnd_toStartOf="@+id/currencyView"
+ app:layout_constraintHorizontal_bias="1.0"
+ app:layout_constraintHorizontal_chainStyle="packed"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/productNameLayout">
+
+ <com.google.android.material.textfield.TextInputEditText
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:hint="@string/refund_amount"
+ android:inputType="numberDecimal">
+
+ <requestFocus />
+ </com.google.android.material.textfield.TextInputEditText>
+ </com.google.android.material.textfield.TextInputLayout>
+
+ <TextView
+ android:id="@+id/currencyView"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginEnd="16dp"
+ app:layout_constraintBottom_toBottomOf="@+id/amountLayout"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintHorizontal_bias="0.5"
+ app:layout_constraintStart_toEndOf="@+id/amountLayout"
+ app:layout_constraintTop_toTopOf="@+id/amountLayout"
+ tools:text="TESTKUDOS" />
+
+ <Button
+ android:id="@+id/addButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:layout_marginEnd="16dp"
+ android:layout_marginBottom="16dp"
+ android:text="@string/order_custom_add_button"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/amountLayout"
+ app:layout_constraintVertical_bias="0.0" />
+
+ <Button
+ android:id="@+id/cancelButton"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="16dp"
+ android:layout_marginTop="16dp"
+ android:layout_marginEnd="16dp"
+ android:text="@android:string/cancel"
+ app:layout_constraintEnd_toStartOf="@+id/addButton"
+ app:layout_constraintHorizontal_bias="1.0"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/amountLayout" />
+</androidx.constraintlayout.widget.ConstraintLayout>
diff --git a/merchant-terminal/src/main/res/layout/fragment_order.xml b/merchant-terminal/src/main/res/layout/fragment_order.xml
index dc49db1..45f1aee 100644
--- a/merchant-terminal/src/main/res/layout/fragment_order.xml
+++ b/merchant-terminal/src/main/res/layout/fragment_order.xml
@@ -121,6 +121,17 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/prevButton" />
+ <ImageButton
+ android:id="@+id/customButton"
+ android:layout_width="48dp"
+ android:layout_height="48dp"
+ android:layout_marginStart="16dp"
+ android:backgroundTint="?colorPrimary"
+ app:layout_constraintBottom_toBottomOf="parent"
+ app:layout_constraintStart_toEndOf="@+id/nextButton"
+ app:srcCompat="@drawable/ic_dialpad"
+ android:contentDescription="@string/order_custom" />
+
<Button
android:id="@+id/completeButton"
android:layout_width="wrap_content"
@@ -132,6 +143,6 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
- app:layout_constraintStart_toEndOf="@+id/nextButton" />
+ app:layout_constraintStart_toEndOf="@+id/customButton" />
</androidx.constraintlayout.widget.ConstraintLayout>
diff --git a/merchant-terminal/src/main/res/values/strings.xml b/merchant-terminal/src/main/res/values/strings.xml
index f06866d..3cd2043 100644
--- a/merchant-terminal/src/main/res/values/strings.xml
+++ b/merchant-terminal/src/main/res/values/strings.xml
@@ -14,7 +14,11 @@
<string name="order_undo">Undo</string>
<string name="order_previous">Prev</string>
<string name="order_next">Next</string>
+ <string name="order_custom">Add custom product</string>
<string name="order_complete">Complete</string>
+ <string name="order_custom_product">Custom product name</string>
+ <string name="order_custom_product_default">Tip</string>
+ <string name="order_custom_add_button">Add</string>
<string name="config_label">Merchant settings</string>
<string name="config_url">Configuration URL</string>