hotfix app crash and some ui updates, release 1.0.3
This commit is contained in:
Generated
+6
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectRootManager">
|
||||||
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+8
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/solon.iml" filepath="$PROJECT_DIR$/.idea/solon.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+9
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$" />
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
Generated
+6
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+54
@@ -0,0 +1,54 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="AutoImportSettings">
|
||||||
|
<option name="autoReloadType" value="NONE" />
|
||||||
|
</component>
|
||||||
|
<component name="ChangeListManager">
|
||||||
|
<list default="true" id="e24eff9b-1b5c-4df1-b20f-0daae7929800" name="Changes" comment="">
|
||||||
|
<change beforePath="$PROJECT_DIR$/mobile/.idea/deploymentTargetDropDown.xml" beforeDir="false" afterPath="$PROJECT_DIR$/mobile/.idea/deploymentTargetDropDown.xml" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/mobile/app/src/main/java/com/odweta/solon/CalWeekFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/mobile/app/src/main/java/com/odweta/solon/CalWeekFragment.kt" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/mobile/app/src/main/java/com/odweta/solon/MainActivity.kt" beforeDir="false" afterPath="$PROJECT_DIR$/mobile/app/src/main/java/com/odweta/solon/MainActivity.kt" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/mobile/app/src/main/java/com/odweta/solon/MarksFragment.kt" beforeDir="false" afterPath="$PROJECT_DIR$/mobile/app/src/main/java/com/odweta/solon/MarksFragment.kt" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/mobile/app/src/main/java/com/odweta/solon/Util.kt" beforeDir="false" afterPath="$PROJECT_DIR$/mobile/app/src/main/java/com/odweta/solon/Util.kt" afterDir="false" />
|
||||||
|
</list>
|
||||||
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||||
|
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||||
|
</component>
|
||||||
|
<component name="ClangdSettings">
|
||||||
|
<option name="formatViaClangd" value="false" />
|
||||||
|
</component>
|
||||||
|
<component name="Git.Settings">
|
||||||
|
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||||
|
</component>
|
||||||
|
<component name="MarkdownSettingsMigration">
|
||||||
|
<option name="stateVersion" value="1" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectId" id="2cxgpH3ugs5qma8IaiCuxigOdGT" />
|
||||||
|
<component name="ProjectViewState">
|
||||||
|
<option name="hideEmptyMiddlePackages" value="true" />
|
||||||
|
<option name="showLibraryContents" value="true" />
|
||||||
|
</component>
|
||||||
|
<component name="PropertiesComponent"><![CDATA[{
|
||||||
|
"keyToString": {
|
||||||
|
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||||
|
"RunOnceActivity.cidr.known.project.marker": "true",
|
||||||
|
"cf.first.check.clang-format": "false",
|
||||||
|
"cidr.known.project.marker": "true",
|
||||||
|
"git-widget-placeholder": "master",
|
||||||
|
"last_opened_file_path": "/home/thinker/solon/mobile"
|
||||||
|
}
|
||||||
|
}]]></component>
|
||||||
|
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||||
|
<component name="TaskManager">
|
||||||
|
<task active="true" id="Default" summary="Default task">
|
||||||
|
<changelist id="e24eff9b-1b5c-4df1-b20f-0daae7929800" name="Changes" comment="" />
|
||||||
|
<created>1709058824678</created>
|
||||||
|
<option name="number" value="Default" />
|
||||||
|
<option name="presentableId" value="Default" />
|
||||||
|
<updated>1709058824678</updated>
|
||||||
|
</task>
|
||||||
|
<servers />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@@ -575,7 +575,7 @@ class DayFragment : Fragment() {
|
|||||||
dayEndTextView.text = Vars.dayEndString
|
dayEndTextView.text = Vars.dayEndString
|
||||||
dayEndTextView.typeface = customFont
|
dayEndTextView.typeface = customFont
|
||||||
dayEndTextView.setAutoSizeTextTypeUniformWithConfiguration(55, 85, 1, 0)
|
dayEndTextView.setAutoSizeTextTypeUniformWithConfiguration(55, 85, 1, 0)
|
||||||
dayEndTextView.setPadding(0, 30, 0, 30)
|
dayEndTextView.setPadding(0, 25, 0, 25)
|
||||||
dayEndTextView.textAlignment = View.TEXT_ALIGNMENT_CENTER
|
dayEndTextView.textAlignment = View.TEXT_ALIGNMENT_CENTER
|
||||||
dayEndTextView.gravity = Gravity.CENTER
|
dayEndTextView.gravity = Gravity.CENTER
|
||||||
dayEndTextView.setTextColor(
|
dayEndTextView.setTextColor(
|
||||||
@@ -670,6 +670,25 @@ class Subject {
|
|||||||
|
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun empty(): Subject {
|
||||||
|
val s = Subject()
|
||||||
|
|
||||||
|
s.name = "err"
|
||||||
|
s.place = "error"
|
||||||
|
s.teacher = "error"
|
||||||
|
s.substitute = "0"
|
||||||
|
s.number = "0"
|
||||||
|
s.start = "00:00"
|
||||||
|
s.end = "00:00"
|
||||||
|
s.free = false
|
||||||
|
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun toString(): String {
|
||||||
|
return "subject ${this.name} at ${this.place} from ${this.start} to ${this.end}; free? ${this.free}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -144,7 +144,10 @@ class Network {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
val resp = Vars.client.newCall(request).execute()
|
val resp = Vars.client.newCall(request).execute()
|
||||||
resp.body?.string().toString()
|
val s = resp.body?.string().toString()
|
||||||
|
val s2 = JSONObject(s).getJSONArray("days").getString(1)
|
||||||
|
Log.d("TIMETABLE", s2)
|
||||||
|
s
|
||||||
} catch (e: IOException) {
|
} catch (e: IOException) {
|
||||||
"""{"error": "network"}"""
|
"""{"error": "network"}"""
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,42 @@ import java.time.format.DateTimeFormatter
|
|||||||
|
|
||||||
class Parsing {
|
class Parsing {
|
||||||
companion object {
|
companion object {
|
||||||
|
private fun eventLecture(subject: Subject, subj: JSONObject, subjects: MutableList<Subject>) {
|
||||||
|
subject.name = subj.get("title").toString()
|
||||||
|
subject.place = ""
|
||||||
|
subject.teacher = ""
|
||||||
|
subject.substitute = "2" // 2 means school event
|
||||||
|
|
||||||
|
val hourspan = subj.getJSONArray("detailHours").length()
|
||||||
|
if (hourspan == 1) {
|
||||||
|
val detailHours = subj.getJSONArray("detailHours")
|
||||||
|
subject.number = detailHours.getJSONObject(0).get("id").toString()
|
||||||
|
subject.start = detailHours.getJSONObject(0).get("timeFrom").toString()
|
||||||
|
subject.start = subject.start.slice(0..subject.start.length - 4)
|
||||||
|
subject.end = detailHours.getJSONObject(0).get("timeto").toString()
|
||||||
|
subject.end = subject.end.slice(0..subject.end.length - 4)
|
||||||
|
subjects.add(subject)
|
||||||
|
} else {
|
||||||
|
for (i in 0..<hourspan) {
|
||||||
|
val newSubject = Subject()
|
||||||
|
newSubject.name = subject.name
|
||||||
|
newSubject.place = subject.place
|
||||||
|
newSubject.teacher = subject.teacher
|
||||||
|
newSubject.substitute = subject.substitute
|
||||||
|
|
||||||
|
val detailHours = subj.getJSONArray("detailHours")
|
||||||
|
newSubject.number = detailHours.getJSONObject(i).get("id").toString()
|
||||||
|
newSubject.start =
|
||||||
|
detailHours.getJSONObject(i).get("timeFrom").toString()
|
||||||
|
newSubject.start =
|
||||||
|
newSubject.start.slice(0..newSubject.start.length - 4)
|
||||||
|
newSubject.end = detailHours.getJSONObject(i).get("timeto").toString()
|
||||||
|
newSubject.end = newSubject.end.slice(0..newSubject.end.length - 4)
|
||||||
|
subjects.add(newSubject)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun userIsParent(): Boolean {
|
fun userIsParent(): Boolean {
|
||||||
return if (Vars.userData != "") {
|
return if (Vars.userData != "") {
|
||||||
JSONObject(Vars.userData).getString("userType") == "parent"
|
JSONObject(Vars.userData).getString("userType") == "parent"
|
||||||
@@ -94,86 +130,77 @@ class Parsing {
|
|||||||
val hourspan = subj.getJSONArray("detailHours").length()
|
val hourspan = subj.getJSONArray("detailHours").length()
|
||||||
subject.number = "1 - $hourspan"
|
subject.number = "1 - $hourspan"
|
||||||
subject.start = subj.get("beginTime").toString()
|
subject.start = subj.get("beginTime").toString()
|
||||||
subject.start = subject.start.slice(0..subject.start.length-4)
|
subject.start = subject.start.slice(0..subject.start.length - 4)
|
||||||
subject.end = subj.get("endTime").toString()
|
subject.end = subj.get("endTime").toString()
|
||||||
subject.end = subject.end.slice(0..subject.end.length-4)
|
subject.end = subject.end.slice(0..subject.end.length - 4)
|
||||||
|
|
||||||
subjects.add(subject)
|
subjects.add(subject)
|
||||||
}
|
}
|
||||||
"S_NAHRADOU_SKOL_AKCE" -> {
|
"S_NAHRADOU_SKOL_AKCE" -> eventLecture(subject, subj, subjects)
|
||||||
subject.name = subj.get("title").toString()
|
"S_NAHRADOU_VYUKA" -> eventLecture(subject, subj, subjects)
|
||||||
subject.place = ""
|
|
||||||
subject.teacher = ""
|
|
||||||
subject.substitute = "2" // 2 means school event
|
|
||||||
|
|
||||||
val hourspan = subj.getJSONArray("detailHours").length()
|
|
||||||
if (hourspan == 1) {
|
|
||||||
val detailHours = subj.getJSONArray("detailHours")
|
|
||||||
subject.number = detailHours.getJSONObject(0).get("id").toString()
|
|
||||||
subject.start = detailHours.getJSONObject(0).get("timeFrom").toString()
|
|
||||||
subject.start = subject.start.slice(0..subject.start.length - 4)
|
|
||||||
subject.end = detailHours.getJSONObject(0).get("timeto").toString()
|
|
||||||
subject.end = subject.end.slice(0..subject.end.length - 4)
|
|
||||||
subjects.add(subject)
|
|
||||||
} else {
|
|
||||||
for (i in 0..<hourspan) {
|
|
||||||
val newSubject = Subject()
|
|
||||||
newSubject.name = subject.name
|
|
||||||
newSubject.place = subject.place
|
|
||||||
newSubject.teacher = subject.teacher
|
|
||||||
newSubject.substitute = subject.substitute
|
|
||||||
|
|
||||||
val detailHours = subj.getJSONArray("detailHours")
|
|
||||||
newSubject.number = detailHours.getJSONObject(i).get("id").toString()
|
|
||||||
newSubject.start =
|
|
||||||
detailHours.getJSONObject(i).get("timeFrom").toString()
|
|
||||||
newSubject.start =
|
|
||||||
newSubject.start.slice(0..newSubject.start.length - 4)
|
|
||||||
newSubject.end = detailHours.getJSONObject(i).get("timeto").toString()
|
|
||||||
newSubject.end = newSubject.end.slice(0..newSubject.end.length - 4)
|
|
||||||
subjects.add(newSubject)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
subject.name = subj.getJSONObject("subject").get("abbrev").toString()
|
subject.name = subj.getJSONObject("subject").get("abbrev").toString()
|
||||||
subject.place =
|
subject.place =
|
||||||
subj.getJSONArray("rooms").getJSONObject(0).get("abbrev").toString()
|
subj.getJSONArray("rooms").getJSONObject(0).get("abbrev").toString()
|
||||||
subject.teacher = "" +
|
subject.teacher = "" +
|
||||||
"${subj.getJSONArray("teachers").getJSONObject(0).get("name")} " +
|
"${
|
||||||
"${subj.getJSONArray("teachers").getJSONObject(0).get("surname")}"
|
subj.getJSONArray("teachers").getJSONObject(0).get("name")
|
||||||
if (type == "ROZVRH") {
|
} " +
|
||||||
subject.substitute = "0"
|
"${
|
||||||
} else if (type == "SUPLOVANI") {
|
subj.getJSONArray("teachers").getJSONObject(0)
|
||||||
subject.substitute = "1"
|
.get("surname")
|
||||||
|
}"
|
||||||
|
subject.substitute = when (type) {
|
||||||
|
"ROZVRH" -> "0"
|
||||||
|
"SUPLOVANI" -> "1"
|
||||||
|
else -> "2"
|
||||||
}
|
}
|
||||||
val hourspan = subj.getJSONArray("detailHours").length()
|
val hourspan = subj.getJSONArray("detailHours").length()
|
||||||
if (hourspan == 1) {
|
if (hourspan == 1) {
|
||||||
val detailHours = subj.getJSONArray("detailHours")
|
val detailHours = subj.getJSONArray("detailHours")
|
||||||
subject.number = detailHours.getJSONObject(0).get("id").toString()
|
subject.number = detailHours.getJSONObject(0).get("id").toString()
|
||||||
subject.start = detailHours.getJSONObject(0).get("timeFrom").toString()
|
subject.start =
|
||||||
|
detailHours.getJSONObject(0).get("timeFrom").toString()
|
||||||
subject.start = subject.start.slice(0..subject.start.length - 4)
|
subject.start = subject.start.slice(0..subject.start.length - 4)
|
||||||
subject.end = detailHours.getJSONObject(0).get("timeto").toString()
|
subject.end = detailHours.getJSONObject(0).get("timeto").toString()
|
||||||
subject.end = subject.end.slice(0..subject.end.length - 4)
|
subject.end = subject.end.slice(0..subject.end.length - 4)
|
||||||
subjects.add(subject)
|
subjects.add(subject)
|
||||||
} else {
|
} else {
|
||||||
for (i in 0..<hourspan) {
|
if (subject.substitute == "2") {
|
||||||
val newSubject = Subject()
|
|
||||||
newSubject.name = subject.name
|
|
||||||
newSubject.place = subject.place
|
|
||||||
newSubject.teacher = subject.teacher
|
|
||||||
newSubject.substitute = subject.substitute
|
|
||||||
|
|
||||||
val detailHours = subj.getJSONArray("detailHours")
|
val detailHours = subj.getJSONArray("detailHours")
|
||||||
newSubject.number = detailHours.getJSONObject(i).get("id").toString()
|
val latestTime =
|
||||||
newSubject.start =
|
detailHours.getJSONObject(detailHours.length() - 1)
|
||||||
detailHours.getJSONObject(i).get("timeFrom").toString()
|
subject.number = latestTime.get("id").toString()
|
||||||
newSubject.start =
|
subject.start = latestTime.get("timeFrom").toString()
|
||||||
newSubject.start.slice(0..newSubject.start.length - 4)
|
subject.start =
|
||||||
newSubject.end = detailHours.getJSONObject(i).get("timeto").toString()
|
subject.start.slice(0..subject.start.length - 4)
|
||||||
newSubject.end = newSubject.end.slice(0..newSubject.end.length - 4)
|
subject.end = latestTime.get("timeto").toString()
|
||||||
subjects.add(newSubject)
|
subject.end = subject.end.slice(0..subject.end.length - 4)
|
||||||
|
subjects.add(subject)
|
||||||
|
} else {
|
||||||
|
for (i in 0..<hourspan) {
|
||||||
|
val newSubject = Subject()
|
||||||
|
newSubject.name = subject.name
|
||||||
|
newSubject.place = subject.place
|
||||||
|
newSubject.teacher = subject.teacher
|
||||||
|
newSubject.substitute = subject.substitute
|
||||||
|
|
||||||
|
val detailHours = subj.getJSONArray("detailHours")
|
||||||
|
newSubject.number =
|
||||||
|
detailHours.getJSONObject(i).get("id").toString()
|
||||||
|
newSubject.start =
|
||||||
|
detailHours.getJSONObject(i).get("timeFrom")
|
||||||
|
.toString()
|
||||||
|
newSubject.start =
|
||||||
|
newSubject.start.slice(0..newSubject.start.length - 4)
|
||||||
|
newSubject.end =
|
||||||
|
detailHours.getJSONObject(i).get("timeto")
|
||||||
|
.toString()
|
||||||
|
newSubject.end =
|
||||||
|
newSubject.end.slice(0..newSubject.end.length - 4)
|
||||||
|
subjects.add(newSubject)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -218,8 +245,10 @@ class Parsing {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
auxSubjects.add(subjects[subjects.size - 1])
|
auxSubjects.add(subjects[subjects.size - 1])
|
||||||
} else {
|
} else if (subjects.size > 0) {
|
||||||
auxSubjects.add(subjects[0])
|
auxSubjects.add(subjects[0])
|
||||||
|
} else {
|
||||||
|
auxSubjects.add(Subject.empty())
|
||||||
}
|
}
|
||||||
|
|
||||||
for ((i, s) in auxSubjects.withIndex()) {
|
for ((i, s) in auxSubjects.withIndex()) {
|
||||||
@@ -234,6 +263,21 @@ class Parsing {
|
|||||||
day.date = date
|
day.date = date
|
||||||
day.subjects = auxSubjects
|
day.subjects = auxSubjects
|
||||||
|
|
||||||
|
val nextSubjects: MutableList<Subject> = mutableListOf()
|
||||||
|
var prevSubject: Subject = Subject.empty()
|
||||||
|
|
||||||
|
for (s in day.subjects) {
|
||||||
|
if (prevSubject.name != s.name) {
|
||||||
|
nextSubjects.add(s)
|
||||||
|
}
|
||||||
|
prevSubject = s
|
||||||
|
}
|
||||||
|
|
||||||
|
nextSubjects[nextSubjects.size-1].start = day.subjects[day.subjects.size-1].start
|
||||||
|
nextSubjects[nextSubjects.size-1].end = day.subjects[day.subjects.size-1].end
|
||||||
|
|
||||||
|
day.subjects = nextSubjects
|
||||||
|
|
||||||
week.add(day)
|
week.add(day)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user