-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RFR-329] Add incentives and group selection to r4r UI (#51)
* [RFR-329] Add achievements ui * Only show achievements in R4R UI * Calculate and show progress * Format valid until into local format * Fake get voucher request * Add copy to clipboard handler * [RFR-451] Add voucher details * [RFR-461] Check voucher count * [RFR-450] Ask group during registration * [STAD-515] Upgrade SDK to 7.7.2 * [RFR-478] Set km goal * Refactor code * [RFR-467] Get auth token for incentives requests * [RFR-467] Call hard-coded staging incentives API * Cleanup and documentation * [RFR-506] Inject incentives API URL
- Loading branch information
Showing
28 changed files
with
825 additions
and
34 deletions.
There are no files selected for viewing
Submodule backend
updated
3 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright 2023 Cyface GmbH | ||
* | ||
* This file is part of the Cyface SDK for Android. | ||
* | ||
* The Cyface SDK for Android 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 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* The Cyface SDK for Android 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 the Cyface SDK for Android. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package de.cyface.app.r4r | ||
|
||
/** | ||
* The groups the user can choose from during registration. | ||
* | ||
* This way we can enable group-specific achievements like vouchers. | ||
* | ||
* @author Armin Schnabel | ||
* @version 1.0.0 | ||
* @since 3.3.0 | ||
* @property databaseIdentifier The [String] which represents the enumeration value in the database. | ||
* @property spinnerText The [String] which is shown in the `Spinner`. | ||
*/ | ||
enum class Group(private val databaseIdentifier: String, val spinnerText: String) { | ||
// Keep the spinnerText in sync with `res/values/groups.xml` | ||
// Don't change the databaseIdentifier. | ||
@Suppress("SpellCheckingInspection") | ||
NONE_GERMAN("guest", "Kommune auswählen"), | ||
NONE_ENGLISH("guest", "Choose municipality"), | ||
|
||
@Suppress("SpellCheckingInspection") | ||
KOETHEN("koethen", "Köthen"), | ||
SCHKEUDITZ("schkeuditz", "Schkeuditz"); | ||
|
||
companion object { | ||
private val spinnerTextValues = Group.values().associateBy(Group::spinnerText) | ||
|
||
/** | ||
* Returns the [Group] from the selected spinner text value. | ||
* | ||
* @param spinnerText The selected spinner text. | ||
*/ | ||
fun fromSpinnerText(spinnerText: String) = spinnerTextValues[spinnerText] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<!-- Keep in Sync with `Group` enum and `groups` translations! --> | ||
<string-array name="groups"> | ||
<item>Kommune auswählen</item> | ||
<item>Köthen</item> | ||
<item>Schkeuditz</item> | ||
</string-array> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
<resources> | ||
|
||
<!-- Registration --> | ||
<!-- Keep in Sync with `Groups` enum and `groups` translations! --> | ||
<string name="choose_municipality">Kommune auswählen</string> | ||
|
||
<!-- Speed --> | ||
<string name="capturing_inactive">Datenerfassung inaktiv</string> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<!-- Keep in Sync with `Group` enum and `groups` translations! --> | ||
<string-array name="groups"> | ||
<item>Choose municipality</item> | ||
<item>Köthen</item> | ||
<item>Schkeuditz</item> | ||
</string-array> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
<resources> | ||
|
||
<!-- Registration --> | ||
<!-- Keep in Sync with `Groups` enum and `groups` translations! --> | ||
<string name="choose_municipality">Choose Municipality</string> | ||
|
||
<!-- Speed --> | ||
<string name="capturing_inactive">capturing inactive</string> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<!-- Keep in Sync with `Group` enum and `groups` translations! --> | ||
<string-array name="groups"> | ||
<item>Choose municipality</item> | ||
<item>Köthen</item> | ||
<item>Schkeuditz</item> | ||
</string-array> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
<resources> | ||
<string name="app_name" translatable="false">Ready4Robots</string> | ||
|
||
<!-- Registration --> | ||
<!-- Keep in Sync with `Groups` enum and `groups` translations! --> | ||
<string name="choose_municipality">Choose Municipality</string> | ||
|
||
<!-- Speed --> | ||
<string name="capturing_inactive">capturing inactive</string> | ||
</resources> |
Oops, something went wrong.