[API/Iuczniowie] Fix syncing grades without color

This commit is contained in:
Kuba Szczodrzyński 2019-09-20 22:41:51 +02:00
parent 2eee9e77e3
commit d7a6c222f7

View File

@ -880,11 +880,17 @@ public class Iuczniowie implements EdziennikInterface {
boolean countToTheAverage = jGrade.get("DoSredniej").getAsBoolean(); boolean countToTheAverage = jGrade.get("DoSredniej").getAsBoolean();
float value = jGrade.get("WartoscDoSred").getAsFloat(); float value = jGrade.get("WartoscDoSred").getAsFloat();
String gradeColor = jGrade.get("Kolor").getAsString();
int colorInt = 0xff2196f3;
if (!gradeColor.isEmpty()) {
colorInt = Color.parseColor("#"+gradeColor);
}
Grade gradeObject = new Grade( Grade gradeObject = new Grade(
profileId, profileId,
jGrade.get("idK").getAsLong(), jGrade.get("idK").getAsLong(),
jGrade.get("Kategoria").getAsString(), jGrade.get("Kategoria").getAsString(),
Color.parseColor("#"+jGrade.get("Kolor").getAsString()), colorInt,
"", "",
jGrade.get("Ocena").getAsString(), jGrade.get("Ocena").getAsString(),
value, value,