aboutsummaryrefslogtreecommitdiff
path: root/anastasis-ui/src/main/res
diff options
context:
space:
mode:
authorTorsten Grote <t@grobox.de>2020-06-26 11:25:48 -0300
committerTorsten Grote <t@grobox.de>2020-06-26 11:25:48 -0300
commit9cbb35ccc65db7b5d8ce1afe4b3c5feae30be1eb (patch)
tree4e3c857575303b689a0e4c15915ef2ec274a9187 /anastasis-ui/src/main/res
parent730fbaa702b467669c4b88f6c03fa3e1823abf73 (diff)
downloadtaler-android-9cbb35ccc65db7b5d8ce1afe4b3c5feae30be1eb.tar.gz
taler-android-9cbb35ccc65db7b5d8ce1afe4b3c5feae30be1eb.tar.bz2
taler-android-9cbb35ccc65db7b5d8ce1afe4b3c5feae30be1eb.zip
[anastasis] add more countries and allow switching between them
Diffstat (limited to 'anastasis-ui/src/main/res')
-rw-r--r--anastasis-ui/src/main/res/layout/country_germany.xml54
-rw-r--r--anastasis-ui/src/main/res/layout/country_india.xml38
-rw-r--r--anastasis-ui/src/main/res/layout/country_switzerland.xml54
-rw-r--r--anastasis-ui/src/main/res/layout/country_usa.xml38
-rw-r--r--anastasis-ui/src/main/res/layout/fragment_change_location.xml74
-rw-r--r--anastasis-ui/src/main/res/layout/fragment_identity.xml52
-rw-r--r--anastasis-ui/src/main/res/navigation/anastasis.xml13
7 files changed, 281 insertions, 42 deletions
diff --git a/anastasis-ui/src/main/res/layout/country_germany.xml b/anastasis-ui/src/main/res/layout/country_germany.xml
new file mode 100644
index 0000000..5b54843
--- /dev/null
+++ b/anastasis-ui/src/main/res/layout/country_germany.xml
@@ -0,0 +1,54 @@
+<?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"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:padding="16dp"
+ android:orientation="vertical">
+
+ <com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/idNumberInput"
+ style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <com.google.android.material.textfield.TextInputEditText
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:hint="Passport number"
+ android:inputType="number"
+ android:maxLength="13" />
+
+ </com.google.android.material.textfield.TextInputLayout>
+
+ <com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/taxIdInput"
+ style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp">
+
+ <com.google.android.material.textfield.TextInputEditText
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:hint="Krankenversicherungsnummer"
+ android:inputType="number"
+ android:maxLength="13" />
+
+ </com.google.android.material.textfield.TextInputLayout>
+
+</LinearLayout>
diff --git a/anastasis-ui/src/main/res/layout/country_india.xml b/anastasis-ui/src/main/res/layout/country_india.xml
new file mode 100644
index 0000000..a12616e
--- /dev/null
+++ b/anastasis-ui/src/main/res/layout/country_india.xml
@@ -0,0 +1,38 @@
+<?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"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+
+ <com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/idNumberInput"
+ style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_margin="16dp">
+
+ <com.google.android.material.textfield.TextInputEditText
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:hint="Aadhaar number"
+ android:inputType="number"
+ android:maxLength="13" />
+
+ </com.google.android.material.textfield.TextInputLayout>
+
+</LinearLayout>
diff --git a/anastasis-ui/src/main/res/layout/country_switzerland.xml b/anastasis-ui/src/main/res/layout/country_switzerland.xml
new file mode 100644
index 0000000..0fc71fc
--- /dev/null
+++ b/anastasis-ui/src/main/res/layout/country_switzerland.xml
@@ -0,0 +1,54 @@
+<?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"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:padding="16dp"
+ android:orientation="vertical">
+
+ <com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/idNumberInput"
+ style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <com.google.android.material.textfield.TextInputEditText
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:hint="AHV number"
+ android:inputType="number"
+ android:maxLength="13" />
+
+ </com.google.android.material.textfield.TextInputLayout>
+
+ <com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/taxIdInput"
+ style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp">
+
+ <com.google.android.material.textfield.TextInputEditText
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:hint="Krankenversicherungsnummer"
+ android:inputType="number"
+ android:maxLength="13" />
+
+ </com.google.android.material.textfield.TextInputLayout>
+
+</LinearLayout>
diff --git a/anastasis-ui/src/main/res/layout/country_usa.xml b/anastasis-ui/src/main/res/layout/country_usa.xml
new file mode 100644
index 0000000..f9762e6
--- /dev/null
+++ b/anastasis-ui/src/main/res/layout/country_usa.xml
@@ -0,0 +1,38 @@
+<?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"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+
+ <com.google.android.material.textfield.TextInputLayout
+ android:id="@+id/idNumberInput"
+ style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_margin="16dp">
+
+ <com.google.android.material.textfield.TextInputEditText
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:hint="Social security number"
+ android:inputType="number"
+ android:maxLength="13" />
+
+ </com.google.android.material.textfield.TextInputLayout>
+
+</LinearLayout>
diff --git a/anastasis-ui/src/main/res/layout/fragment_change_location.xml b/anastasis-ui/src/main/res/layout/fragment_change_location.xml
new file mode 100644
index 0000000..93c919f
--- /dev/null
+++ b/anastasis-ui/src/main/res/layout/fragment_change_location.xml
@@ -0,0 +1,74 @@
+<?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">
+
+ <TextView
+ android:id="@+id/usaView"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:background="?selectableItemBackground"
+ android:padding="16dp"
+ android:text="United States"
+ android:textAppearance="@style/TextAppearance.AppCompat.Medium"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent" />
+
+ <TextView
+ android:id="@+id/germanyView"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:background="?selectableItemBackground"
+ android:padding="16dp"
+ android:text="Germany"
+ android:textAppearance="@style/TextAppearance.AppCompat.Medium"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/usaView" />
+
+ <TextView
+ android:id="@+id/switzerlandView"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:background="?selectableItemBackground"
+ android:padding="16dp"
+ android:text="Switzerland"
+ android:textAppearance="@style/TextAppearance.AppCompat.Medium"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/germanyView" />
+
+ <TextView
+ android:id="@+id/indiaView"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="16dp"
+ android:background="?selectableItemBackground"
+ android:padding="16dp"
+ android:text="India"
+ android:textAppearance="@style/TextAppearance.AppCompat.Medium"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/switzerlandView" />
+
+</androidx.constraintlayout.widget.ConstraintLayout>
diff --git a/anastasis-ui/src/main/res/layout/fragment_identity.xml b/anastasis-ui/src/main/res/layout/fragment_identity.xml
index e24be31..072414d 100644
--- a/anastasis-ui/src/main/res/layout/fragment_identity.xml
+++ b/anastasis-ui/src/main/res/layout/fragment_identity.xml
@@ -49,7 +49,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
- android:text="Detected Country:"
+ android:text="Country:"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/identityIntro" />
@@ -87,8 +87,8 @@
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:inputType="textPersonName|textCapWords"
- android:hint="Name" />
+ android:hint="Name"
+ android:inputType="textPersonName|textCapWords" />
</com.google.android.material.textfield.TextInputLayout>
@@ -105,8 +105,8 @@
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:inputType="text|textCapWords"
- android:hint="Place of birth" />
+ android:hint="Place of birth"
+ android:inputType="text|textCapWords" />
</com.google.android.material.textfield.TextInputLayout>
@@ -129,46 +129,14 @@
</com.google.android.material.textfield.TextInputLayout>
- <com.google.android.material.textfield.TextInputLayout
- android:id="@+id/idNumberInput"
- style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_margin="16dp"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@+id/birthDateInput"
- app:layout_constraintVertical_bias="0.0">
-
- <com.google.android.material.textfield.TextInputEditText
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:hint="AHV number"
- android:inputType="number"
- android:maxLength="13" />
-
- </com.google.android.material.textfield.TextInputLayout>
-
- <com.google.android.material.textfield.TextInputLayout
- android:id="@+id/taxIdInput"
- style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
- android:layout_width="match_parent"
+ <ViewStub
+ android:id="@+id/stub"
+ android:layout_width="0dp"
android:layout_height="wrap_content"
- android:layout_margin="16dp"
- app:layout_constraintBottom_toTopOf="@+id/createIdentifierButton"
+ android:layout="@layout/country_switzerland"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toBottomOf="@+id/idNumberInput"
- app:layout_constraintVertical_bias="0.0">
-
- <com.google.android.material.textfield.TextInputEditText
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:hint="Tax ID number"
- android:inputType="number"
- android:maxLength="13" />
-
- </com.google.android.material.textfield.TextInputLayout>
+ app:layout_constraintTop_toBottomOf="@+id/birthDateInput" />
<Button
android:id="@+id/createIdentifierButton"
diff --git a/anastasis-ui/src/main/res/navigation/anastasis.xml b/anastasis-ui/src/main/res/navigation/anastasis.xml
index 1e151da..efdddca 100644
--- a/anastasis-ui/src/main/res/navigation/anastasis.xml
+++ b/anastasis-ui/src/main/res/navigation/anastasis.xml
@@ -46,9 +46,22 @@
app:exitAnim="@anim/slide_out_left"
app:popEnterAnim="@android:anim/slide_in_left"
app:popExitAnim="@android:anim/slide_out_right" />
+ <action
+ android:id="@+id/action_nav_anastasis_identity_to_nav_change_location"
+ app:destination="@id/nav_change_location"
+ app:enterAnim="@anim/slide_in_right"
+ app:exitAnim="@anim/slide_out_left"
+ app:popEnterAnim="@android:anim/slide_in_left"
+ app:popExitAnim="@android:anim/slide_out_right" />
</fragment>
<fragment
+ android:id="@+id/nav_change_location"
+ android:name="org.gnu.anastasis.ui.identity.ChangeLocationFragment"
+ android:label="Select country"
+ tools:layout="@layout/fragment_change_location"/>
+
+ <fragment
android:id="@+id/nav_anastasis_authentication"
android:name="org.gnu.anastasis.ui.authentication.AuthenticationFragment"
android:label="Choose authentication methods"