Browse Source

Uploads improvements (2)

pull/63/head
Ezerous 6 years ago
parent
commit
9a61ffead1
No known key found for this signature in database GPG Key ID: 262B2954BBA319E3
  1. 8
      app/src/main/java/gr/thmmy/mthmmy/activities/upload/UploadActivity.java
  2. 6
      app/src/main/java/gr/thmmy/mthmmy/activities/upload/UploadFieldsBuilderActivity.java
  3. 3
      app/src/main/res/values/uploads_courses.xml

8
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);
}

6
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;
}

3
app/src/main/res/values/uploads_courses.xml

@ -111,7 +111,8 @@
<item>Σήματα και Συστήματα:Σήματα &amp; Συστήματα:Analog_Sima</item>
<item>Σερβοκινητήρια Συστήματα:Σέρβο:Servo</item>
<item>Σταθμοί Παραγωγής Ηλεκτρικής Ενέργειας:ΣΠΗΕ:SPHE</item>
<item>Στοχαστικό Σήμα:Στοχ. Σήμα:Stox_Sima</item>
<item>Στοχαστικά Σήματα και Διαδικασίες:Στοχαστικό:Stochastic</item>
<item>Στοχαστικό Σήμα:Στοχαστικό:Stochastic</item>
<item>Συστήματα Αυτομάτου Ελέγχου I:ΣΑΕ 1:SAE_I</item>
<item>Συστήματα Αυτομάτου Ελέγχου II:ΣΑΕ 2:SAE_II</item>
<item>Συστήματα Αυτομάτου Ελέγχου III:ΣΑΕ 3:SAE_III</item>

Loading…
Cancel
Save