From d8afa47d2c75d20351b77cd85ca1040f40ebe00b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Thu, 19 Sep 2019 10:09:33 +0200 Subject: [PATCH 1/4] API/Librus: Fix Classrooms NPE issue --- app/src/main/java/pl/szczodrzynski/edziennik/api/Librus.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/Librus.java b/app/src/main/java/pl/szczodrzynski/edziennik/api/Librus.java index c3d01bb3..592131ad 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/Librus.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/api/Librus.java @@ -1600,6 +1600,10 @@ public class Librus implements EdziennikInterface { r("finish", "Classrooms"); return; } + if (data.get("Classrooms") == null) { + r("finish", "Classrooms"); + return; + } JsonArray jClassrooms = data.get("Classrooms").getAsJsonArray(); //d("Got Classrooms: "+jClassrooms.toString()); classrooms.clear(); From dce4ef822bc30b0df8c81f11ecbef3916db661ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Thu, 19 Sep 2019 10:29:10 +0200 Subject: [PATCH 2/4] UI: Fix status bar/NavLib issues, temporarily --- .../main/java/pl/szczodrzynski/edziennik/MainActivity.kt | 6 ++++-- app/src/main/res/values/styles.xml | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt b/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt index 1316a91a..5d7bbd7c 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt @@ -229,8 +229,8 @@ class MainActivity : AppCompatActivity() { drawer.init(this@MainActivity) SystemBarsUtil(this@MainActivity).run { - paddingByKeyboard = b.navView - appFullscreen = true + //paddingByKeyboard = b.navView + appFullscreen = false statusBarColor = getColorFromAttr(context, android.R.attr.colorBackground) statusBarDarker = false statusBarFallbackLight = COLOR_HALF_TRANSPARENT @@ -239,6 +239,8 @@ class MainActivity : AppCompatActivity() { b.navView.configSystemBarsUtil(this) + // TODO fix navlib navbar detection, orientation change issues, status bar color setting if not fullscreen + commit() } diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 116c7a40..cdd0abb1 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -95,6 +95,8 @@ ?android:textColorSecondary ?colorSurface @color/dividerColor + + ?android:windowBackground From b3fa342876f2e682796db1128780fd758526bdf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Thu, 19 Sep 2019 10:55:41 +0200 Subject: [PATCH 3/4] API/Mobidziennik: Fix grades empty subject issue, teacher names with trailing spaces --- .../pl/szczodrzynski/edziennik/api/Mobidziennik.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/Mobidziennik.java b/app/src/main/java/pl/szczodrzynski/edziennik/api/Mobidziennik.java index 71c200b8..7df269d6 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/Mobidziennik.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/api/Mobidziennik.java @@ -794,7 +794,7 @@ public class Mobidziennik implements EdziennikInterface { switch (e.tagName()) { case "div": { //d(TAG, "Outer HTML "+e.outerHtml()); - Matcher matcher = Pattern.compile("\\n*\\s*(.+?)\\n*(?:<.*?)??", Pattern.DOTALL).matcher(e.outerHtml()); + Matcher matcher = Pattern.compile("\\n*\\s*(.+?)\\s*\\n*(?:<.*?)??", Pattern.DOTALL).matcher(e.outerHtml()); if (matcher.find()) { subjectName = matcher.group(1); } @@ -1456,8 +1456,8 @@ public class Mobidziennik implements EdziennikInterface { } String[] user = userStr.split("\\|", Integer.MAX_VALUE); - teachersMap.put(strToInt(user[0]), user[5]+" "+user[4]); - teacherList.add(new Teacher(profileId, strToInt(user[0]), user[4], user[5])); + teachersMap.put(strToInt(user[0]), user[5].trim()+" "+user[4].trim()); + teacherList.add(new Teacher(profileId, strToInt(user[0]), user[4].trim(), user[5].trim())); } } @@ -1958,7 +1958,7 @@ public class Mobidziennik implements EdziennikInterface { for(int i = 0; i < teachersMap.size(); i++) { int key = teachersMap.keyAt(i); String str = teachersMap.valueAt(i); - if ((lesson[7] + " " + lesson[6]).equalsIgnoreCase(str)) { + if ((lesson[7].trim() + " " + lesson[6].trim()).equalsIgnoreCase(str)) { lessonObject.teacherId = key; } } @@ -2001,7 +2001,7 @@ public class Mobidziennik implements EdziennikInterface { for(int i = 0; i < teachersMap.size(); i++) { int key = teachersMap.keyAt(i); String str = teachersMap.valueAt(i); - if ((lesson[7] + " " + lesson[6]).equalsIgnoreCase(str)) { + if ((lesson[7].trim() + " " + lesson[6].trim()).equalsIgnoreCase(str)) { lessonChange.teacherId = key; } } From e2d809cceb7ed80db3bbe60a798e8ff72fae810b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Thu, 19 Sep 2019 11:04:59 +0200 Subject: [PATCH 4/4] 3.0.1-rc.1: Update build.gradle and changelog --- app/src/main/assets/pl-changelog.html | 7 +++++++ build.gradle | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/src/main/assets/pl-changelog.html b/app/src/main/assets/pl-changelog.html index e87bb90e..25e2064b 100644 --- a/app/src/main/assets/pl-changelog.html +++ b/app/src/main/assets/pl-changelog.html @@ -31,6 +31,13 @@ +

Wersja 3.0.1, 2019-09-19

+
    +
  • Librus: Poprawa błędu synchronizacji.
  • +
  • Poprawki UI związane z paskiem nawigacji.
  • +
  • Mobidziennik: Pobieranie ocen w niektórych przedmiotach.
  • +
+

Wersja 3.0, 2019-09-13

  • Nowy wygląd i sposób nawigacji w całej aplikacji.
  • diff --git a/build.gradle b/build.gradle index 3fb254a7..3ef0a842 100644 --- a/build.gradle +++ b/build.gradle @@ -5,8 +5,8 @@ buildscript { kotlin_version = '1.3.50' release = [ - versionName: "3.0", - versionCode: 3000099 + versionName: "3.0.1-rc.1", + versionCode: 3000110 ] setup = [