Commit 3a2c808b authored by CallisteHanriat's avatar CallisteHanriat

swiched age to birth year in GUI

parent 3e91dbc9
......@@ -64,7 +64,7 @@
<string name="region_origin">Region of origin</string>
<string name="region_origin_edit">Type in your region of origin</string>
<string name="personal_information">Personal information</string>
<string name="age">Age</string>
<string name="age">Birth year</string>
<string name="age_edit">Type in your age</string>
<string name="gender">Gender</string>
<string name="radio_male">Male</string>
......
......@@ -64,7 +64,7 @@
<string name="region_origin">Region of origin</string>
<string name="region_origin_edit">Type in your region of origin</string>
<string name="personal_information">Personal information</string>
<string name="age">Age</string>
<string name="age">Birth year</string>
<string name="age_edit">Type in your age</string>
<string name="gender">Gender</string>
<string name="radio_male">Male</string>
......
......@@ -64,7 +64,7 @@
<string name="region_origin">Region of origin</string>
<string name="region_origin_edit">Type in your region of origin</string>
<string name="personal_information">Personal information</string>
<string name="age">Age</string>
<string name="age">Birth year</string>
<string name="age_edit">Type in your age</string>
<string name="gender">Gender</string>
<string name="radio_male">Male</string>
......
......@@ -6,6 +6,7 @@ import java.math.BigInteger;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -400,8 +401,10 @@ public class RecordingMetadataLig extends AikumaActivity implements OnClickListe
//speakerAge = new Integer(age);
if (!age.isEmpty()) {
speakerAge = Integer.parseInt(age);
if (speakerAge < 3 || speakerAge > 151) {
msgError = "Input age is implausible... please correct it.";
int currentYear = Calendar.getInstance().get(Calendar.YEAR);
if (speakerAge < 1880 || speakerAge > currentYear - 3) {
msgError = "Input birth year is implausible... interval [1880 -> " +
Integer.toString(currentYear-3) + "]";
new AlertDialog.Builder(this)
.setMessage(msgError)
.setPositiveButton("Ok", null)
......
......@@ -4,6 +4,7 @@ import java.io.File;
import java.io.IOException;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -244,8 +245,10 @@ public class RespeakingMetadataLig extends AikumaActivity implements OnClickList
try {
//speakerAge = new Integer(age);
speakerAge = Integer.parseInt(age);
if (speakerAge < 3 || speakerAge > 151) {
msgError = "Input age is implausible... please correct it.";
int currentYear = Calendar.getInstance().get(Calendar.YEAR);
if (speakerAge < 1880 || speakerAge > currentYear - 3) {
msgError = "Input birth year is implausible... interval [1880 -> " +
Integer.toString(currentYear-3) + "]";
new AlertDialog.Builder(this)
.setMessage(msgError)
.setPositiveButton("Ok", null)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment