forked from github/szkolny
Merge branch 'hotfix-3.0.2'
This commit is contained in:
commit
3e6b0250d0
@ -31,6 +31,14 @@
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h3>Wersja 3.0.2, 2019-09-24</h3>
|
||||
<ul>
|
||||
<li>Librus: pobieranie Bieżących ocen opisowych.</li>
|
||||
<li>Poprawki UI: kolor ikon paska statusu w jasnym motywie.</li>
|
||||
<li>Poprawka braku skanera QR do przekazywania powiadomień.</li>
|
||||
<li>Poprawka wyboru koloru i daty własnego wydarzenia, które crashowały aplikację.</li>
|
||||
</ul>
|
||||
|
||||
<h3>Wersja 3.0.1, 2019-09-19</h3>
|
||||
<ul>
|
||||
<li>Librus: Poprawa błędu synchronizacji.</li>
|
||||
|
@ -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);
|
||||
|
@ -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()
|
||||
|
@ -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) {
|
||||
|
@ -18,11 +18,11 @@
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/webPushConfig"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/webPushConfig"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
@ -95,8 +95,6 @@
|
||||
<item name="mal_color_secondary">?android:textColorSecondary</item>
|
||||
<item name="mal_card_background">?colorSurface</item>
|
||||
<item name="mal_divider_color">@color/dividerColor</item>
|
||||
|
||||
<item name="android:statusBarColor" tools:targetApi="lollipop">?android:windowBackground</item>
|
||||
</style>
|
||||
<style name="AppTheme.Dark" parent="NavView.Dark">
|
||||
<item name="colorPrimary">#64b5f6</item>
|
||||
@ -121,8 +119,6 @@
|
||||
<item name="mal_color_secondary">@color/secondaryTextDark</item>
|
||||
<item name="mal_card_background">?colorSurface</item>
|
||||
<item name="mal_divider_color">@color/dividerColor</item>
|
||||
|
||||
<item name="android:statusBarColor" tools:targetApi="lollipop">?android:windowBackground</item>
|
||||
</style>
|
||||
|
||||
|
||||
|
@ -5,8 +5,8 @@ buildscript {
|
||||
kotlin_version = '1.3.50'
|
||||
|
||||
release = [
|
||||
versionName: "3.0.1",
|
||||
versionCode: 3000199
|
||||
versionName: "3.0.2",
|
||||
versionCode: 3000299
|
||||
]
|
||||
|
||||
setup = [
|
||||
|
Loading…
Reference in New Issue
Block a user