From 015416f2a88eaf8296a8986ca7a3c7b65e09ab88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Wed, 9 Oct 2019 18:20:54 +0200 Subject: [PATCH 1/5] [API/Librus] Fix for not clearing the grade category list --- .../main/java/pl/szczodrzynski/edziennik/data/api/Librus.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Librus.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Librus.java index ff04e59e..860219a7 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Librus.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/Librus.java @@ -1936,7 +1936,7 @@ public class Librus implements EdziennikInterface { return; } // not a full sync. Will get all grade categories. Clear the current list. - gradeCategoryList.clear(); + //gradeCategoryList.clear(); callback.onActionStarted(R.string.sync_action_syncing_grade_categories); apiRequest("Grades/Categories", data -> { From 38c5f5d7f6c1f33af22752c44f0ffe8138e6e519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Wed, 9 Oct 2019 18:22:03 +0200 Subject: [PATCH 2/5] [UI] Change lesson time counter refresh intervals --- .../edziennik/ui/modules/home/HomeFragment.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/HomeFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/HomeFragment.java index 24df37d0..ce8f524f 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/HomeFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/home/HomeFragment.java @@ -286,15 +286,15 @@ public class HomeFragment extends Fragment { if (app.appConfig.countInSeconds) { return 1000-(System.currentTimeMillis() % 1000); } - if (diff.minute > 5) { + if (diff.minute > 10) { //Log.d(TAG, "60 secs"); return 60000-(System.currentTimeMillis() % 60000); } - else if (diff.minute >= 1) { + else if (diff.minute >= 1 && false) { //Log.d(TAG, "3 secs"); return 3000-(System.currentTimeMillis() % 3000); } - else if (diff.second >= 40) { + else if (diff.second >= 40 && false) { //Log.d(TAG, "2 secs"); return 2000-(System.currentTimeMillis() % 2000); } From 554faf06a169b39d11cc55531e17fedc1d8f5ac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Wed, 9 Oct 2019 18:22:33 +0200 Subject: [PATCH 3/5] [UI] Change bottom bar color to window background --- .../java/pl/szczodrzynski/edziennik/MainActivity.kt | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt b/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt index 6cf8dec7..e617b152 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt @@ -21,14 +21,11 @@ import com.mikepenz.materialdrawer.model.ProfileSettingDrawerItem import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem import pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.* import pl.szczodrzynski.edziennik.utils.Themes -import pl.szczodrzynski.navlib.NavView -import pl.szczodrzynski.navlib.SystemBarsUtil import pl.szczodrzynski.navlib.SystemBarsUtil.Companion.COLOR_HALF_TRANSPARENT import pl.szczodrzynski.navlib.bottomsheet.NavBottomSheet import pl.szczodrzynski.navlib.drawer.NavDrawer 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 @@ -39,6 +36,7 @@ import com.mikepenz.iconics.IconicsSize import com.mikepenz.materialdrawer.model.DividerDrawerItem import com.mikepenz.materialdrawer.model.ProfileDrawerItem import com.mikepenz.materialdrawer.model.interfaces.IProfile +import me.zhanghai.android.materialprogressbar.internal.ThemeUtils import pl.droidsonroids.gif.GifDrawable import pl.szczodrzynski.edziennik.App.APP_URL import pl.szczodrzynski.edziennik.data.api.AppError @@ -72,6 +70,8 @@ import pl.szczodrzynski.edziennik.ui.modules.settings.SettingsNewFragment import pl.szczodrzynski.edziennik.ui.modules.timetable.TimetableFragment import pl.szczodrzynski.edziennik.utils.SwipeRefreshLayoutNoTouch import pl.szczodrzynski.edziennik.utils.Utils +import pl.szczodrzynski.edziennik.utils.Utils.dpToPx +import pl.szczodrzynski.navlib.* import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetPrimaryItem import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetSeparatorItem import java.io.File @@ -277,6 +277,13 @@ class MainActivity : AppCompatActivity() { fabExtendable = true fabExtended = false fabGravity = Gravity.CENTER + if (Themes.isDark) { + setBackgroundColor(blendColors( + getColorFromAttr(context, R.attr.colorSurface), + getColorFromRes(R.color.colorSurface_4dp) + )) + elevation = dpToPx(4).toFloat() + } } bottomSheet.apply { From 931d09d0b0cfbb7d11b86e7f13eccdfa8aef9a3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Wed, 9 Oct 2019 18:50:17 +0200 Subject: [PATCH 4/5] Add database migration (unset last full sync) --- .../pl/szczodrzynski/edziennik/data/db/AppDb.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/db/AppDb.java b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/AppDb.java index 05ac2fb1..1481b8e1 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/data/db/AppDb.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/db/AppDb.java @@ -81,7 +81,7 @@ import android.content.Context; Message.class, MessageRecipient.class, DebugLog.class, - Metadata.class}, version = 54) + Metadata.class}, version = 55) @TypeConverters({ ConverterTime.class, ConverterDate.class, @@ -558,6 +558,12 @@ public abstract class AppDb extends RoomDatabase { database.execSQL("ALTER TABLE teacherAbsence ADD teacherAbsenceTimeTo TEXT DEFAULT NULL"); } }; + private static final Migration MIGRATION_54_55 = new Migration(54, 55) { + @Override + public void migrate(@NonNull SupportSQLiteDatabase database) { + database.execSQL("UPDATE profiles SET lastFullSync = 0"); + } + }; public static AppDb getDatabase(final Context context) { @@ -609,7 +615,8 @@ public abstract class AppDb extends RoomDatabase { MIGRATION_50_51, MIGRATION_51_52, MIGRATION_52_53, - MIGRATION_53_54 + MIGRATION_53_54, + MIGRATION_54_55 ) .allowMainThreadQueries() //.fallbackToDestructiveMigration() From 7eaa4caae2ab66beeca29e9a59cc835b4713cb07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Wed, 9 Oct 2019 19:15:03 +0200 Subject: [PATCH 5/5] [3.1.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 60bb4418..eab231b6 100644 --- a/app/src/main/assets/pl-changelog.html +++ b/app/src/main/assets/pl-changelog.html @@ -31,6 +31,13 @@ +

Wersja 3.1.1, 2019-10-09

+
    +
  • Librus: poprawiona synchronizacja kategorii i kolorów ocen.
  • +
  • Zmieniony kolor dolnego paska w ciemnym motywie.
  • +
  • Zaktualizowany licznik czasu lekcji.
  • +
+

Wersja 3.1, 2019-09-29

  • Poprawiony interfejs zadań domowych.
  • diff --git a/build.gradle b/build.gradle index ca180a12..0ab85d27 100644 --- a/build.gradle +++ b/build.gradle @@ -5,8 +5,8 @@ buildscript { kotlin_version = '1.3.50' release = [ - versionName: "3.1", - versionCode: 3010099 + versionName: "3.1.1", + versionCode: 3010199 ] setup = [