Commit 3a2c808b authored by CallisteHanriat's avatar CallisteHanriat
Browse files

swiched age to birth year in GUI

parent 3e91dbc9
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
<string name="region_origin">Region of origin</string> <string name="region_origin">Region of origin</string>
<string name="region_origin_edit">Type in your 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="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="age_edit">Type in your age</string>
<string name="gender">Gender</string> <string name="gender">Gender</string>
<string name="radio_male">Male</string> <string name="radio_male">Male</string>
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
<string name="region_origin">Region of origin</string> <string name="region_origin">Region of origin</string>
<string name="region_origin_edit">Type in your 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="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="age_edit">Type in your age</string>
<string name="gender">Gender</string> <string name="gender">Gender</string>
<string name="radio_male">Male</string> <string name="radio_male">Male</string>
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
<string name="region_origin">Region of origin</string> <string name="region_origin">Region of origin</string>
<string name="region_origin_edit">Type in your 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="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="age_edit">Type in your age</string>
<string name="gender">Gender</string> <string name="gender">Gender</string>
<string name="radio_male">Male</string> <string name="radio_male">Male</string>
......
...@@ -6,6 +6,7 @@ import java.math.BigInteger; ...@@ -6,6 +6,7 @@ import java.math.BigInteger;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -400,8 +401,10 @@ public class RecordingMetadataLig extends AikumaActivity implements OnClickListe ...@@ -400,8 +401,10 @@ public class RecordingMetadataLig extends AikumaActivity implements OnClickListe
//speakerAge = new Integer(age); //speakerAge = new Integer(age);
if (!age.isEmpty()) { if (!age.isEmpty()) {
speakerAge = Integer.parseInt(age); speakerAge = Integer.parseInt(age);
if (speakerAge < 3 || speakerAge > 151) { int currentYear = Calendar.getInstance().get(Calendar.YEAR);
msgError = "Input age is implausible... please correct it."; if (speakerAge < 1880 || speakerAge > currentYear - 3) {
msgError = "Input birth year is implausible... interval [1880 -> " +
Integer.toString(currentYear-3) + "]";
new AlertDialog.Builder(this) new AlertDialog.Builder(this)
.setMessage(msgError) .setMessage(msgError)
.setPositiveButton("Ok", null) .setPositiveButton("Ok", null)
......
...@@ -4,6 +4,7 @@ import java.io.File; ...@@ -4,6 +4,7 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.text.DateFormat; import java.text.DateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -244,8 +245,10 @@ public class RespeakingMetadataLig extends AikumaActivity implements OnClickList ...@@ -244,8 +245,10 @@ public class RespeakingMetadataLig extends AikumaActivity implements OnClickList
try { try {
//speakerAge = new Integer(age); //speakerAge = new Integer(age);
speakerAge = Integer.parseInt(age); speakerAge = Integer.parseInt(age);
if (speakerAge < 3 || speakerAge > 151) { int currentYear = Calendar.getInstance().get(Calendar.YEAR);
msgError = "Input age is implausible... please correct it."; if (speakerAge < 1880 || speakerAge > currentYear - 3) {
msgError = "Input birth year is implausible... interval [1880 -> " +
Integer.toString(currentYear-3) + "]";
new AlertDialog.Builder(this) new AlertDialog.Builder(this)
.setMessage(msgError) .setMessage(msgError)
.setPositiveButton("Ok", null) .setPositiveButton("Ok", null)
......
Supports Markdown
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