From 9a61ffead17eb04d4b68286647228840e47deb18 Mon Sep 17 00:00:00 2001 From: Ezerous Date: Sun, 7 Jul 2019 20:11:40 +0300 Subject: [PATCH] Uploads improvements (2) --- .../gr/thmmy/mthmmy/activities/upload/UploadActivity.java | 8 +++++--- .../activities/upload/UploadFieldsBuilderActivity.java | 6 +++--- app/src/main/res/values/uploads_courses.xml | 3 ++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/upload/UploadActivity.java b/app/src/main/java/gr/thmmy/mthmmy/activities/upload/UploadActivity.java index 6d0a2d9b..0b1195d2 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/upload/UploadActivity.java +++ b/app/src/main/java/gr/thmmy/mthmmy/activities/upload/UploadActivity.java @@ -924,15 +924,17 @@ public class UploadActivity extends BaseActivity { if (!maybeSemester.contains("εξάμηνο") && !maybeSemester.contains("Εξάμηνο")) return; if (maybeCourse == null) return; - String retrievedCourse = maybeCourse.replaceAll("-", "").replace("(ΝΠΣ)", "").trim(); - String retrievedSemester = maybeSemester.replaceAll("-", "").trim().substring(0, 1); + String retrievedCourse = maybeCourse.replaceAll("-", "") + .replaceAll("\\((πρώην|πρωην).*\\)","") + .replace("(ΝΠΣ)", "") + .trim(); if(!retrievedCourse.isEmpty()){ UploadsCourse foundUploadsCourse = UploadsCourse.findCourse(retrievedCourse, uploadsCourses); if(foundUploadsCourse != null){ uploadsCourse = foundUploadsCourse; - semester = retrievedSemester; + semester = maybeSemester.replaceAll("-", "").trim().substring(0, 1); Timber.d("Selected course: %s, semester: %s", uploadsCourse.getName(), semester); generateFieldsButton.setEnabled(true); } diff --git a/app/src/main/java/gr/thmmy/mthmmy/activities/upload/UploadFieldsBuilderActivity.java b/app/src/main/java/gr/thmmy/mthmmy/activities/upload/UploadFieldsBuilderActivity.java index ffa6f26e..f7eb6e0d 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/activities/upload/UploadFieldsBuilderActivity.java +++ b/app/src/main/java/gr/thmmy/mthmmy/activities/upload/UploadFieldsBuilderActivity.java @@ -156,11 +156,11 @@ public class UploadFieldsBuilderActivity extends BaseActivity { private String buildTitle() { switch (typeRadio.getCheckedRadioButtonId()) { case R.id.upload_fields_builder_radio_button_exams: - return courseMinifiedName + " - " + "Θέματα εξετάσεων " + getPeriod() + " " + year.getText().toString(); + return "[" + courseMinifiedName + "] - " + "Θέματα εξετάσεων " + getPeriod() + " " + year.getText().toString(); case R.id.upload_fields_builder_radio_button_exam_solutions: - return courseMinifiedName + " - " + "Λύσεις θεμάτων " + getPeriod() + " " + year.getText().toString(); + return "[" + courseMinifiedName + "] - " + "Λύσεις θεμάτων " + getPeriod() + " " + year.getText().toString(); case R.id.upload_fields_builder_radio_button_notes: - return courseMinifiedName + " - " + "Σημειώσεις παραδόσεων " + year.getText().toString(); + return "[" + courseMinifiedName + "] - " + "Σημειώσεις παραδόσεων " + year.getText().toString(); default: return null; } diff --git a/app/src/main/res/values/uploads_courses.xml b/app/src/main/res/values/uploads_courses.xml index 6fb45b37..51781f41 100644 --- a/app/src/main/res/values/uploads_courses.xml +++ b/app/src/main/res/values/uploads_courses.xml @@ -111,7 +111,8 @@ Σήματα και Συστήματα:Σήματα & Συστήματα:Analog_Sima Σερβοκινητήρια Συστήματα:Σέρβο:Servo Σταθμοί Παραγωγής Ηλεκτρικής Ενέργειας:ΣΠΗΕ:SPHE - Στοχαστικό Σήμα:Στοχ. Σήμα:Stox_Sima + Στοχαστικά Σήματα και Διαδικασίες:Στοχαστικό:Stochastic + Στοχαστικό Σήμα:Στοχαστικό:Stochastic Συστήματα Αυτομάτου Ελέγχου I:ΣΑΕ 1:SAE_I Συστήματα Αυτομάτου Ελέγχου II:ΣΑΕ 2:SAE_II Συστήματα Αυτομάτου Ελέγχου III:ΣΑΕ 3:SAE_III