diff options
Diffstat (limited to 'merchant-terminal/src/main/res')
52 files changed, 1746 insertions, 0 deletions
diff --git a/merchant-terminal/src/main/res/color/button_bottom.xml b/merchant-terminal/src/main/res/color/button_bottom.xml new file mode 100644 index 0000000..83363e9 --- /dev/null +++ b/merchant-terminal/src/main/res/color/button_bottom.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:color="@color/bottomButtons" android:state_enabled="true" /> + <item android:alpha="0.12" android:color="?attr/colorOnSurface" /> +</selector> diff --git a/merchant-terminal/src/main/res/drawable/ic_cash_refund.xml b/merchant-terminal/src/main/res/drawable/ic_cash_refund.xml new file mode 100644 index 0000000..7359ca3 --- /dev/null +++ b/merchant-terminal/src/main/res/drawable/ic_cash_refund.xml @@ -0,0 +1,9 @@ +<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="#000000" + android:pathData="M3,11H21V23H3V11M12,15A2,2 0 0,1 14,17A2,2 0 0,1 12,19A2,2 0 0,1 10,17A2,2 0 0,1 12,15M7,13A2,2 0 0,1 5,15V19A2,2 0 0,1 7,21H17A2,2 0 0,1 19,19V15A2,2 0 0,1 17,13H7M17,5V10H15.5V6.5H9.88L12.3,8.93L11.24,10L7,5.75L11.24,1.5L12.3,2.57L9.88,5H17Z" /> +</vector> diff --git a/merchant-terminal/src/main/res/drawable/ic_check_circle.xml b/merchant-terminal/src/main/res/drawable/ic_check_circle.xml new file mode 100644 index 0000000..61e1b5a --- /dev/null +++ b/merchant-terminal/src/main/res/drawable/ic_check_circle.xml @@ -0,0 +1,10 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:alpha="0.56" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + <path + android:fillColor="@color/green" + android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM10,17l-5,-5 1.41,-1.41L10,14.17l7.59,-7.59L19,8l-9,9z" /> +</vector> diff --git a/merchant-terminal/src/main/res/drawable/ic_history_black_24dp.xml b/merchant-terminal/src/main/res/drawable/ic_history_black_24dp.xml new file mode 100644 index 0000000..a61de1b --- /dev/null +++ b/merchant-terminal/src/main/res/drawable/ic_history_black_24dp.xml @@ -0,0 +1,9 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + <path + android:fillColor="#FF000000" + android:pathData="M13,3c-4.97,0 -9,4.03 -9,9L1,12l3.89,3.89 0.07,0.14L9,12L6,12c0,-3.87 3.13,-7 7,-7s7,3.13 7,7 -3.13,7 -7,7c-1.93,0 -3.68,-0.79 -4.94,-2.06l-1.42,1.42C8.27,19.99 10.51,21 13,21c4.97,0 9,-4.03 9,-9s-4.03,-9 -9,-9zM12,8v5l4.28,2.54 0.72,-1.21 -3.5,-2.08L13.5,8L12,8z"/> +</vector> diff --git a/merchant-terminal/src/main/res/drawable/ic_launcher_background.xml b/merchant-terminal/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..2408e30 --- /dev/null +++ b/merchant-terminal/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector + android:height="108dp" + android:width="108dp" + android:viewportHeight="108" + android:viewportWidth="108" + xmlns:android="http://schemas.android.com/apk/res/android"> + <path android:fillColor="#008577" + android:pathData="M0,0h108v108h-108z"/> + <path android:fillColor="#00000000" android:pathData="M9,0L9,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,0L19,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M29,0L29,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M39,0L39,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M49,0L49,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M59,0L59,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M69,0L69,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M79,0L79,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M89,0L89,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M99,0L99,108" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,9L108,9" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,19L108,19" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,29L108,29" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,39L108,39" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,49L108,49" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,59L108,59" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,69L108,69" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,79L108,79" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,89L108,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M0,99L108,99" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,29L89,29" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,39L89,39" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,49L89,49" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,59L89,59" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,69L89,69" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M19,79L89,79" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M29,19L29,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M39,19L39,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M49,19L49,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M59,19L59,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M69,19L69,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> + <path android:fillColor="#00000000" android:pathData="M79,19L79,89" + android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/> +</vector> diff --git a/merchant-terminal/src/main/res/drawable/ic_menu_manage.xml b/merchant-terminal/src/main/res/drawable/ic_menu_manage.xml new file mode 100644 index 0000000..a0e423c --- /dev/null +++ b/merchant-terminal/src/main/res/drawable/ic_menu_manage.xml @@ -0,0 +1,9 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + <path + android:fillColor="#FF000000" + android:pathData="M22.7,19l-9.1,-9.1c0.9,-2.3 0.4,-5 -1.5,-6.9 -2,-2 -5,-2.4 -7.4,-1.3L9,6 6,9 1.6,4.7C0.4,7.1 0.9,10.1 2.9,12.1c1.9,1.9 4.6,2.4 6.9,1.5l9.1,9.1c0.4,0.4 1,0.4 1.4,0l2.3,-2.3c0.5,-0.4 0.5,-1.1 0.1,-1.4z"/> +</vector>
\ No newline at end of file diff --git a/merchant-terminal/src/main/res/drawable/ic_move_money_24dp.xml b/merchant-terminal/src/main/res/drawable/ic_move_money_24dp.xml new file mode 100644 index 0000000..349f48f --- /dev/null +++ b/merchant-terminal/src/main/res/drawable/ic_move_money_24dp.xml @@ -0,0 +1,9 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + <path + android:fillColor="#FF000000" + android:pathData="M19,3L4.99,3c-1.11,0 -1.98,0.9 -1.98,2L3,19c0,1.1 0.88,2 1.99,2L19,21c1.1,0 2,-0.9 2,-2L21,5c0,-1.1 -0.9,-2 -2,-2zM19,15h-4c0,1.66 -1.35,3 -3,3s-3,-1.34 -3,-3L4.99,15L4.99,5L19,5v10zM16,10h-2L14,7h-4v3L8,10l4,4 4,-4z"/> +</vector> diff --git a/merchant-terminal/src/main/res/drawable/selectable_background.xml b/merchant-terminal/src/main/res/drawable/selectable_background.xml new file mode 100644 index 0000000..b82de92 --- /dev/null +++ b/merchant-terminal/src/main/res/drawable/selectable_background.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:drawable="@color/selectedBackground" android:state_activated="true" /> + <item android:drawable="@android:color/transparent" /> +</selector>
\ No newline at end of file diff --git a/merchant-terminal/src/main/res/drawable/side_nav_bar.xml b/merchant-terminal/src/main/res/drawable/side_nav_bar.xml new file mode 100644 index 0000000..50dc048 --- /dev/null +++ b/merchant-terminal/src/main/res/drawable/side_nav_bar.xml @@ -0,0 +1,9 @@ +<shape xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle"> + <gradient + android:angle="135" + android:centerColor="@color/colorPrimaryDark" + android:endColor="@color/colorPrimaryDark" + android:startColor="@color/colorPrimary" + android:type="linear"/> +</shape>
\ No newline at end of file diff --git a/merchant-terminal/src/main/res/layout/activity_main.xml b/merchant-terminal/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..6523caa --- /dev/null +++ b/merchant-terminal/src/main/res/layout/activity_main.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ This file is part of GNU Taler + ~ (C) 2020 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.drawerlayout.widget.DrawerLayout + 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/drawer_layout" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:fitsSystemWindows="true" + tools:openDrawer="start"> + + <include + layout="@layout/app_bar_main" + android:layout_width="match_parent" + android:layout_height="match_parent"/> + + <com.google.android.material.navigation.NavigationView + android:id="@+id/nav_view" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:layout_gravity="start" + android:fitsSystemWindows="true" + app:menu="@menu/activity_main_drawer" + app:headerLayout="@layout/nav_header_main" /> + +</androidx.drawerlayout.widget.DrawerLayout> diff --git a/merchant-terminal/src/main/res/layout/app_bar_main.xml b/merchant-terminal/src/main/res/layout/app_bar_main.xml new file mode 100644 index 0000000..0254c71 --- /dev/null +++ b/merchant-terminal/src/main/res/layout/app_bar_main.xml @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ This file is part of GNU Taler + ~ (C) 2020 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.coordinatorlayout.widget.CoordinatorLayout 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" + tools:context=".MainActivity"> + + <com.google.android.material.appbar.AppBarLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:theme="@style/AppTheme.AppBarOverlay"> + + <androidx.appcompat.widget.Toolbar + android:id="@+id/toolbar" + android:layout_width="match_parent" + android:layout_height="?attr/actionBarSize" + android:background="?attr/colorPrimary" + app:popupTheme="@style/AppTheme.PopupOverlay" /> + + </com.google.android.material.appbar.AppBarLayout> + + <androidx.fragment.app.FragmentContainerView + android:id="@+id/navHostFragment" + android:name="androidx.navigation.fragment.NavHostFragment" + android:layout_width="match_parent" + android:layout_height="match_parent" + app:defaultNavHost="true" + app:layout_insetEdge="top" + app:layout_behavior="@string/appbar_scrolling_view_behavior" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:navGraph="@navigation/nav_graph" /> + +</androidx.coordinatorlayout.widget.CoordinatorLayout> diff --git a/merchant-terminal/src/main/res/layout/fragment_categories.xml b/merchant-terminal/src/main/res/layout/fragment_categories.xml new file mode 100644 index 0000000..a90585f --- /dev/null +++ b/merchant-terminal/src/main/res/layout/fragment_categories.xml @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ This file is part of GNU Taler + ~ (C) 2020 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" + android:layout_width="match_parent" + xmlns:tools="http://schemas.android.com/tools" + android:layout_marginStart="8dp" + android:layout_marginEnd="8dp" + android:layout_height="match_parent"> + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/categoriesList" + android:layout_width="0dp" + tools:listitem="@layout/list_item_category" + android:layout_height="0dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <ProgressBar + android:id="@+id/progressBar" + style="?android:attr/progressBarStyleLarge" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + +</androidx.constraintlayout.widget.ConstraintLayout> diff --git a/merchant-terminal/src/main/res/layout/fragment_config_fetcher.xml b/merchant-terminal/src/main/res/layout/fragment_config_fetcher.xml new file mode 100644 index 0000000..af7dcaf --- /dev/null +++ b/merchant-terminal/src/main/res/layout/fragment_config_fetcher.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ This file is part of GNU Taler + ~ (C) 2020 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" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_margin="16dp"> + + <TextView + android:id="@+id/titleView" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="16dp" + android:text="@string/config_fetching" + android:textAppearance="@style/TextAppearance.AppCompat.Headline" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <ProgressBar + android:id="@+id/progressBar" + style="?android:attr/progressBarStyleLarge" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="16dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/titleView" /> + +</androidx.constraintlayout.widget.ConstraintLayout> diff --git a/merchant-terminal/src/main/res/layout/fragment_merchant_config.xml b/merchant-terminal/src/main/res/layout/fragment_merchant_config.xml new file mode 100644 index 0000000..2541887 --- /dev/null +++ b/merchant-terminal/src/main/res/layout/fragment_merchant_config.xml @@ -0,0 +1,152 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ This file is part of GNU Taler + ~ (C) 2020 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/> + --> + +<ScrollView 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" + android:fillViewport="true"> + + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + tools:context=".config.MerchantConfigFragment"> + + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/configUrlView" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_margin="16dp" + android:hint="@string/config_url" + app:boxBackgroundColor="@android:color/transparent" + app:boxBackgroundMode="outline" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent"> + + <com.google.android.material.textfield.TextInputEditText + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:inputType="textUri" /> + + </com.google.android.material.textfield.TextInputLayout> + + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/usernameView" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_margin="16dp" + android:hint="@string/config_username" + app:boxBackgroundColor="@android:color/transparent" + app:boxBackgroundMode="outline" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/configUrlView"> + + <com.google.android.material.textfield.TextInputEditText + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:inputType="text" /> + + </com.google.android.material.textfield.TextInputLayout> + + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/passwordView" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_margin="16dp" + android:hint="@string/config_password" + app:boxBackgroundColor="@android:color/transparent" + app:boxBackgroundMode="outline" + app:endIconMode="password_toggle" + app:layout_constraintEnd_toStartOf="@+id/forgetPasswordButton" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/usernameView"> + + <com.google.android.material.textfield.TextInputEditText + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:inputType="textWebPassword" /> + + </com.google.android.material.textfield.TextInputLayout> + + <Button + android:id="@+id/forgetPasswordButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="16dp" + android:text="@string/config_forget_password" + android:visibility="gone" + app:layout_constraintBottom_toBottomOf="@+id/passwordView" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="@+id/passwordView" + tools:visibility="visible" /> + + <CheckBox + android:id="@+id/savePasswordCheckBox" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginTop="16dp" + android:layout_marginBottom="16dp" + android:checked="true" + android:text="@string/config_save_password" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toStartOf="@+id/okButton" + app:layout_constraintHorizontal_chainStyle="spread_inside" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/passwordView" + app:layout_constraintVertical_bias="0.0" /> + + <com.google.android.material.button.MaterialButton + android:id="@+id/okButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="16dp" + android:text="@string/config_ok" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@+id/savePasswordCheckBox" + app:layout_constraintTop_toBottomOf="@+id/passwordView" + app:layout_constraintVertical_bias="0.0" /> + + <ProgressBar + android:id="@+id/progressBar" + style="?android:attr/progressBarStyle" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:visibility="invisible" + app:layout_constraintBottom_toBottomOf="@+id/okButton" + app:layout_constraintEnd_toEndOf="@+id/okButton" + app:layout_constraintStart_toStartOf="@+id/okButton" + app:layout_constraintTop_toTopOf="@+id/okButton" + tools:visibility="visible" /> + + <TextView + android:id="@+id/configDocsView" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_margin="16dp" + android:text="@string/config_docs" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/okButton" /> + + </androidx.constraintlayout.widget.ConstraintLayout> + +</ScrollView> diff --git a/merchant-terminal/src/main/res/layout/fragment_merchant_history.xml b/merchant-terminal/src/main/res/layout/fragment_merchant_history.xml new file mode 100644 index 0000000..21e6f08 --- /dev/null +++ b/merchant-terminal/src/main/res/layout/fragment_merchant_history.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ This file is part of GNU Taler + ~ (C) 2020 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.swiperefreshlayout.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/swipeRefresh" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/list_history" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:scrollbars="vertical" /> + +</androidx.swiperefreshlayout.widget.SwipeRefreshLayout> diff --git a/merchant-terminal/src/main/res/layout/fragment_order.xml b/merchant-terminal/src/main/res/layout/fragment_order.xml new file mode 100644 index 0000000..4af9c77 --- /dev/null +++ b/merchant-terminal/src/main/res/layout/fragment_order.xml @@ -0,0 +1,138 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ This file is part of GNU Taler + ~ (C) 2020 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"> + + <androidx.fragment.app.FragmentContainerView + android:id="@+id/fragment1" + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_marginBottom="8dp" + app:layout_constraintBottom_toTopOf="@+id/restartButton" + app:layout_constraintEnd_toStartOf="@+id/guideline1" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + tools:layout="@layout/fragment_order_state" /> + + <androidx.constraintlayout.widget.Guideline + android:id="@+id/guideline1" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + app:layout_constraintGuide_percent="0.25" /> + + <androidx.fragment.app.FragmentContainerView + android:id="@+id/fragment2" + android:name="net.taler.merchantpos.order.ProductsFragment" + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_marginBottom="8dp" + app:layout_constraintBottom_toTopOf="@+id/restartButton" + app:layout_constraintEnd_toStartOf="@+id/guideline2" + app:layout_constraintStart_toStartOf="@+id/guideline1" + app:layout_constraintTop_toTopOf="parent" + tools:layout="@layout/fragment_products" /> + + <androidx.constraintlayout.widget.Guideline + android:id="@+id/guideline2" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + app:layout_constraintGuide_percent="0.75" /> + + <androidx.fragment.app.FragmentContainerView + android:id="@+id/fragment3" + android:name="net.taler.merchantpos.order.CategoriesFragment" + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_marginBottom="8dp" + app:layout_constraintBottom_toTopOf="@+id/restartButton" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="@+id/guideline2" + app:layout_constraintTop_toTopOf="parent" + tools:layout="@layout/fragment_categories" /> + + <Button + android:id="@+id/restartButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="8dp" + android:backgroundTint="@color/button_bottom" + android:text="@string/order_restart" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" /> + + <Button + android:id="@+id/plusButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:minWidth="48dp" + android:text="+1" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@+id/minusButton" + tools:ignore="HardcodedText" /> + + <Button + android:id="@+id/minusButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="32dp" + android:minWidth="48dp" + android:text="-1" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@+id/restartButton" + tools:ignore="HardcodedText" /> + + <Button + android:id="@+id/prevButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="32dp" + android:backgroundTint="@color/button_bottom" + android:text="@string/order_previous" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@+id/plusButton" /> + + <Button + android:id="@+id/nextButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:backgroundTint="@color/button_bottom" + android:text="@string/order_next" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@+id/prevButton" /> + + <Button + android:id="@+id/completeButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="32dp" + android:layout_marginEnd="8dp" + android:backgroundTint="@color/button_bottom" + android:text="@string/order_complete" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="1.0" + app:layout_constraintStart_toEndOf="@+id/nextButton" /> + +</androidx.constraintlayout.widget.ConstraintLayout> diff --git a/merchant-terminal/src/main/res/layout/fragment_order_state.xml b/merchant-terminal/src/main/res/layout/fragment_order_state.xml new file mode 100644 index 0000000..7d6b258 --- /dev/null +++ b/merchant-terminal/src/main/res/layout/fragment_order_state.xml @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ This file is part of GNU Taler + ~ (C) 2020 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"> + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/orderList" + android:layout_width="0dp" + android:layout_height="0dp" + app:layout_constraintBottom_toTopOf="@+id/totalView" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + tools:listitem="@layout/list_item_order" /> + + <TextView + android:id="@+id/totalView" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:background="@color/highlightedBackground" + android:elevation="2dp" + android:gravity="center_vertical|end" + android:padding="8dp" + android:textColor="?android:textColorPrimary" + android:textSize="16sp" + android:visibility="invisible" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/orderList" + tools:text="Total: 23.75 TESTKUDOS" + tools:visibility="visible" /> + +</androidx.constraintlayout.widget.ConstraintLayout> diff --git a/merchant-terminal/src/main/res/layout/fragment_payment_success.xml b/merchant-terminal/src/main/res/layout/fragment_payment_success.xml new file mode 100644 index 0000000..1bc9be7 --- /dev/null +++ b/merchant-terminal/src/main/res/layout/fragment_payment_success.xml @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ This file is part of GNU Taler + ~ (C) 2020 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" + tools:context=".payment.PaymentSuccessFragment"> + + <ImageView + android:id="@+id/paymentIcon" + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_margin="16dp" + android:src="@drawable/ic_check_circle" + app:layout_constraintBottom_toTopOf="@+id/paymentLabel" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_chainStyle="spread_inside" + tools:ignore="ContentDescription" /> + + <TextView + android:id="@+id/paymentLabel" + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_margin="16dp" + android:gravity="center_horizontal|top" + android:text="@string/payment_received" + android:textColor="@color/green" + app:autoSizeMaxTextSize="42sp" + app:autoSizeTextType="uniform" + app:layout_constraintBottom_toTopOf="@+id/paymentButton" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/paymentIcon" /> + + <androidx.constraintlayout.widget.Guideline + android:id="@+id/guidelineLeft" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + app:layout_constraintGuide_percent="0.25" /> + + <androidx.constraintlayout.widget.Guideline + android:id="@+id/guidelineRight" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + app:layout_constraintGuide_percent="0.75" /> + + <Button + android:id="@+id/paymentButton" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_margin="16dp" + android:text="@string/payment_back_button" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toStartOf="@+id/guidelineRight" + app:layout_constraintStart_toStartOf="@+id/guidelineLeft" /> + +</androidx.constraintlayout.widget.ConstraintLayout> diff --git a/merchant-terminal/src/main/res/layout/fragment_process_payment.xml b/merchant-terminal/src/main/res/layout/fragment_process_payment.xml new file mode 100644 index 0000000..6cd8ea1 --- /dev/null +++ b/merchant-terminal/src/main/res/layout/fragment_process_payment.xml @@ -0,0 +1,110 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ This file is part of GNU Taler + ~ (C) 2020 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" + tools:context=".payment.ProcessPaymentFragment"> + + <ImageView + android:id="@+id/qrcodeView" + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_margin="32dp" + android:visibility="invisible" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toStartOf="@+id/guideline" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + tools:ignore="ContentDescription" + tools:src="@tools:sample/avatars" + tools:visibility="visible" /> + + <ProgressBar + android:id="@+id/progressBar" + style="?android:attr/progressBarStyleLarge" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + app:layout_constraintBottom_toBottomOf="@+id/qrcodeView" + app:layout_constraintEnd_toEndOf="@+id/qrcodeView" + app:layout_constraintStart_toStartOf="@+id/qrcodeView" + app:layout_constraintTop_toTopOf="@+id/qrcodeView" /> + + <androidx.constraintlayout.widget.Guideline + android:id="@+id/guideline" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + app:layout_constraintGuide_percent="0.54" /> + + <TextView + android:id="@+id/payIntroView" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_margin="16dp" + android:text="@string/payment_intro_nfc" + android:textAlignment="center" + android:textSize="24sp" + android:visibility="invisible" + app:layout_constraintBottom_toTopOf="@+id/amountView" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="@+id/guideline" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_chainStyle="spread" + tools:visibility="visible" /> + + <TextView + android:id="@+id/amountView" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="16dp" + android:textAppearance="@style/TextAppearance.AppCompat.Headline" + app:layout_constraintBottom_toTopOf="@+id/orderRefView" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="@+id/guideline" + app:layout_constraintTop_toBottomOf="@+id/payIntroView" + tools:text="10.49 TESTKUDOS" /> + + <TextView + android:id="@+id/orderRefView" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_margin="16dp" + android:textAlignment="center" + android:visibility="invisible" + app:layout_constraintBottom_toTopOf="@id/cancelPaymentButton" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="@+id/guideline" + app:layout_constraintTop_toBottomOf="@+id/amountView" + tools:text="@string/payment_order_ref" + tools:visibility="visible" /> + + <Button + android:id="@+id/cancelPaymentButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="16dp" + android:backgroundTint="@color/red" + android:text="@string/payment_cancel" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" + app:layout_constraintStart_toStartOf="@+id/guideline" /> + +</androidx.constraintlayout.widget.ConstraintLayout> diff --git a/merchant-terminal/src/main/res/layout/fragment_products.xml b/merchant-terminal/src/main/res/layout/fragment_products.xml new file mode 100644 index 0000000..f0e86e7 --- /dev/null +++ b/merchant-terminal/src/main/res/layout/fragment_products.xml @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ This file is part of GNU Taler + ~ (C) 2020 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" + android:layout_width="match_parent" + xmlns:tools="http://schemas.android.com/tools" + android:layout_height="match_parent"> + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/productsList" + android:layout_width="0dp" + android:layout_height="0dp" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + tools:listitem="@layout/list_item_product" /> + + <ProgressBar + android:id="@+id/progressBar" + style="?android:attr/progressBarStyleLarge" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + +</androidx.constraintlayout.widget.ConstraintLayout> diff --git a/merchant-terminal/src/main/res/layout/fragment_refund.xml b/merchant-terminal/src/main/res/layout/fragment_refund.xml new file mode 100644 index 0000000..5a78cdd --- /dev/null +++ b/merchant-terminal/src/main/res/layout/fragment_refund.xml @@ -0,0 +1,122 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + ~ This file is part of GNU Taler + ~ (C) 2020 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" + tools:context=".history.RefundFragment"> + + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/amountView" + style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="16dp" + android:hint="@string/refund_amount" + app:boxBackgroundMode="outline" + app:endIconMode="clear_text" + app:endIconTint="?attr/colorControlNormal" + app:layout_constraintBottom_toTopOf="@+id/reasonView" + app:layout_constraintEnd_toStartOf="@+id/currencyView" + app:layout_constraintHorizontal_chainStyle="packed" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_chainStyle="spread"> + + <com.google.android.material.textfield.TextInputEditText + android:id="@+id/amountInputView" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:ems="6" + android:inputType="numberDecimal" + tools:text="23.42" /> + + </com.google.android.material.textfield.TextInputLayout> + + <TextView + android:id="@+id/currencyView" + android:layout_width="wrap_content" + android:layout_height="0dp" + android:layout_marginStart="8dp" + android:gravity="start|center_vertical" + app:layout_constraintBottom_toBottomOf="@+id/amountView" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@+id/amountView" + app:layout_constraintTop_toTopOf="@+id/amountView" + tools:text="TESTKUDOS" /> + + <com.google.android.material.textfield.TextInputLayout + android:id="@+id/reasonView" + style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_margin="16dp" + android:hint="@string/refund_reason" + app:endIconMode="clear_text" + app:layout_constraintBottom_toTopOf="@+id/abortButton" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/amountView"> + + <com.google.android.material.textfield.TextInputEditText + android:id="@+id/reasonInputView" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:inputType="textAutoComplete|textAutoCorrect|textMultiLine" /> + + </com.google.android.material.textfield.TextInputLayout> + + <Button + android:id="@+id/abortButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="16dp" + android:backgroundTint="@color/red" + android:text="@string/refund_abort" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toStartOf="@+id/refundButton" + app:layout_constraintHorizontal_bias="0.76" + app:layout_constraintHorizontal_chainStyle="spread_inside" + app:layout_constraintStart_toStartOf="parent" /> + + <Button + android:id="@+id/refundButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="16dp" + android:backgroundTint="@color/green" + android:text="@string/refund_confirm" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toEndOf="@+id/abortButton" /> + + <ProgressBar + android:id="@+id/progressBar" + style="?android:attr/progressBarStyle" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:visibility="invisible" + app:layout_constraintBottom_toBottomOf="@+id/refundButton" + app:layout_constraintEnd_toEndOf="@+id/refundButton" + app:layout_constraintStart_toStartOf="@+id/refundButton" + app:layout_constraintTop_toTopOf="@+id/refundButton" + tools:visibility="visible" /> + +</androidx.constraintlayout.widget.ConstraintLayout> diff --git a/merchant-terminal/src/main/res/layout/fragment_refund_uri.xml b/merchant-terminal/src/main/res/layout/fragment_refund_uri.xml new file mode 100644 index 0000000..8447d28 --- /dev/null +++ b/merchant-terminal/src/main/res/layout/fragment_refund_uri.xml @@ -0,0 +1,93 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + ~ This file is part of GNU Taler + ~ (C) 2020 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" + tools:context=".payment.ProcessPaymentFragment"> + + <ImageView + android:id="@+id/refundQrcodeView" + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_margin="32dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toStartOf="@+id/guideline" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + tools:ignore="ContentDescription" + tools:src="@tools:sample/avatars" /> + + <androidx.constraintlayout.widget.Guideline + android:id="@+id/guideline" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + app:layout_constraintGuide_percent="0.54" /> + + <TextView + android:id="@+id/refundIntroView" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_margin="16dp" + android:text="@string/refund_intro_nfc" + android:textAlignment="center" + android:textSize="24sp" + app:layout_constraintBottom_toTopOf="@+id/refundAmountView" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="@+id/guideline" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_chainStyle="spread" /> + + <TextView + android:id="@+id/refundAmountView" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="16dp" + android:textAppearance="@style/TextAppearance.AppCompat.Headline" + app:layout_constraintBottom_toTopOf="@+id/refundRefView" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="@+id/guideline" + app:layout_constraintTop_toBottomOf="@+id/refundIntroView" + tools:text="10.49 TESTKUDOS" /> + + <TextView + android:id="@+id/refundRefView" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_margin="16dp" + android:textAlignment="center" + app:layout_constraintBottom_toTopOf="@id/cancelRefundButton" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="@+id/guideline" + app:layout_constraintTop_toBottomOf="@+id/refundAmountView" + tools:text="@string/refund_order_ref" /> + + <Button + android:id="@+id/cancelRefundButton" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_margin="16dp" + android:backgroundTint="@color/red" + android:text="@string/refund_abort" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" + app:layout_constraintStart_toStartOf="@+id/guideline" /> + +</androidx.constraintlayout.widget.ConstraintLayout> diff --git a/merchant-terminal/src/main/res/layout/list_item_category.xml b/merchant-terminal/src/main/res/layout/list_item_category.xml new file mode 100644 index 0000000..cbdbd34 --- /dev/null +++ b/merchant-terminal/src/main/res/layout/list_item_category.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ This file is part of GNU Taler + ~ (C) 2020 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="wrap_content"> + + <Button + android:id="@+id/button" + android:layout_width="0dp" + android:layout_height="wrap_content" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + tools:text="Snacks" /> + +</androidx.constraintlayout.widget.ConstraintLayout> diff --git a/merchant-terminal/src/main/res/layout/list_item_history.xml b/merchant-terminal/src/main/res/layout/list_item_history.xml new file mode 100644 index 0000000..fe485ba --- /dev/null +++ b/merchant-terminal/src/main/res/layout/list_item_history.xml @@ -0,0 +1,97 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + ~ This file is part of GNU Taler + ~ (C) 2020 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="wrap_content" + android:padding="16dp"> + + <TextView + android:id="@+id/orderSummaryView" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:textColor="?android:attr/textColorPrimary" + android:textSize="20sp" + android:textStyle="bold" + app:layout_constraintEnd_toStartOf="@+id/orderAmountView" + app:layout_constraintHorizontal_bias="1.0" + app:layout_constraintHorizontal_chainStyle="spread_inside" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + tools:text="One Cappuccino or another name that can be so long that it spans more than one line" /> + + <TextView + android:id="@+id/orderAmountView" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="8dp" + android:layout_marginEnd="16dp" + android:textColor="?android:attr/textColorPrimary" + android:textSize="20sp" + android:textStyle="bold" + app:layout_constraintBottom_toBottomOf="@+id/orderSummaryView" + app:layout_constraintEnd_toStartOf="@+id/refundButton" + app:layout_constraintStart_toEndOf="@+id/orderSummaryView" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_bias="0.0" + tools:text="23.42 TESTKUDOS" /> + + <TextView + android:id="@+id/orderIdView" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginTop="8dp" + android:text="@string/history_ref_no" + android:textAllCaps="false" + android:textSize="20sp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toStartOf="@+id/orderTimeView" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintHorizontal_chainStyle="spread_inside" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/orderSummaryView" /> + + <TextView + android:id="@+id/orderTimeView" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + android:layout_marginEnd="16dp" + android:textSize="20sp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toStartOf="@+id/refundButton" + app:layout_constraintStart_toEndOf="@+id/orderIdView" + app:layout_constraintTop_toBottomOf="@+id/orderAmountView" + app:layout_constraintVertical_bias="1.0" + tools:text="3 hrs. ago" /> + + <ImageButton + android:id="@+id/refundButton" + android:layout_width="48dp" + android:layout_height="48dp" + android:backgroundTint="?colorPrimary" + android:contentDescription="@string/history_refund" + android:tint="?attr/colorOnPrimary" + android:visibility="gone" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:srcCompat="@drawable/ic_cash_refund" /> + +</androidx.constraintlayout.widget.ConstraintLayout> diff --git a/merchant-terminal/src/main/res/layout/list_item_order.xml b/merchant-terminal/src/main/res/layout/list_item_order.xml new file mode 100644 index 0000000..f88364d --- /dev/null +++ b/merchant-terminal/src/main/res/layout/list_item_order.xml @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ This file is part of GNU Taler + ~ (C) 2020 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="wrap_content" + android:background="@drawable/selectable_background" + android:minHeight="48dp" + android:padding="8dp"> + + <TextView + android:id="@+id/quantity" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:gravity="end" + android:minWidth="24dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="@+id/name" + app:layout_constraintVertical_bias="0.0" + tools:text="31" /> + + <TextView + android:id="@+id/name" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="8dp" + android:layout_marginEnd="8dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toStartOf="@+id/price" + app:layout_constraintStart_toEndOf="@+id/quantity" + app:layout_constraintTop_toTopOf="parent" + tools:text="An order product item that in some cases could have a very long name" /> + + <TextView + android:id="@+id/price" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="@+id/name" + app:layout_constraintVertical_bias="0.0" + tools:text="23.42" /> + +</androidx.constraintlayout.widget.ConstraintLayout> diff --git a/merchant-terminal/src/main/res/layout/list_item_product.xml b/merchant-terminal/src/main/res/layout/list_item_product.xml new file mode 100644 index 0000000..1037bef --- /dev/null +++ b/merchant-terminal/src/main/res/layout/list_item_product.xml @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ This file is part of GNU Taler + ~ (C) 2020 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/> + --> + +<com.google.android.material.card.MaterialCardView 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="wrap_content" + android:layout_margin="4dp" + android:clickable="true" + android:focusable="true" + app:cardUseCompatPadding="true"> + + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="8dp"> + + <TextView + android:id="@+id/name" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:textColor="?android:textColorPrimary" + android:textStyle="bold" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + tools:text="Steak and two Eggs" /> + + <TextView + android:id="@+id/price" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginTop="8dp" + android:textColor="?android:textColorSecondary" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toBottomOf="@+id/name" + tools:text="7.95" /> + + </androidx.constraintlayout.widget.ConstraintLayout> + +</com.google.android.material.card.MaterialCardView>
\ No newline at end of file diff --git a/merchant-terminal/src/main/res/layout/nav_header_main.xml b/merchant-terminal/src/main/res/layout/nav_header_main.xml new file mode 100644 index 0000000..14bbd51 --- /dev/null +++ b/merchant-terminal/src/main/res/layout/nav_header_main.xml @@ -0,0 +1,55 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ This file is part of GNU Taler + ~ (C) 2020 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/> + --> + +<LinearLayout 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="@dimen/nav_header_height" + android:background="@drawable/side_nav_bar" + android:gravity="bottom" + android:orientation="vertical" + android:paddingLeft="@dimen/activity_horizontal_margin" + android:paddingTop="@dimen/activity_vertical_margin" + android:paddingRight="@dimen/activity_horizontal_margin" + android:paddingBottom="@dimen/activity_vertical_margin" + android:theme="@style/AppTheme"> + + <ImageView + android:id="@+id/imageView" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:paddingTop="@dimen/nav_header_vertical_spacing" + app:srcCompat="@mipmap/ic_taler_logo_round" + tools:ignore="ContentDescription" /> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingTop="@dimen/nav_header_vertical_spacing" + android:text="@string/project_name" + android:textAppearance="@style/TextAppearance.AppCompat.Body1" + android:textColor="#FFF" /> + + <TextView + android:id="@+id/textView" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/app_name_short" + android:textColor="#FFF" /> + +</LinearLayout> diff --git a/merchant-terminal/src/main/res/menu/activity_main_drawer.xml b/merchant-terminal/src/main/res/menu/activity_main_drawer.xml new file mode 100644 index 0000000..1303605 --- /dev/null +++ b/merchant-terminal/src/main/res/menu/activity_main_drawer.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ This file is part of GNU Taler + ~ (C) 2020 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/> + --> + +<menu xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + tools:showIn="navigation_view"> + + <group android:checkableBehavior="single"> + <item + android:id="@+id/nav_order" + android:icon="@drawable/ic_move_money_24dp" + android:title="@string/menu_order" /> + <item + android:id="@+id/nav_history" + android:icon="@drawable/ic_history_black_24dp" + android:title="@string/menu_history" /> + <item + android:id="@+id/nav_settings" + android:icon="@drawable/ic_menu_manage" + android:title="@string/menu_settings" /> + </group> +</menu> diff --git a/merchant-terminal/src/main/res/mipmap-anydpi-v26/ic_taler_logo.xml b/merchant-terminal/src/main/res/mipmap-anydpi-v26/ic_taler_logo.xml new file mode 100644 index 0000000..c4a603d --- /dev/null +++ b/merchant-terminal/src/main/res/mipmap-anydpi-v26/ic_taler_logo.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@drawable/ic_launcher_background"/> + <foreground android:drawable="@mipmap/ic_launcher_foreground"/> +</adaptive-icon>
\ No newline at end of file diff --git a/merchant-terminal/src/main/res/mipmap-anydpi-v26/ic_taler_logo_round.xml b/merchant-terminal/src/main/res/mipmap-anydpi-v26/ic_taler_logo_round.xml new file mode 100644 index 0000000..c4a603d --- /dev/null +++ b/merchant-terminal/src/main/res/mipmap-anydpi-v26/ic_taler_logo_round.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android"> + <background android:drawable="@drawable/ic_launcher_background"/> + <foreground android:drawable="@mipmap/ic_launcher_foreground"/> +</adaptive-icon>
\ No newline at end of file diff --git a/merchant-terminal/src/main/res/mipmap-hdpi/ic_launcher_foreground.png b/merchant-terminal/src/main/res/mipmap-hdpi/ic_launcher_foreground.png Binary files differnew file mode 100644 index 0000000..75273ec --- /dev/null +++ b/merchant-terminal/src/main/res/mipmap-hdpi/ic_launcher_foreground.png diff --git a/merchant-terminal/src/main/res/mipmap-hdpi/ic_taler_logo.png b/merchant-terminal/src/main/res/mipmap-hdpi/ic_taler_logo.png Binary files differnew file mode 100644 index 0000000..eaecede --- /dev/null +++ b/merchant-terminal/src/main/res/mipmap-hdpi/ic_taler_logo.png diff --git a/merchant-terminal/src/main/res/mipmap-hdpi/ic_taler_logo_round.png b/merchant-terminal/src/main/res/mipmap-hdpi/ic_taler_logo_round.png Binary files differnew file mode 100644 index 0000000..caa2a3e --- /dev/null +++ b/merchant-terminal/src/main/res/mipmap-hdpi/ic_taler_logo_round.png diff --git a/merchant-terminal/src/main/res/mipmap-mdpi/ic_launcher_foreground.png b/merchant-terminal/src/main/res/mipmap-mdpi/ic_launcher_foreground.png Binary files differnew file mode 100644 index 0000000..a450287 --- /dev/null +++ b/merchant-terminal/src/main/res/mipmap-mdpi/ic_launcher_foreground.png diff --git a/merchant-terminal/src/main/res/mipmap-mdpi/ic_taler_logo.png b/merchant-terminal/src/main/res/mipmap-mdpi/ic_taler_logo.png Binary files differnew file mode 100644 index 0000000..e1f7374 --- /dev/null +++ b/merchant-terminal/src/main/res/mipmap-mdpi/ic_taler_logo.png diff --git a/merchant-terminal/src/main/res/mipmap-mdpi/ic_taler_logo_round.png b/merchant-terminal/src/main/res/mipmap-mdpi/ic_taler_logo_round.png Binary files differnew file mode 100644 index 0000000..e92d2d3 --- /dev/null +++ b/merchant-terminal/src/main/res/mipmap-mdpi/ic_taler_logo_round.png diff --git a/merchant-terminal/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png b/merchant-terminal/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png Binary files differnew file mode 100644 index 0000000..a5e875c --- /dev/null +++ b/merchant-terminal/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png diff --git a/merchant-terminal/src/main/res/mipmap-xhdpi/ic_taler_logo.png b/merchant-terminal/src/main/res/mipmap-xhdpi/ic_taler_logo.png Binary files differnew file mode 100644 index 0000000..5ca4409 --- /dev/null +++ b/merchant-terminal/src/main/res/mipmap-xhdpi/ic_taler_logo.png diff --git a/merchant-terminal/src/main/res/mipmap-xhdpi/ic_taler_logo_round.png b/merchant-terminal/src/main/res/mipmap-xhdpi/ic_taler_logo_round.png Binary files differnew file mode 100644 index 0000000..12b9056 --- /dev/null +++ b/merchant-terminal/src/main/res/mipmap-xhdpi/ic_taler_logo_round.png diff --git a/merchant-terminal/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png b/merchant-terminal/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png Binary files differnew file mode 100644 index 0000000..e9d1fc9 --- /dev/null +++ b/merchant-terminal/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png diff --git a/merchant-terminal/src/main/res/mipmap-xxhdpi/ic_taler_logo.png b/merchant-terminal/src/main/res/mipmap-xxhdpi/ic_taler_logo.png Binary files differnew file mode 100644 index 0000000..a786efa --- /dev/null +++ b/merchant-terminal/src/main/res/mipmap-xxhdpi/ic_taler_logo.png diff --git a/merchant-terminal/src/main/res/mipmap-xxhdpi/ic_taler_logo_round.png b/merchant-terminal/src/main/res/mipmap-xxhdpi/ic_taler_logo_round.png Binary files differnew file mode 100644 index 0000000..b22a84e --- /dev/null +++ b/merchant-terminal/src/main/res/mipmap-xxhdpi/ic_taler_logo_round.png diff --git a/merchant-terminal/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png b/merchant-terminal/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png Binary files differnew file mode 100644 index 0000000..f8037d1 --- /dev/null +++ b/merchant-terminal/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png diff --git a/merchant-terminal/src/main/res/mipmap-xxxhdpi/ic_taler_logo.png b/merchant-terminal/src/main/res/mipmap-xxxhdpi/ic_taler_logo.png Binary files differnew file mode 100644 index 0000000..0e9df6a --- /dev/null +++ b/merchant-terminal/src/main/res/mipmap-xxxhdpi/ic_taler_logo.png diff --git a/merchant-terminal/src/main/res/mipmap-xxxhdpi/ic_taler_logo_round.png b/merchant-terminal/src/main/res/mipmap-xxxhdpi/ic_taler_logo_round.png Binary files differnew file mode 100644 index 0000000..6bef9bd --- /dev/null +++ b/merchant-terminal/src/main/res/mipmap-xxxhdpi/ic_taler_logo_round.png diff --git a/merchant-terminal/src/main/res/navigation/nav_graph.xml b/merchant-terminal/src/main/res/navigation/nav_graph.xml new file mode 100644 index 0000000..2e337f2 --- /dev/null +++ b/merchant-terminal/src/main/res/navigation/nav_graph.xml @@ -0,0 +1,137 @@ +<?xml version="1.0" encoding="utf-8"?><!-- + ~ This file is part of GNU Taler + ~ (C) 2020 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/> + --> + +<navigation 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/nav_graph" + app:startDestination="@+id/nav_order" + tools:ignore="UnusedNavigation"> + + <fragment + android:id="@+id/nav_order" + android:name="net.taler.merchantpos.order.OrderFragment" + android:label="" + tools:layout="@layout/fragment_order"> + <action + android:id="@+id/action_order_to_merchantSettings" + app:destination="@+id/nav_settings" + app:launchSingleTop="true" + app:popUpTo="@+id/nav_graph" + app:popUpToInclusive="true" /> + <action + android:id="@+id/action_order_self" + app:destination="@+id/nav_order" + app:popUpTo="@+id/nav_graph" /> + <action + android:id="@+id/action_order_to_processPayment" + app:destination="@+id/processPayment" /> + </fragment> + + <fragment + android:id="@+id/processPayment" + android:name="net.taler.merchantpos.payment.ProcessPaymentFragment" + android:label="@string/payment_process_label" + tools:layout="@layout/fragment_process_payment"> + <action + android:id="@+id/action_processPayment_to_paymentSuccess" + app:destination="@+id/paymentSuccess" + app:popUpTo="@id/nav_order" /> + </fragment> + + <fragment + android:id="@+id/nav_history" + android:name="net.taler.merchantpos.history.MerchantHistoryFragment" + android:label="@string/history_label" + tools:layout="@layout/fragment_merchant_history"> + <action + android:id="@+id/action_nav_history_to_refundFragment" + app:destination="@id/refundFragment" /> + </fragment> + + <fragment + android:id="@+id/refundFragment" + android:name="net.taler.merchantpos.history.RefundFragment" + android:label="@string/history_refund" + tools:layout="@layout/fragment_refund"> + <action + android:id="@+id/action_refundFragment_to_refundUriFragment" + app:destination="@id/refundUriFragment" /> + </fragment> + + <fragment + android:id="@+id/refundUriFragment" + android:name="net.taler.merchantpos.history.RefundUriFragment" + android:label="@string/history_refund" + tools:layout="@layout/fragment_refund_uri" /> + + <fragment + android:id="@+id/nav_settings" + android:name="net.taler.merchantpos.config.MerchantConfigFragment" + android:label="@string/config_label" + tools:layout="@layout/fragment_merchant_config"> + <action + android:id="@+id/action_settings_to_order" + app:destination="@+id/nav_order" + app:launchSingleTop="true" + app:popUpTo="@+id/nav_graph" + app:popUpToInclusive="true" /> + </fragment> + + <fragment + android:id="@+id/configFetcher" + android:name="net.taler.merchantpos.config.ConfigFetcherFragment" + android:label="@string/config_fetching_label" + tools:layout="@layout/fragment_config_fetcher"> + <action + android:id="@+id/action_configFetcher_to_merchantSettings" + app:destination="@+id/nav_settings" + app:launchSingleTop="true" + app:popUpTo="@+id/nav_graph" + app:popUpToInclusive="true" /> + <action + android:id="@+id/action_configFetcher_to_order" + app:destination="@+id/nav_order" + app:launchSingleTop="true" + app:popUpTo="@+id/nav_graph" + app:popUpToInclusive="true" /> + </fragment> + + <fragment + android:id="@+id/paymentSuccess" + android:name="net.taler.merchantpos.payment.PaymentSuccessFragment" + android:label="@string/payment_received" + tools:layout="@layout/fragment_payment_success" /> + + <action + android:id="@+id/action_global_order" + app:destination="@+id/nav_order" + app:launchSingleTop="true" + app:popUpTo="@+id/nav_graph" /> + <action + android:id="@+id/action_global_merchantHistory" + app:destination="@+id/nav_history" + app:launchSingleTop="true" /> + <action + android:id="@+id/action_global_merchantSettings" + app:destination="@+id/nav_settings" + app:launchSingleTop="true" /> + <action + android:id="@+id/action_global_configFetcher" + app:destination="@+id/configFetcher" + app:launchSingleTop="true" /> + +</navigation> diff --git a/merchant-terminal/src/main/res/values-night/colors.xml b/merchant-terminal/src/main/res/values-night/colors.xml new file mode 100644 index 0000000..10bdbb9 --- /dev/null +++ b/merchant-terminal/src/main/res/values-night/colors.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <color name="highlightedBackground">#2E2E2E</color> + <color name="selectedBackground">#363636</color> +</resources> diff --git a/merchant-terminal/src/main/res/values/colors.xml b/merchant-terminal/src/main/res/values/colors.xml new file mode 100644 index 0000000..bf0c849 --- /dev/null +++ b/merchant-terminal/src/main/res/values/colors.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <color name="colorPrimary">#795548</color> + <color name="colorPrimaryDark">#5D4037</color> + <color name="colorAccent">#FFEB3B</color> + + <color name="highlightedBackground">#E4E4E4</color> + <color name="selectedBackground">#DADADA</color> + <color name="bottomButtons">#9E9D24</color> + + <color name="green">#388E3C</color> + <color name="red">#C62828</color> + +</resources> diff --git a/merchant-terminal/src/main/res/values/dimens.xml b/merchant-terminal/src/main/res/values/dimens.xml new file mode 100644 index 0000000..eedc3c6 --- /dev/null +++ b/merchant-terminal/src/main/res/values/dimens.xml @@ -0,0 +1,6 @@ +<resources> + <dimen name="activity_horizontal_margin">16dp</dimen> + <dimen name="activity_vertical_margin">16dp</dimen> + <dimen name="nav_header_vertical_spacing">8dp</dimen> + <dimen name="nav_header_height">176dp</dimen> +</resources>
\ No newline at end of file diff --git a/merchant-terminal/src/main/res/values/strings.xml b/merchant-terminal/src/main/res/values/strings.xml new file mode 100644 index 0000000..77c7e03 --- /dev/null +++ b/merchant-terminal/src/main/res/values/strings.xml @@ -0,0 +1,68 @@ +<resources> + <string name="app_name">Taler Merchant PoS Terminal</string> + <string name="app_name_short">Merchant Terminal</string> + <string name="project_name">GNU Taler</string> + + <string name="menu_order">Orders</string> + <string name="menu_history">History</string> + <string name="menu_settings">Settings</string> + + <string name="order_label_title">Order #%s</string> + <!-- The first placeholder is the amount and the second the currency --> + <string name="order_total">Total: %1$.2f %2$s</string> + <string name="order_restart">Restart</string> + <string name="order_undo">Undo</string> + <string name="order_previous">Prev</string> + <string name="order_next">Next</string> + <string name="order_complete">Complete</string> + + <string name="config_label">Merchant Settings</string> + <string name="config_url">Configuration URL</string> + <string name="config_username">Username</string> + <string name="config_password">Password</string> + <string name="config_ok">Fetch Configuration</string> + <string name="config_auth_error">Error: Invalid username or password</string> + <string name="config_error_network">Error: Could not connect to configuration server</string> + <string name="config_error_category">Error: No valid product category found</string> + <string name="config_error_malformed">Error: The configuration JSON is malformed</string> + <string name="config_error_currency">Error: Product %1$s has currency %2$s, but %3$s expected</string> + <string name="config_error_product_category_id">Error: Product %1$s references unknown category ID %2$d</string> + <string name="config_error_product_zero">Error: No valid products found</string> + <string name="config_error_unknown">Error: Invalid Configuration</string> + <string name="config_fetching">Fetching Configuration…</string> + <string name="config_save_password">Remember Password</string> + <string name="config_forget_password">Forget</string> + <string name="config_changed">Changed to new merchant using %s</string> + <string name="config_fetching_label">Fetching Configuration</string> + <string name="config_docs">Please refer to <a href="https://docs.taler.net/taler-merchant-pos-terminal.html#apis-and-data-formats">the documentation</a> for the configuration format.</string> + + <string name="payment_intro_nfc">Please scan QR Code or use NFC to pay</string> + <string name="payment_intro">Please scan QR Code to pay</string> + <string name="payment_cancel">Cancel Payment</string> + <string name="payment_received">Payment received</string> + <string name="payment_back_button">Continue</string> + <string name="payment_order_ref">Order Reference: %s</string> + <string name="payment_process_label">Customer Payment Required</string> + <string name="payment_canceled">Payment Canceled</string> + + <string name="history_label">Payment History</string> + <string name="history_received_at">Received at</string> + <string name="history_ref_no">Ref. No: %s</string> + <string name="history_refund">Refund Order</string> + <string name="refund_amount">Amount</string> + <string name="refund_reason">Refund reason</string> + <string name="refund_abort">Abort</string> + <string name="refund_confirm">Give Refund</string> + <string name="refund_error_max_amount">Greater than order amount of %s</string> + <string name="refund_error_zero">Needs to be positive amount</string> + <string name="refund_error_backend">Error processing refund</string> + <string name="refund_error_deadline">Refund deadline has passed</string> + <string name="refund_intro_nfc">Please scan QR Code or use NFC to give refund</string> + <string name="refund_intro">Please scan QR Code to give refund</string> + <string name="refund_order_ref">Order Reference: %1$s\n\n%2$s</string> + + <string name="error_network">Network Error</string> + + <string name="toast_back_to_exit">Click BACK again to exit</string> + +</resources> diff --git a/merchant-terminal/src/main/res/values/styles.xml b/merchant-terminal/src/main/res/values/styles.xml new file mode 100644 index 0000000..4445a01 --- /dev/null +++ b/merchant-terminal/src/main/res/values/styles.xml @@ -0,0 +1,21 @@ +<resources> + <!-- Base application theme. --> + <style name="AppTheme" parent="Theme.MaterialComponents.DayNight.DarkActionBar"> + <!-- Customize your theme here. --> + <item name="colorPrimary">@color/colorPrimary</item> + <item name="colorOnPrimary">@android:color/white</item> + <item name="colorPrimaryDark">@color/colorPrimaryDark</item> + <item name="colorAccent">@color/colorAccent</item> + </style> + + <style name="AppTheme.NoActionBar"> + <item name="windowActionBar">false</item> + <item name="windowNoTitle">true</item> + <item name="android:statusBarColor">@android:color/transparent</item> + </style> + + <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" /> + + <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" /> + +</resources> diff --git a/merchant-terminal/src/main/res/xml/backup_descriptor.xml b/merchant-terminal/src/main/res/xml/backup_descriptor.xml new file mode 100644 index 0000000..6fd6103 --- /dev/null +++ b/merchant-terminal/src/main/res/xml/backup_descriptor.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<full-backup-content> + <!-- Exclude specific shared preferences that contain GCM registration Id --> +</full-backup-content> |