mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2025-06-16 15:31:54 +02:00
Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
9df9f50d01 | |||
eab5fdacee | |||
a4db208dfd | |||
8d9459804f | |||
d7a6c222f7 | |||
2eee9e77e3 | |||
1bdd13bf23 | |||
cd3b69b136 | |||
e2d809cceb | |||
b3fa342876 | |||
dce4ef822b | |||
d8afa47d2c |
@ -31,6 +31,13 @@
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h3>Wersja 3.0.1, 2019-09-19</h3>
|
||||
<ul>
|
||||
<li>Librus: Poprawa błędu synchronizacji.</li>
|
||||
<li>Poprawki UI związane z paskiem nawigacji.</li>
|
||||
<li>Mobidziennik: Pobieranie ocen w niektórych przedmiotach.</li>
|
||||
</ul>
|
||||
|
||||
<h3>Wersja 3.0, 2019-09-13</h3>
|
||||
<ul>
|
||||
<li><b>Nowy wygląd i sposób nawigacji</b> w całej aplikacji.</li>
|
||||
|
@ -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()
|
||||
}
|
||||
|
||||
|
@ -880,11 +880,17 @@ public class Iuczniowie implements EdziennikInterface {
|
||||
boolean countToTheAverage = jGrade.get("DoSredniej").getAsBoolean();
|
||||
float value = jGrade.get("WartoscDoSred").getAsFloat();
|
||||
|
||||
String gradeColor = jGrade.get("Kolor").getAsString();
|
||||
int colorInt = 0xff2196f3;
|
||||
if (!gradeColor.isEmpty()) {
|
||||
colorInt = Color.parseColor("#"+gradeColor);
|
||||
}
|
||||
|
||||
Grade gradeObject = new Grade(
|
||||
profileId,
|
||||
jGrade.get("idK").getAsLong(),
|
||||
jGrade.get("Kategoria").getAsString(),
|
||||
Color.parseColor("#"+jGrade.get("Kolor").getAsString()),
|
||||
colorInt,
|
||||
"",
|
||||
jGrade.get("Ocena").getAsString(),
|
||||
value,
|
||||
|
@ -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();
|
||||
|
@ -794,7 +794,7 @@ public class Mobidziennik implements EdziennikInterface {
|
||||
switch (e.tagName()) {
|
||||
case "div": {
|
||||
//d(TAG, "Outer HTML "+e.outerHtml());
|
||||
Matcher matcher = Pattern.compile("<div.*?>\\n*\\s*(.+?)\\n*(?:<.*?)??</div>", Pattern.DOTALL).matcher(e.outerHtml());
|
||||
Matcher matcher = Pattern.compile("<div.*?>\\n*\\s*(.+?)\\s*\\n*(?:<.*?)??</div>", 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;
|
||||
}
|
||||
}
|
||||
|
@ -115,40 +115,6 @@ public class HomeFragment extends Fragment {
|
||||
return true;
|
||||
});*/
|
||||
|
||||
b.testButton.setOnClickListener((v -> {
|
||||
LoginStore loginStore = new LoginStore(1, LOGIN_TYPE_LIBRUS, new JsonObject());
|
||||
loginStore.putLoginData("email", "example@example.com");
|
||||
loginStore.putLoginData("password", "zaq1@WSX");
|
||||
Profile profile = new Profile(1, "test", "testsubname", 1);
|
||||
profile.putStudentData("accountLogin", "1234567");
|
||||
new Librus(app, profile, loginStore).login(new SyncCallback() {
|
||||
@Override
|
||||
public void onLoginFirst(List<Profile> profileList, LoginStore loginStore) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(Context activityContext, ProfileFull profileFull) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProgress(int progressStep) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActionStarted(int stringResId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Context activityContext, @NonNull AppError error) {
|
||||
|
||||
}
|
||||
});
|
||||
}));
|
||||
|
||||
b.composeButton.setVisibility(BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
|
||||
b.composeButton.setOnClickListener((v -> {
|
||||
startActivity(new Intent(activity, MessagesComposeActivity.class));
|
||||
|
@ -1,47 +0,0 @@
|
||||
package pl.szczodrzynski.edziennik.network;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.koushikdutta.async.http.Headers;
|
||||
import com.koushikdutta.ion.Ion;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.CookieManager;
|
||||
import java.net.URI;
|
||||
import java.net.URLConnection;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class IonCookieManager {
|
||||
private static final String TAG = "IonCookieManager";
|
||||
private CookieManager manager;
|
||||
|
||||
public IonCookieManager(Context context) {
|
||||
Ion ion = Ion.getDefault(context);
|
||||
manager = ion.getCookieMiddleware().getCookieManager();
|
||||
}
|
||||
|
||||
public void storeCookies(URLConnection conn) throws IOException {
|
||||
List<String> cookies = conn.getHeaderFields().get("Set-Cookie");
|
||||
URI uri = URI.create(conn.getURL().toString());
|
||||
if(cookies != null) {
|
||||
storeCookies(uri, cookies);
|
||||
}
|
||||
}
|
||||
|
||||
public void storeCookies(URI uri, List<String> cookies) throws IOException {
|
||||
Headers headers = new Headers();
|
||||
headers.addAll("Set-Cookie", cookies);
|
||||
Log.d(TAG, "storeAllCookies: "+cookies.toString());
|
||||
manager.put(uri, headers.getMultiMap());
|
||||
}
|
||||
|
||||
public void storeCookie(URI uri, String cookieName, String cookieValue) throws IOException {
|
||||
List<String> cookie = new ArrayList<String>();
|
||||
cookie.add(String.format("%s=%s", cookieName, cookieValue));
|
||||
Log.d(TAG, "storeCookie: "+String.format("%s=%s", cookieName, cookieValue));
|
||||
storeCookies(uri, cookie);
|
||||
}
|
||||
|
||||
}
|
@ -17,147 +17,154 @@
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/webPushConfig"
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textView8"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:text="Przekazywanie powiadomień pozwala przesyłać wszystkie powiadomienia z tego urządzenia na wszystkie sparowane komputery, widoczne poniżej.\n\nPowiadomienia będą się wyświetlać w przeglądarce, w okienku pop-up, w prawym dolnym rogu ekranu.\n\nLista komputerów docelowych jest niezależna od wybranego profilu ucznia." />
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/webPushConfig"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginTop="@dimen/section_margin_top"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/web_push_configured_browsers"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="?attr/colorSection"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/section_underline_height"
|
||||
android:layout_marginTop="2dp"
|
||||
android:background="?attr/colorSection" />
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TableLayout
|
||||
android:id="@+id/browserList"
|
||||
android:id="@+id/textView8"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:shrinkColumns="0"
|
||||
android:stretchColumns="0">
|
||||
android:text="Przekazywanie powiadomień pozwala przesyłać wszystkie powiadomienia z tego urządzenia na wszystkie sparowane komputery, widoczne poniżej.\n\nPowiadomienia będą się wyświetlać w przeglądarce, w okienku pop-up, w prawym dolnym rogu ekranu.\n\nLista komputerów docelowych jest niezależna od wybranego profilu ucznia." />
|
||||
|
||||
<!--<TableRow
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginTop="@dimen/section_margin_top"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="end">
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/web_push_configured_browsers"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="?attr/colorSection"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/section_underline_height"
|
||||
android:layout_marginTop="2dp"
|
||||
android:background="?attr/colorSection" />
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TableLayout
|
||||
android:id="@+id/browserList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="8dp"
|
||||
android:shrinkColumns="0"
|
||||
android:stretchColumns="0">
|
||||
|
||||
<!--<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginRight="8dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="Chrome 70.0.3538.102 @ Windows 7 64-bit" />
|
||||
android:gravity="end">
|
||||
|
||||
<Button
|
||||
android:id="@+id/button6"
|
||||
style="@style/Widget.AppCompat.Button.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="0dp"
|
||||
android:minWidth="0dp"
|
||||
android:text="Usuń" />
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginRight="8dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="Chrome 70.0.3538.102 @ Windows 7 64-bit" />
|
||||
|
||||
</TableRow>-->
|
||||
<Button
|
||||
android:id="@+id/button6"
|
||||
style="@style/Widget.AppCompat.Button.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="0dp"
|
||||
android:minWidth="0dp"
|
||||
android:text="Usuń" />
|
||||
|
||||
</TableLayout>
|
||||
</TableRow>-->
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/browserListProgressBar"
|
||||
style="?android:attr/progressBarStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:visibility="invisible" />
|
||||
</TableLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/browserListErrorText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="italic"
|
||||
android:visibility="visible"
|
||||
android:text="@string/web_push_no_browsers" />
|
||||
<ProgressBar
|
||||
android:id="@+id/browserListProgressBar"
|
||||
style="?android:attr/progressBarStyle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:visibility="invisible" />
|
||||
|
||||
</FrameLayout>
|
||||
<TextView
|
||||
android:id="@+id/browserListErrorText"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="italic"
|
||||
android:visibility="visible"
|
||||
android:text="@string/web_push_no_browsers" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginTop="@dimen/section_margin_top"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:orientation="vertical">
|
||||
</FrameLayout>
|
||||
|
||||
<TextView
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/web_push_pair_browser"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="?attr/colorSection"
|
||||
android:textStyle="bold" />
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginTop="@dimen/section_margin_top"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/web_push_pair_browser"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="?attr/colorSection"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/section_underline_height"
|
||||
android:layout_marginTop="2dp"
|
||||
android:background="?attr/colorSection" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/section_underline_height"
|
||||
android:layout_marginTop="2dp"
|
||||
android:background="?attr/colorSection" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="8dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:text="W przeglądarce na komputerze wejdź na stronę\n\nhttp://edziennik.szczodrzynski.pl/wp\n\nUdziel zgody na wysyłanie powiadomień, następnie zeskanuj wygenerowany kod QR.\n\nPod tym samym adresem możesz zarządzać listą sparowanych z przeglądarką urządzeń.\n\nJeśli sparujesz kilka urządzeń z tą samą przeglądarką, możesz otrzymywać te same powiadomienia kilkukrotnie." />
|
||||
|
||||
<Button
|
||||
android:id="@+id/webPushScanNewButton"
|
||||
style="@style/Widget.AppCompat.Button.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Skanuj..." />
|
||||
</LinearLayout>
|
||||
android:layout_margin="8dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
|
||||
android:text="W przeglądarce na komputerze wejdź na stronę\n\nhttp://edziennik.szczodrzynski.pl/wp\n\nUdziel zgody na wysyłanie powiadomień, następnie zeskanuj wygenerowany kod QR.\n\nPod tym samym adresem możesz zarządzać listą sparowanych z przeglądarką urządzeń.\n\nJeśli sparujesz kilka urządzeń z tą samą przeglądarką, możesz otrzymywać te same powiadomienia kilkukrotnie." />
|
||||
|
||||
<Button
|
||||
android:id="@+id/webPushScanNewButton"
|
||||
style="@style/Widget.AppCompat.Button.Small"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="Skanuj..." />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
<me.dm7.barcodescanner.zxing.ZXingScannerView
|
||||
android:id="@+id/qrCodeScanner"
|
||||
@ -168,4 +175,4 @@
|
||||
</me.dm7.barcodescanner.zxing.ZXingScannerView>
|
||||
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
</layout>
|
||||
|
@ -95,6 +95,8 @@
|
||||
<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>
|
||||
@ -119,6 +121,8 @@
|
||||
<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",
|
||||
versionCode: 3000099
|
||||
versionName: "3.0.1",
|
||||
versionCode: 3000199
|
||||
]
|
||||
|
||||
setup = [
|
||||
|
Reference in New Issue
Block a user