mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2025-01-18 12:56:45 -06:00
[Profile] Remove all Profile.loggedIn usages.
This commit is contained in:
parent
440b76d302
commit
0b7f9a08ef
@ -611,7 +611,6 @@ public class Iuczniowie implements EdziennikInterface {
|
||||
newProfile.setName(newProfile.getStudentNameLong());
|
||||
newProfile.setSubname(loginUsername);
|
||||
newProfile.setEmpty(true);
|
||||
newProfile.setLoggedIn(true);
|
||||
newProfile.putStudentData("studentId", studentIds.get(index));
|
||||
newProfile.putStudentData("registerId", registerIds.get(index));
|
||||
newProfile.putStudentData("schoolYearId", loginSchoolYearId);
|
||||
|
@ -74,11 +74,11 @@ import pl.szczodrzynski.edziennik.data.db.modules.teachers.Teacher;
|
||||
import pl.szczodrzynski.edziennik.data.db.modules.teachers.TeacherAbsence;
|
||||
import pl.szczodrzynski.edziennik.data.db.modules.teams.Team;
|
||||
import pl.szczodrzynski.edziennik.ui.modules.messages.MessagesComposeInfo;
|
||||
import pl.szczodrzynski.edziennik.utils.Utils;
|
||||
import pl.szczodrzynski.edziennik.utils.models.Date;
|
||||
import pl.szczodrzynski.edziennik.utils.models.Endpoint;
|
||||
import pl.szczodrzynski.edziennik.utils.models.Time;
|
||||
import pl.szczodrzynski.edziennik.utils.models.Week;
|
||||
import pl.szczodrzynski.edziennik.utils.Utils;
|
||||
|
||||
import static java.net.HttpURLConnection.HTTP_BAD_REQUEST;
|
||||
import static java.net.HttpURLConnection.HTTP_FORBIDDEN;
|
||||
@ -99,7 +99,6 @@ import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.T
|
||||
import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_PRESENT;
|
||||
import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_RELEASED;
|
||||
import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_PT_MEETING;
|
||||
import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_TEACHER_ABSENCE;
|
||||
import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_NORMAL;
|
||||
import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_SEMESTER1_FINAL;
|
||||
import static pl.szczodrzynski.edziennik.data.db.modules.grades.Grade.TYPE_SEMESTER1_PROPOSED;
|
||||
@ -741,7 +740,6 @@ public class Librus implements EdziennikInterface {
|
||||
newProfile.setName(newProfile.getStudentNameLong());
|
||||
newProfile.setSubname(librusEmail);
|
||||
newProfile.setEmpty(true);
|
||||
newProfile.setLoggedIn(true);
|
||||
newProfile.putStudentData("accountId", accountIds.get(index));
|
||||
newProfile.putStudentData("accountLogin", accountLogins.get(index));
|
||||
newProfile.putStudentData("accountToken", accountTokens.get(index));
|
||||
|
@ -8,7 +8,6 @@ import android.text.Html;
|
||||
import android.util.LongSparseArray;
|
||||
import android.util.Pair;
|
||||
import android.util.SparseArray;
|
||||
import android.util.SparseIntArray;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@ -488,7 +487,6 @@ public class Mobidziennik implements EdziennikInterface {
|
||||
profile.setName(profile.getStudentNameLong());
|
||||
profile.setSubname(loginUsername);
|
||||
profile.setEmpty(true);
|
||||
profile.setLoggedIn(true);
|
||||
profile.putStudentData("studentId", studentIds.get(index));
|
||||
profileList.add(profile);
|
||||
}
|
||||
|
@ -60,11 +60,11 @@ import pl.szczodrzynski.edziennik.data.db.modules.subjects.Subject;
|
||||
import pl.szczodrzynski.edziennik.data.db.modules.teachers.Teacher;
|
||||
import pl.szczodrzynski.edziennik.data.db.modules.teams.Team;
|
||||
import pl.szczodrzynski.edziennik.ui.modules.messages.MessagesComposeInfo;
|
||||
import pl.szczodrzynski.edziennik.utils.Utils;
|
||||
import pl.szczodrzynski.edziennik.utils.models.Date;
|
||||
import pl.szczodrzynski.edziennik.utils.models.Endpoint;
|
||||
import pl.szczodrzynski.edziennik.utils.models.Time;
|
||||
import pl.szczodrzynski.edziennik.utils.models.Week;
|
||||
import pl.szczodrzynski.edziennik.utils.Utils;
|
||||
|
||||
import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_OTHER;
|
||||
import static pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance.TYPE_ABSENT;
|
||||
@ -516,7 +516,6 @@ public class Vulcan implements EdziennikInterface {
|
||||
|
||||
Profile newProfile = new Profile();
|
||||
newProfile.setEmpty(true);
|
||||
newProfile.setLoggedIn(true);
|
||||
saveStudentData(newProfile, account);
|
||||
|
||||
profileList.add(newProfile);
|
||||
|
@ -1,7 +1,5 @@
|
||||
package pl.szczodrzynski.edziennik.data.db.modules.profiles
|
||||
|
||||
import androidx.room.ColumnInfo
|
||||
import androidx.room.Entity
|
||||
import android.content.Context
|
||||
import android.graphics.PorterDuff
|
||||
import android.graphics.PorterDuffColorFilter
|
||||
@ -9,13 +7,12 @@ import android.graphics.drawable.Drawable
|
||||
import android.net.ConnectivityManager
|
||||
import android.widget.ImageView
|
||||
import androidx.core.graphics.drawable.RoundedBitmapDrawableFactory
|
||||
|
||||
import com.google.gson.JsonObject
|
||||
|
||||
import androidx.room.ColumnInfo
|
||||
import androidx.room.Entity
|
||||
import androidx.room.Ignore
|
||||
import com.google.gson.JsonObject
|
||||
import pl.droidsonroids.gif.GifDrawable
|
||||
import pl.szczodrzynski.edziennik.colorFromName
|
||||
|
||||
import pl.szczodrzynski.edziennik.utils.models.Date
|
||||
import pl.szczodrzynski.navlib.ImageHolder
|
||||
import pl.szczodrzynski.navlib.R
|
||||
@ -294,7 +291,6 @@ open class Profile : IDrawerProfile {
|
||||
", syncEnabled=" + syncEnabled +
|
||||
", syncNotifications=" + syncNotifications +
|
||||
", enableSharedEvents=" + enableSharedEvents +
|
||||
", loggedIn=" + loggedIn +
|
||||
", empty=" + empty +
|
||||
", studentNameLong='" + studentNameLong + '\''.toString() +
|
||||
", studentNameShort='" + studentNameShort + '\''.toString() +
|
||||
|
@ -6,6 +6,11 @@ import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.util.LongSparseArray;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@ -14,10 +19,21 @@ import androidx.databinding.DataBindingUtil;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.navigation.NavController;
|
||||
import androidx.navigation.Navigation;
|
||||
|
||||
import com.afollestad.materialdialogs.MaterialDialog;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import pl.szczodrzynski.edziennik.App;
|
||||
import pl.szczodrzynski.edziennik.BuildConfig;
|
||||
import pl.szczodrzynski.edziennik.R;
|
||||
import pl.szczodrzynski.edziennik.databinding.FragmentLoginMigrationBinding;
|
||||
import pl.szczodrzynski.edziennik.data.db.modules.attendance.Attendance;
|
||||
import pl.szczodrzynski.edziennik.data.db.modules.events.Event;
|
||||
import pl.szczodrzynski.edziennik.data.db.modules.events.EventType;
|
||||
@ -32,26 +48,10 @@ import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile;
|
||||
import pl.szczodrzynski.edziennik.data.db.modules.subjects.Subject;
|
||||
import pl.szczodrzynski.edziennik.data.db.modules.teachers.Teacher;
|
||||
import pl.szczodrzynski.edziennik.data.db.modules.teams.Team;
|
||||
import pl.szczodrzynski.edziennik.databinding.FragmentLoginMigrationBinding;
|
||||
import pl.szczodrzynski.edziennik.utils.models.Date;
|
||||
import pl.szczodrzynski.edziennik.utils.models.Time;
|
||||
|
||||
import android.util.LongSparseArray;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.afollestad.materialdialogs.MaterialDialog;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.COLOR_CLASS_EVENT;
|
||||
import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.COLOR_DEFAULT;
|
||||
import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.COLOR_ESSAY;
|
||||
@ -183,7 +183,6 @@ public class LoginMigrationFragment extends Fragment {
|
||||
profile.setSyncNotifications(Boolean.parseBoolean(p.getString("app.register.syncNotificationsEnabled", Boolean.toString(profile.getSyncNotifications()))));
|
||||
profile.setEnableSharedEvents(Boolean.parseBoolean(p.getString("app.register.eventsShared", Boolean.toString(profile.getEnableSharedEvents()))));
|
||||
app.appConfig.countInSeconds = Boolean.parseBoolean(p.getString("app.register.countInSeconds", Boolean.toString(app.appConfig.countInSeconds)));
|
||||
profile.setLoggedIn(true);
|
||||
// so in some APIs we force a full, clean sync
|
||||
profile.setEmpty(true);//Boolean.parseBoolean(p.getString("app.register.empty", Boolean.toString(profile.empty)));
|
||||
profile.setArchived(false);
|
||||
|
Loading…
x
Reference in New Issue
Block a user