From 9df9f50d01b38b2b29a36a57dec73a9ab1bbf30f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Fri, 20 Sep 2019 22:55:09 +0200 Subject: [PATCH 1/7] 3.0.1: Update build.gradle --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 3ef0a842..4a2b3a37 100644 --- a/build.gradle +++ b/build.gradle @@ -5,8 +5,8 @@ buildscript { kotlin_version = '1.3.50' release = [ - versionName: "3.0.1-rc.1", - versionCode: 3000110 + versionName: "3.0.1", + versionCode: 3000199 ] setup = [ From 93b4c03b87dd662c6d50cf5f618e0b71c63210e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Mon, 23 Sep 2019 21:26:29 +0200 Subject: [PATCH 2/7] Remove older app version check --- app/src/main/java/pl/szczodrzynski/edziennik/App.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/App.java b/app/src/main/java/pl/szczodrzynski/edziennik/App.java index 09926597..37b11cc5 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/App.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/App.java @@ -514,7 +514,7 @@ public class App extends androidx.multidex.MultiDexApplication { } } - if (appConfig.lastAppVersion > BuildConfig.VERSION_CODE) { + /*if (appConfig.lastAppVersion > BuildConfig.VERSION_CODE) { BootReceiver br = new BootReceiver(); Intent i = new Intent(); //i.putExtra("UserChecked", true); @@ -522,7 +522,7 @@ public class App extends androidx.multidex.MultiDexApplication { Toast.makeText(mContext, R.string.warning_older_version_running, Toast.LENGTH_LONG).show(); //Toast.makeText(mContext, "Zaktualizuj aplikację.", Toast.LENGTH_LONG).show(); //System.exit(0); - } + }*/ if (appConfig == null) { appConfig = new AppConfig(this); From 18d9471a9491c6c66b74247872ded1f4cfa0724a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Mon, 23 Sep 2019 21:32:12 +0200 Subject: [PATCH 3/7] [UI] Fix web push activity QR scanner --- app/src/main/res/layout/activity_web_push_config.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/layout/activity_web_push_config.xml b/app/src/main/res/layout/activity_web_push_config.xml index 5e4a07c2..17e62ec6 100644 --- a/app/src/main/res/layout/activity_web_push_config.xml +++ b/app/src/main/res/layout/activity_web_push_config.xml @@ -18,11 +18,11 @@ app:popupTheme="@style/ThemeOverlay.AppCompat.Light" /> From 9500ba52fd69b4e224d438ce1829d0ca52620aa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Mon, 23 Sep 2019 21:53:04 +0200 Subject: [PATCH 4/7] [UI] Fix status bar icon color in light theme, color&date picker dialogs crashing the app. --- .../main/java/pl/szczodrzynski/edziennik/MainActivity.kt | 9 +++++++++ app/src/main/res/values/styles.xml | 4 ---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt b/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt index 5d7bbd7c..62fe8cd9 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt @@ -30,6 +30,7 @@ import pl.szczodrzynski.navlib.drawer.items.DrawerPrimaryItem import pl.szczodrzynski.navlib.drawer.items.withAppTitle import pl.szczodrzynski.navlib.getColorFromAttr import androidx.appcompat.widget.PopupMenu +import androidx.core.graphics.ColorUtils import androidx.navigation.NavOptions import com.danimahardhika.cafebar.CafeBar import com.mikepenz.iconics.IconicsColor @@ -239,6 +240,14 @@ class MainActivity : AppCompatActivity() { b.navView.configSystemBarsUtil(this) + // fix for setting status bar color to window color, outside of navlib + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + window.statusBarColor = statusBarColor + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && ColorUtils.calculateLuminance(statusBarColor) > 0.6) { + window.decorView.systemUiVisibility = window.decorView.systemUiVisibility or View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR + } + // 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 cdd0abb1..116c7a40 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -95,8 +95,6 @@ ?android:textColorSecondary ?colorSurface @color/dividerColor - - ?android:windowBackground From 1a2b51f3f95e629ac7ace3b2c446195faaad572a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Mon, 23 Sep 2019 22:07:34 +0200 Subject: [PATCH 5/7] [3.0.2-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 25e2064b..d68bb6f1 100644 --- a/app/src/main/assets/pl-changelog.html +++ b/app/src/main/assets/pl-changelog.html @@ -31,6 +31,13 @@ +

Wersja 3.0.2, 2019-09-23

+
    +
  • Poprawki UI: kolor ikon paska statusu w jasnym motywie.
  • +
  • Poprawka braku skanera QR do przekazywania powiadomień.
  • +
  • Poprawka wyboru koloru i daty własnego wydarzenia, które crashowały aplikację.
  • +
+

Wersja 3.0.1, 2019-09-19

  • Librus: Poprawa błędu synchronizacji.
  • diff --git a/build.gradle b/build.gradle index 4a2b3a37..b98c2750 100644 --- a/build.gradle +++ b/build.gradle @@ -5,8 +5,8 @@ buildscript { kotlin_version = '1.3.50' release = [ - versionName: "3.0.1", - versionCode: 3000199 + versionName: "3.0.2-rc.1", + versionCode: 3000210 ] setup = [ From df52029a29b5d3cf394b2ad692faf80f4ed3e22b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Tue, 24 Sep 2019 21:45:49 +0200 Subject: [PATCH 6/7] =?UTF-8?q?[API/Librus]=20Add=20Librus=20descriptive?= =?UTF-8?q?=20grades=20("Bie=C5=BC=C4=85ce=20oceny=20opisowe")=20support.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../szczodrzynski/edziennik/api/Librus.java | 63 ++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) 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 592131ad..908c845b 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/Librus.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/api/Librus.java @@ -288,6 +288,7 @@ public class Librus implements EdziennikInterface { targetEndpoints.add("Grades"); targetEndpoints.add("PointGrades"); targetEndpoints.add("DescriptiveGrades"); + targetEndpoints.add("TextGrades"); targetEndpoints.add("BehaviourGrades"); targetEndpoints.add("Events"); @@ -359,6 +360,7 @@ public class Librus implements EdziennikInterface { targetEndpoints.add("Grades"); targetEndpoints.add("PointGrades"); targetEndpoints.add("DescriptiveGrades"); + targetEndpoints.add("TextGrades"); targetEndpoints.add("BehaviourGrades"); break; case FEATURE_HOMEWORKS: @@ -498,6 +500,9 @@ public class Librus implements EdziennikInterface { case "DescriptiveGrades": getDescriptiveGrades(); break; + case "TextGrades": + getTextGrades(); + break; case "BehaviourGrades": getBehaviourGrades(); break; @@ -644,7 +649,7 @@ public class Librus implements EdziennikInterface { }; librusLoginCallback = redirectUrl -> { - fakeAuthorize = "authorize2"; + fakeAuthorize = "authorize"; authorize(AUTHORIZE_URL, authorizeCallback); }; @@ -2389,6 +2394,62 @@ public class Librus implements EdziennikInterface { }); } + private void getTextGrades() { + callback.onActionStarted(R.string.sync_action_syncing_descriptive_grades); + apiRequest("DescriptiveGrades", data -> { + if (data == null) { + r("finish", "TextGrades"); + return; + } + JsonArray grades = data.get("Grades").getAsJsonArray(); + //d("Got Grades: "+grades.toString()); + for (JsonElement gradeEl : grades) { + JsonObject grade = gradeEl.getAsJsonObject(); + long id = grade.get("Id").getAsLong(); + long teacherId = grade.get("AddedBy").getAsJsonObject().get("Id").getAsLong(); + int semester = grade.get("Semester").getAsInt(); + long subjectId = grade.get("Subject").getAsJsonObject().get("Id").getAsLong(); + String description = grade.get("Map").getAsString(); + + long categoryId = -1; + JsonElement skillEl = grade.get("Skill"); + if (skillEl != null) { + categoryId = skillEl.getAsJsonObject().get("Id").getAsLong(); + } + + String str_date = grade.get("AddDate").getAsString(); + long addedDate = Date.fromIso(str_date); + + String category = ""; + int color = -1; + GradeCategory gradeCategory = GradeCategory.search(gradeCategoryList, categoryId); + if (gradeCategory != null) { + category = gradeCategory.text; + color = gradeCategory.color; + } + + Grade gradeObject = new Grade( + profileId, + id, + category, + color, + "", + description, + 0.0f, + 0, + semester, + teacherId, + subjectId + ); + gradeObject.type = Grade.TYPE_DESCRIPTIVE; + + gradeList.add(gradeObject); + metadataList.add(new Metadata(profileId, Metadata.TYPE_GRADE, gradeObject.id, profile.getEmpty(), profile.getEmpty(), addedDate)); + } + r("finish", "TextGrades"); + }); + } + private void getBehaviourGrades() { d(TAG, "Grades settings: "+enableStandardGrades+", "+enablePointGrades+", "+enableDescriptiveGrades); if (!enableBehaviourGrades) { From 349bcc851d548e0a591ba2e065686b9e21fabc24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Wed, 25 Sep 2019 18:40:57 +0200 Subject: [PATCH 7/7] [3.0.2] Update build.gradle and changelog --- app/src/main/assets/pl-changelog.html | 3 ++- build.gradle | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/assets/pl-changelog.html b/app/src/main/assets/pl-changelog.html index d68bb6f1..5ef7daa1 100644 --- a/app/src/main/assets/pl-changelog.html +++ b/app/src/main/assets/pl-changelog.html @@ -31,8 +31,9 @@ -

    Wersja 3.0.2, 2019-09-23

    +

    Wersja 3.0.2, 2019-09-24

      +
    • Librus: pobieranie Bieżących ocen opisowych.
    • Poprawki UI: kolor ikon paska statusu w jasnym motywie.
    • Poprawka braku skanera QR do przekazywania powiadomień.
    • Poprawka wyboru koloru i daty własnego wydarzenia, które crashowały aplikację.
    • diff --git a/build.gradle b/build.gradle index b98c2750..1aa9b1f4 100644 --- a/build.gradle +++ b/build.gradle @@ -5,8 +5,8 @@ buildscript { kotlin_version = '1.3.50' release = [ - versionName: "3.0.2-rc.1", - versionCode: 3000210 + versionName: "3.0.2", + versionCode: 3000299 ] setup = [