mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2025-01-18 21:06:44 -06:00
Merge branch 'develop' into api-v2
# Conflicts: # app/src/main/java/pl/szczodrzynski/edziennik/data/db/AppDb.java
This commit is contained in:
commit
0395598efb
@ -31,6 +31,13 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
<h3>Wersja 3.1.1, 2019-10-09</h3>
|
||||||
|
<ul>
|
||||||
|
<li>Librus: poprawiona synchronizacja kategorii i kolorów ocen.</li>
|
||||||
|
<li>Zmieniony kolor dolnego paska w ciemnym motywie.</li>
|
||||||
|
<li>Zaktualizowany licznik czasu lekcji.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<h3>Wersja 3.1, 2019-09-29</h3>
|
<h3>Wersja 3.1, 2019-09-29</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Poprawiony interfejs zadań domowych.</li>
|
<li>Poprawiony interfejs zadań domowych.</li>
|
||||||
|
@ -21,14 +21,11 @@ import com.mikepenz.materialdrawer.model.ProfileSettingDrawerItem
|
|||||||
import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem
|
import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem
|
||||||
import pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.*
|
import pl.szczodrzynski.edziennik.data.db.modules.metadata.Metadata.*
|
||||||
import pl.szczodrzynski.edziennik.utils.Themes
|
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.SystemBarsUtil.Companion.COLOR_HALF_TRANSPARENT
|
||||||
import pl.szczodrzynski.navlib.bottomsheet.NavBottomSheet
|
import pl.szczodrzynski.navlib.bottomsheet.NavBottomSheet
|
||||||
import pl.szczodrzynski.navlib.drawer.NavDrawer
|
import pl.szczodrzynski.navlib.drawer.NavDrawer
|
||||||
import pl.szczodrzynski.navlib.drawer.items.DrawerPrimaryItem
|
import pl.szczodrzynski.navlib.drawer.items.DrawerPrimaryItem
|
||||||
import pl.szczodrzynski.navlib.drawer.items.withAppTitle
|
import pl.szczodrzynski.navlib.drawer.items.withAppTitle
|
||||||
import pl.szczodrzynski.navlib.getColorFromAttr
|
|
||||||
import androidx.appcompat.widget.PopupMenu
|
import androidx.appcompat.widget.PopupMenu
|
||||||
import androidx.core.graphics.ColorUtils
|
import androidx.core.graphics.ColorUtils
|
||||||
import androidx.navigation.NavOptions
|
import androidx.navigation.NavOptions
|
||||||
@ -39,6 +36,7 @@ import com.mikepenz.iconics.IconicsSize
|
|||||||
import com.mikepenz.materialdrawer.model.DividerDrawerItem
|
import com.mikepenz.materialdrawer.model.DividerDrawerItem
|
||||||
import com.mikepenz.materialdrawer.model.ProfileDrawerItem
|
import com.mikepenz.materialdrawer.model.ProfileDrawerItem
|
||||||
import com.mikepenz.materialdrawer.model.interfaces.IProfile
|
import com.mikepenz.materialdrawer.model.interfaces.IProfile
|
||||||
|
import me.zhanghai.android.materialprogressbar.internal.ThemeUtils
|
||||||
import pl.droidsonroids.gif.GifDrawable
|
import pl.droidsonroids.gif.GifDrawable
|
||||||
import pl.szczodrzynski.edziennik.App.APP_URL
|
import pl.szczodrzynski.edziennik.App.APP_URL
|
||||||
import pl.szczodrzynski.edziennik.data.api.AppError
|
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.ui.modules.timetable.TimetableFragment
|
||||||
import pl.szczodrzynski.edziennik.utils.SwipeRefreshLayoutNoTouch
|
import pl.szczodrzynski.edziennik.utils.SwipeRefreshLayoutNoTouch
|
||||||
import pl.szczodrzynski.edziennik.utils.Utils
|
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.BottomSheetPrimaryItem
|
||||||
import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetSeparatorItem
|
import pl.szczodrzynski.navlib.bottomsheet.items.BottomSheetSeparatorItem
|
||||||
import java.io.File
|
import java.io.File
|
||||||
@ -277,6 +277,13 @@ class MainActivity : AppCompatActivity() {
|
|||||||
fabExtendable = true
|
fabExtendable = true
|
||||||
fabExtended = false
|
fabExtended = false
|
||||||
fabGravity = Gravity.CENTER
|
fabGravity = Gravity.CENTER
|
||||||
|
if (Themes.isDark) {
|
||||||
|
setBackgroundColor(blendColors(
|
||||||
|
getColorFromAttr(context, R.attr.colorSurface),
|
||||||
|
getColorFromRes(R.color.colorSurface_4dp)
|
||||||
|
))
|
||||||
|
elevation = dpToPx(4).toFloat()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bottomSheet.apply {
|
bottomSheet.apply {
|
||||||
|
@ -273,8 +273,8 @@ public class Librus implements EdziennikInterface {
|
|||||||
targetEndpoints.add("Users");
|
targetEndpoints.add("Users");
|
||||||
targetEndpoints.add("Subjects");
|
targetEndpoints.add("Subjects");
|
||||||
targetEndpoints.add("Classrooms");
|
targetEndpoints.add("Classrooms");
|
||||||
targetEndpoints.add("Timetables");
|
|
||||||
targetEndpoints.add("Substitutions");
|
targetEndpoints.add("Substitutions");
|
||||||
|
targetEndpoints.add("Timetables");
|
||||||
targetEndpoints.add("Colors");
|
targetEndpoints.add("Colors");
|
||||||
|
|
||||||
targetEndpoints.add("SavedGradeCategories");
|
targetEndpoints.add("SavedGradeCategories");
|
||||||
@ -342,8 +342,8 @@ public class Librus implements EdziennikInterface {
|
|||||||
switch (feature) {
|
switch (feature) {
|
||||||
case FEATURE_TIMETABLE:
|
case FEATURE_TIMETABLE:
|
||||||
targetEndpoints.add("Classrooms");
|
targetEndpoints.add("Classrooms");
|
||||||
targetEndpoints.add("Timetables");
|
|
||||||
targetEndpoints.add("Substitutions");
|
targetEndpoints.add("Substitutions");
|
||||||
|
targetEndpoints.add("Timetables");
|
||||||
break;
|
break;
|
||||||
case FEATURE_AGENDA:
|
case FEATURE_AGENDA:
|
||||||
targetEndpoints.add("Events");
|
targetEndpoints.add("Events");
|
||||||
@ -1658,6 +1658,7 @@ public class Librus implements EdziennikInterface {
|
|||||||
try {
|
try {
|
||||||
for (Map.Entry<String, JsonElement> dayEl: timetables.entrySet()) {
|
for (Map.Entry<String, JsonElement> dayEl: timetables.entrySet()) {
|
||||||
JsonArray day = dayEl.getValue().getAsJsonArray();
|
JsonArray day = dayEl.getValue().getAsJsonArray();
|
||||||
|
Date lessonDate = Date.fromY_m_d(dayEl.getKey());
|
||||||
for (JsonElement lessonGroupEl: day) {
|
for (JsonElement lessonGroupEl: day) {
|
||||||
if ((lessonGroupEl instanceof JsonArray && ((JsonArray) lessonGroupEl).size() == 0) || lessonGroupEl instanceof JsonNull || lessonGroupEl == null) {
|
if ((lessonGroupEl instanceof JsonArray && ((JsonArray) lessonGroupEl).size() == 0) || lessonGroupEl instanceof JsonNull || lessonGroupEl == null) {
|
||||||
continue;
|
continue;
|
||||||
@ -1732,7 +1733,26 @@ public class Librus implements EdziennikInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
JsonElement classroom;
|
JsonElement classroom;
|
||||||
if ((classroom = lesson.get(substitution && !cancelled ? "OrgClassroom" : "Classroom")) != null) {
|
JsonElement substitutionClassroom;
|
||||||
|
if (substitution && !cancelled) {
|
||||||
|
classroom = lesson.get("OrgClassroom");
|
||||||
|
substitutionClassroom = lesson.get("Classroom");
|
||||||
|
|
||||||
|
if (classroom != null)
|
||||||
|
lessonObject.classroomName = classrooms.get(classroom.getAsJsonObject().get("Id").getAsInt());
|
||||||
|
|
||||||
|
if (substitutionClassroom != null) {
|
||||||
|
for (LessonChange lessonChange : lessonChangeList) {
|
||||||
|
if(lessonChange.lessonDate.compareTo(lessonDate) == 0) {
|
||||||
|
lessonChange.classroomName
|
||||||
|
= classrooms.get(substitutionClassroom.getAsJsonObject().get("Id").getAsInt());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
classroom = lesson.get("Classroom");
|
||||||
|
if (classroom != null)
|
||||||
lessonObject.classroomName = classrooms.get(classroom.getAsJsonObject().get("Id").getAsInt());
|
lessonObject.classroomName = classrooms.get(classroom.getAsJsonObject().get("Id").getAsInt());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1931,7 +1951,7 @@ public class Librus implements EdziennikInterface {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// not a full sync. Will get all grade categories. Clear the current list.
|
// 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);
|
callback.onActionStarted(R.string.sync_action_syncing_grade_categories);
|
||||||
apiRequest("Grades/Categories", data -> {
|
apiRequest("Grades/Categories", data -> {
|
||||||
|
@ -291,7 +291,15 @@ public class HomeFragment extends Fragment {
|
|||||||
activity.getBottomSheet().close();
|
activity.getBottomSheet().close();
|
||||||
setNumberDialog();
|
setNumberDialog();
|
||||||
}),
|
}),
|
||||||
new BottomSheetSeparatorItem(true)
|
new BottomSheetSeparatorItem(true),
|
||||||
|
new BottomSheetPrimaryItem(true)
|
||||||
|
.withTitle(R.string.menu_mark_everything_as_read)
|
||||||
|
.withIcon(CommunityMaterial.Icon.cmd_eye_check)
|
||||||
|
.withOnClickListener(v3 -> {
|
||||||
|
activity.getBottomSheet().close();
|
||||||
|
AsyncTask.execute(() -> app.db.metadataDao().setAllSeen(App.profileId, true));
|
||||||
|
Toast.makeText(activity, R.string.main_menu_mark_as_read_success, Toast.LENGTH_SHORT).show();
|
||||||
|
})
|
||||||
);
|
);
|
||||||
activity.gainAttention();
|
activity.gainAttention();
|
||||||
}
|
}
|
||||||
@ -322,15 +330,15 @@ public class HomeFragment extends Fragment {
|
|||||||
if (app.appConfig.countInSeconds) {
|
if (app.appConfig.countInSeconds) {
|
||||||
return 1000-(System.currentTimeMillis() % 1000);
|
return 1000-(System.currentTimeMillis() % 1000);
|
||||||
}
|
}
|
||||||
if (diff.minute > 5) {
|
if (diff.minute > 10) {
|
||||||
//Log.d(TAG, "60 secs");
|
//Log.d(TAG, "60 secs");
|
||||||
return 60000-(System.currentTimeMillis() % 60000);
|
return 60000-(System.currentTimeMillis() % 60000);
|
||||||
}
|
}
|
||||||
else if (diff.minute >= 1) {
|
else if (diff.minute >= 1 && false) {
|
||||||
//Log.d(TAG, "3 secs");
|
//Log.d(TAG, "3 secs");
|
||||||
return 3000-(System.currentTimeMillis() % 3000);
|
return 3000-(System.currentTimeMillis() % 3000);
|
||||||
}
|
}
|
||||||
else if (diff.second >= 40) {
|
else if (diff.second >= 40 && false) {
|
||||||
//Log.d(TAG, "2 secs");
|
//Log.d(TAG, "2 secs");
|
||||||
return 2000-(System.currentTimeMillis() % 2000);
|
return 2000-(System.currentTimeMillis() % 2000);
|
||||||
}
|
}
|
||||||
|
@ -858,4 +858,5 @@
|
|||||||
<string name="sync_action_syncing_grade_comments">Getting grade comments</string>
|
<string name="sync_action_syncing_grade_comments">Getting grade comments</string>
|
||||||
<string name="sync_action_syncing_school_free_days">Getting school free days</string>
|
<string name="sync_action_syncing_school_free_days">Getting school free days</string>
|
||||||
<string name="settings_register_show_teacher_absences_text">Show teacher absences in Agenda</string>
|
<string name="settings_register_show_teacher_absences_text">Show teacher absences in Agenda</string>
|
||||||
|
<string name="menu_mark_everything_as_read">Mark everything as read</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -435,6 +435,7 @@
|
|||||||
<string name="menu_homework">Zadania domowe</string>
|
<string name="menu_homework">Zadania domowe</string>
|
||||||
<string name="menu_manage_profiles">Zarządzaj profilami</string>
|
<string name="menu_manage_profiles">Zarządzaj profilami</string>
|
||||||
<string name="menu_mark_as_read">Oznacz jako przeczytane</string>
|
<string name="menu_mark_as_read">Oznacz jako przeczytane</string>
|
||||||
|
<string name="menu_mark_everything_as_read">Oznacz wszystko jako przeczytane</string>
|
||||||
<string name="menu_messages">Wiadomości</string>
|
<string name="menu_messages">Wiadomości</string>
|
||||||
<string name="menu_messages_inbox">Odebrane</string>
|
<string name="menu_messages_inbox">Odebrane</string>
|
||||||
<string name="menu_messages_sent">Wysłane</string>
|
<string name="menu_messages_sent">Wysłane</string>
|
||||||
|
@ -5,8 +5,8 @@ buildscript {
|
|||||||
kotlin_version = '1.3.50'
|
kotlin_version = '1.3.50'
|
||||||
|
|
||||||
release = [
|
release = [
|
||||||
versionName: "3.1",
|
versionName: "3.1.1",
|
||||||
versionCode: 3010099
|
versionCode: 3010199
|
||||||
]
|
]
|
||||||
|
|
||||||
setup = [
|
setup = [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user