diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt b/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt index 8fdc45c1..d1faa9d2 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt @@ -45,6 +45,7 @@ import pl.szczodrzynski.edziennik.network.ServerRequest import pl.szczodrzynski.edziennik.sync.AppManagerDetectedEvent import pl.szczodrzynski.edziennik.sync.SyncWorker import pl.szczodrzynski.edziennik.ui.dialogs.changelog.ChangelogDialog +import pl.szczodrzynski.edziennik.ui.dialogs.error.ErrorSnackbar import pl.szczodrzynski.edziennik.ui.dialogs.settings.ProfileRemoveDialog import pl.szczodrzynski.edziennik.ui.modules.agenda.AgendaFragment import pl.szczodrzynski.edziennik.ui.modules.announcements.AnnouncementsFragment @@ -215,6 +216,7 @@ class MainActivity : AppCompatActivity() { val navView: NavView by lazy { b.navView } val drawer: NavDrawer by lazy { navView.drawer } val bottomSheet: NavBottomSheet by lazy { navView.bottomSheet } + val errorSnackbar: ErrorSnackbar by lazy { ErrorSnackbar(this) } val swipeRefreshLayout: SwipeRefreshLayoutNoTouch by lazy { b.swipeRefreshLayout } @@ -247,6 +249,8 @@ class MainActivity : AppCompatActivity() { setContentView(b.root) + errorSnackbar.setCoordinator(b.navView.coordinator, b.navView.bottomBar) + navLoading = true b.navView.apply { @@ -574,7 +578,12 @@ class MainActivity : AppCompatActivity() { } @Subscribe(threadMode = ThreadMode.MAIN) fun onSyncErrorEvent(event: ApiTaskErrorEvent) { - + navView.toolbar.apply { + subtitleFormat = R.string.toolbar_subtitle + subtitleFormatWithUnread = R.plurals.toolbar_subtitle_with_unread + subtitle = "Gotowe" + } + errorSnackbar.addError(event.error).show() } @Subscribe(threadMode = ThreadMode.MAIN, sticky = true) fun onAppManagerDetectedEvent(event: AppManagerDetectedEvent) { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/Errors.kt b/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/Errors.kt index 5f9a59c0..a3b41c45 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/Errors.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/Errors.kt @@ -163,3 +163,5 @@ const val EXCEPTION_LIBRUS_MESSAGES_REQUEST = 911 const val EXCEPTION_IDZIENNIK_WEB_REQUEST = 912 const val EXCEPTION_IDZIENNIK_WEB_API_REQUEST = 913 const val EXCEPTION_IDZIENNIK_API_REQUEST = 914 + +const val LOGIN_NO_ARGUMENTS = 1201 diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/models/ApiError.kt b/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/models/ApiError.kt index d819eac3..effe2a72 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/models/ApiError.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/api/v2/models/ApiError.kt @@ -4,6 +4,7 @@ package pl.szczodrzynski.edziennik.api.v2.models +import android.content.Context import com.google.gson.JsonObject import im.wangchao.mhttp.Request import im.wangchao.mhttp.Response @@ -52,6 +53,15 @@ class ApiError(val tag: String, val errorCode: Int) { ) } + fun getStringReason(context: Context): String { + return context.resources.getIdentifier("error_${errorCode}_reason", "string", context.packageName).let { + if (it != 0) + context.getString(it) + else + "?" + } + } + override fun toString(): String { return "ApiError(tag='$tag', errorCode=$errorCode, profileId=$profileId, throwable=$throwable, apiResponse=$apiResponse, request=$request, response=$response, isCritical=$isCritical)" } diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/error/ErrorSnackbar.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/error/ErrorSnackbar.kt new file mode 100644 index 00000000..21899e9f --- /dev/null +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/error/ErrorSnackbar.kt @@ -0,0 +1,51 @@ +/* + * Copyright (c) Kuba Szczodrzyński 2019-11-13. + */ + +package pl.szczodrzynski.edziennik.ui.dialogs.error + +import android.view.View +import androidx.appcompat.app.AppCompatActivity +import androidx.coordinatorlayout.widget.CoordinatorLayout +import androidx.core.graphics.ColorUtils +import com.google.android.material.snackbar.Snackbar +import pl.szczodrzynski.edziennik.R +import pl.szczodrzynski.edziennik.api.v2.models.ApiError +import pl.szczodrzynski.edziennik.data.api.AppError +import pl.szczodrzynski.navlib.getColorFromAttr + +class ErrorSnackbar(val activity: AppCompatActivity) { + companion object { + private const val TAG = "ErrorSnackbar" + } + + private var snackbar: Snackbar? = null + private lateinit var coordinator: CoordinatorLayout + private val errors = mutableListOf() + + fun setCoordinator(coordinatorLayout: CoordinatorLayout, showAbove: View? = null) { + this.coordinator = coordinatorLayout + snackbar = Snackbar.make(coordinator, R.string.snackbar_error_text, Snackbar.LENGTH_INDEFINITE) + snackbar?.setAction(R.string.more) { + + } + val bgColor = ColorUtils.compositeColors( + getColorFromAttr(activity, R.attr.colorOnSurface) and 0xcfffffff.toInt(), + getColorFromAttr(activity, R.attr.colorSurface) + ) + snackbar?.setBackgroundTint(bgColor) + showAbove?.let { snackbar?.anchorView = it } + } + + fun addError(appError: AppError) { + + } + fun addError(apiError: ApiError): ErrorSnackbar { + errors += apiError + snackbar?.setText(apiError.getStringReason(activity)) + return this + } + + fun show() = snackbar?.show() + fun dismiss() = snackbar?.dismiss() +} \ No newline at end of file diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventManualDialog.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventManualDialog.java index 8bc27048..f3e747e5 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventManualDialog.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventManualDialog.java @@ -36,7 +36,6 @@ import java.util.List; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.MainActivity; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.data.api.AppError; import pl.szczodrzynski.edziennik.data.db.modules.events.Event; import pl.szczodrzynski.edziennik.data.db.modules.events.EventFull; import pl.szczodrzynski.edziennik.data.db.modules.events.EventType; @@ -54,7 +53,6 @@ import pl.szczodrzynski.edziennik.utils.models.Time; import pl.szczodrzynski.edziennik.utils.models.Week; import static pl.szczodrzynski.edziennik.App.APP_URL; -import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_OTHER; import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.COLOR_DEFAULT; import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_HOMEWORK; import static pl.szczodrzynski.edziennik.data.db.modules.events.Event.TYPE_UNDEFINED; @@ -374,7 +372,8 @@ public class EventManualDialog { } } catch (Exception e) { activity.runOnUiThread(() -> { - app.apiEdziennik.guiShowErrorDialog(activity, new AppError(TAG, 379, CODE_OTHER, null, e), R.string.error_occured); + // TODO show error in EventManualDialog + //app.apiEdziennik.guiShowErrorDialog(activity, new AppError(TAG, 379, CODE_OTHER, null, e), R.string.error_occured); }); } }); diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginActivity.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginActivity.java index 6b8e5ac1..f8ec0a4d 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginActivity.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginActivity.java @@ -15,8 +15,9 @@ import java.util.List; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.data.api.AppError; +import pl.szczodrzynski.edziennik.api.v2.models.ApiError; import pl.szczodrzynski.edziennik.databinding.ActivityLoginBinding; +import pl.szczodrzynski.edziennik.ui.dialogs.error.ErrorSnackbar; public class LoginActivity extends AppCompatActivity { @@ -26,7 +27,8 @@ public class LoginActivity extends AppCompatActivity { public static final int RESULT_OK = 1; public static NavOptions navOptions; - static AppError error = null; + static ApiError error = null; + ErrorSnackbar errorSnackbar = new ErrorSnackbar(this); static List profileObjects; public static boolean firstCompleted = false; // if a profile is already added during *this* login. This means that LoginChooser has to navigateUp onBackPressed. Else, finish the activity. @@ -69,6 +71,8 @@ public class LoginActivity extends AppCompatActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + setTheme(R.style.AppTheme_Light); + firstCompleted = false; profileObjects = new ArrayList<>(); error = null; @@ -83,6 +87,8 @@ public class LoginActivity extends AppCompatActivity { b = DataBindingUtil.inflate(getLayoutInflater(), R.layout.activity_login, null, false); setContentView(b.getRoot()); + errorSnackbar.setCoordinator(b.coordinator, null); + app = (App) getApplication(); if (!app.appConfig.loginFinished) { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginIuczniowieFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginIuczniowieFragment.java index e1eb8091..4f65ff42 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginIuczniowieFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginIuczniowieFragment.java @@ -1,25 +1,23 @@ package pl.szczodrzynski.edziennik.ui.modules.login; import android.os.Bundle; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.databinding.DataBindingUtil; -import androidx.fragment.app.Fragment; - import android.text.Editable; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import com.danimahardhika.cafebar.CafeBar; - +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.databinding.DataBindingUtil; +import androidx.fragment.app.Fragment; import androidx.navigation.NavController; import androidx.navigation.Navigation; + import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.data.api.AppError; +import pl.szczodrzynski.edziennik.api.v2.models.ApiError; import pl.szczodrzynski.edziennik.databinding.FragmentLoginIuczniowieBinding; +import pl.szczodrzynski.edziennik.ui.dialogs.error.ErrorSnackbar; import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_INVALID_LOGIN; import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_INVALID_SCHOOL_NAME; @@ -31,6 +29,7 @@ public class LoginIuczniowieFragment extends Fragment { private NavController nav; private FragmentLoginIuczniowieBinding b; private static final String TAG = "LoginIuczniowie"; + private ErrorSnackbar errorSnackbar; public LoginIuczniowieFragment() { } @@ -40,6 +39,7 @@ public class LoginIuczniowieFragment extends Fragment { if (getActivity() != null) { app = (App) getActivity().getApplicationContext(); nav = Navigation.findNavController(getActivity(), R.id.nav_host_fragment); + errorSnackbar = ((LoginActivity) getActivity()).errorSnackbar; } else { return null; @@ -54,31 +54,17 @@ public class LoginIuczniowieFragment extends Fragment { assert getActivity() != null; view.postDelayed(() -> { - AppError error = LoginActivity.error; + ApiError error = LoginActivity.error; if (error != null) { - switch (error.errorCode) { + switch (error.getErrorCode()) { case CODE_INVALID_SCHOOL_NAME: b.loginSchoolNameLayout.setError(getString(R.string.login_error_incorrect_school_name)); break; case CODE_INVALID_LOGIN: b.loginPasswordLayout.setError(getString(R.string.login_error_incorrect_login_or_password)); break; - default: - CafeBar.builder(getActivity()) - .to(b.root) - .content(getString(R.string.login_error, error.asReadableString(getActivity()))) - .autoDismiss(false) - .positiveText(R.string.ok) - .onPositive(CafeBar::dismiss) - .floating(true) - .swipeToDismiss(true) - .neutralText(R.string.more) - .onNeutral(cafeBar -> app.apiEdziennik.guiShowErrorDialog(getActivity(), error, R.string.error_details)) - .negativeText(R.string.report) - .onNegative((cafeBar -> app.apiEdziennik.guiReportError(getActivity(), error, null))) - .show(); - break; } + errorSnackbar.addError(error).show(); LoginActivity.error = null; } }, 100); diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginLibrusFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginLibrusFragment.java index fb0612fd..f865483c 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginLibrusFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginLibrusFragment.java @@ -1,28 +1,26 @@ package pl.szczodrzynski.edziennik.ui.modules.login; import android.os.Bundle; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.databinding.DataBindingUtil; -import androidx.fragment.app.Fragment; - import android.text.Editable; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import com.danimahardhika.cafebar.CafeBar; - +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.databinding.DataBindingUtil; +import androidx.fragment.app.Fragment; import androidx.navigation.NavController; import androidx.navigation.Navigation; + import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.data.api.AppError; +import pl.szczodrzynski.edziennik.api.v2.models.ApiError; import pl.szczodrzynski.edziennik.databinding.FragmentLoginLibrusBinding; +import pl.szczodrzynski.edziennik.ui.dialogs.error.ErrorSnackbar; -import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_INVALID_LOGIN; -import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_LIBRUS_NOT_ACTIVATED; +import static pl.szczodrzynski.edziennik.api.v2.ErrorsKt.ERROR_LOGIN_DATA_INVALID; +import static pl.szczodrzynski.edziennik.api.v2.ErrorsKt.ERROR_LOGIN_LIBRUS_PORTAL_NOT_ACTIVATED; import static pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore.LOGIN_TYPE_LIBRUS; public class LoginLibrusFragment extends Fragment { @@ -31,6 +29,7 @@ public class LoginLibrusFragment extends Fragment { private NavController nav; private FragmentLoginLibrusBinding b; private static final String TAG = "LoginLibrus"; + private ErrorSnackbar errorSnackbar; public LoginLibrusFragment() { } @@ -40,6 +39,7 @@ public class LoginLibrusFragment extends Fragment { if (getActivity() != null) { app = (App) getActivity().getApplicationContext(); nav = Navigation.findNavController(getActivity(), R.id.nav_host_fragment); + errorSnackbar = ((LoginActivity) getActivity()).errorSnackbar; } else { return null; @@ -54,32 +54,17 @@ public class LoginLibrusFragment extends Fragment { assert getActivity() != null; view.postDelayed(() -> { - AppError error = LoginActivity.error; + ApiError error = LoginActivity.error; if (error != null) { - switch (error.errorCode) { - case CODE_INVALID_LOGIN: + switch (error.getErrorCode()) { + case ERROR_LOGIN_DATA_INVALID: b.loginPasswordLayout.setError(getString(R.string.login_error_incorrect_login_or_password)); break; - case CODE_LIBRUS_NOT_ACTIVATED: + case ERROR_LOGIN_LIBRUS_PORTAL_NOT_ACTIVATED: b.loginEmailLayout.setError(getString(R.string.login_error_account_not_activated)); break; - default: - CafeBar.builder(getActivity()) - .to(b.root) - .content(getString(R.string.login_error, error.asReadableString(getActivity()))) - .duration(10000) - .autoDismiss(false) - .positiveText(R.string.ok) - .onPositive(CafeBar::dismiss) - .floating(true) - .swipeToDismiss(true) - .neutralText(R.string.more) - .onNeutral(cafeBar -> app.apiEdziennik.guiShowErrorDialog(getActivity(), error, R.string.error_details)) - .negativeText(R.string.report) - .onNegative((cafeBar -> app.apiEdziennik.guiReportError(getActivity(), error, null))) - .show(); - break; } + errorSnackbar.addError(error).show(); LoginActivity.error = null; } }, 100); diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginMobidziennikFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginMobidziennikFragment.java index 0c4c5f33..fbaf952a 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginMobidziennikFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginMobidziennikFragment.java @@ -1,23 +1,23 @@ package pl.szczodrzynski.edziennik.ui.modules.login; -import androidx.databinding.DataBindingUtil; import android.os.Bundle; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.fragment.app.Fragment; import android.text.Editable; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import com.danimahardhika.cafebar.CafeBar; - +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.databinding.DataBindingUtil; +import androidx.fragment.app.Fragment; import androidx.navigation.NavController; import androidx.navigation.Navigation; + import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.data.api.AppError; +import pl.szczodrzynski.edziennik.api.v2.models.ApiError; import pl.szczodrzynski.edziennik.databinding.FragmentLoginMobidziennikBinding; +import pl.szczodrzynski.edziennik.ui.dialogs.error.ErrorSnackbar; import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_ARCHIVED; import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_INVALID_LOGIN; @@ -31,6 +31,7 @@ public class LoginMobidziennikFragment extends Fragment { private NavController nav; private FragmentLoginMobidziennikBinding b; private static final String TAG = "LoginMobidziennik"; + private ErrorSnackbar errorSnackbar; public LoginMobidziennikFragment() { } @@ -40,6 +41,7 @@ public class LoginMobidziennikFragment extends Fragment { if (getActivity() != null) { app = (App) getActivity().getApplicationContext(); nav = Navigation.findNavController(getActivity(), R.id.nav_host_fragment); + errorSnackbar = ((LoginActivity) getActivity()).errorSnackbar; } else { return null; @@ -54,9 +56,9 @@ public class LoginMobidziennikFragment extends Fragment { assert getActivity() != null; view.postDelayed(() -> { - AppError error = LoginActivity.error; + ApiError error = LoginActivity.error; if (error != null) { - switch (error.errorCode) { + switch (error.getErrorCode()) { case CODE_INVALID_LOGIN: b.loginPasswordLayout.setError(getString(R.string.login_error_incorrect_login_or_password)); break; @@ -69,22 +71,8 @@ public class LoginMobidziennikFragment extends Fragment { case CODE_INVALID_SERVER_ADDRESS: b.loginServerAddressLayout.setError(getString(R.string.login_error_incorrect_address)); break; - default: - CafeBar.builder(getActivity()) - .to(b.root) - .content(getString(R.string.login_error, error.asReadableString(getActivity()))) - .autoDismiss(false) - .positiveText(R.string.ok) - .onPositive(CafeBar::dismiss) - .floating(true) - .swipeToDismiss(true) - .neutralText(R.string.more) - .onNeutral(cafeBar -> app.apiEdziennik.guiShowErrorDialog(getActivity(), error, R.string.error_details)) - .negativeText(R.string.report) - .onNegative((cafeBar -> app.apiEdziennik.guiReportError(getActivity(), error, null))) - .show(); - break; } + errorSnackbar.addError(error).show(); LoginActivity.error = null; } }, 100); diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginProgressFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginProgressFragment.java index bce2a0be..e229d151 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginProgressFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginProgressFragment.java @@ -23,11 +23,11 @@ import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.api.v2.events.ApiTaskErrorEvent; import pl.szczodrzynski.edziennik.api.v2.events.FirstLoginFinishedEvent; import pl.szczodrzynski.edziennik.api.v2.events.task.EdziennikTask; -import pl.szczodrzynski.edziennik.data.api.AppError; +import pl.szczodrzynski.edziennik.api.v2.models.ApiError; import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore; import pl.szczodrzynski.edziennik.databinding.FragmentLoginProgressBinding; -import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_OTHER; +import static pl.szczodrzynski.edziennik.api.v2.ErrorsKt.LOGIN_NO_ARGUMENTS; public class LoginProgressFragment extends Fragment { @@ -62,7 +62,7 @@ public class LoginProgressFragment extends Fragment { @Subscribe(threadMode = ThreadMode.MAIN) public void onSyncErrorEvent(ApiTaskErrorEvent event) { - LoginActivity.error = event.getError().toAppError(); + LoginActivity.error = event.getError(); if (getActivity() == null) return; nav.navigateUp(); @@ -79,7 +79,7 @@ public class LoginProgressFragment extends Fragment { LoginActivity.error = null; if (args == null) { - LoginActivity.error = new AppError(TAG, 72, CODE_OTHER, getString(R.string.login_error_no_arguments)); + LoginActivity.error = new ApiError(TAG, LOGIN_NO_ARGUMENTS); nav.navigateUp(); return; } diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginSyncErrorFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginSyncErrorFragment.java index 951c53e8..52ff1a0f 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginSyncErrorFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginSyncErrorFragment.java @@ -1,6 +1,9 @@ package pl.szczodrzynski.edziennik.ui.modules.login; import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -8,14 +11,11 @@ import androidx.databinding.DataBindingUtil; import androidx.fragment.app.Fragment; import androidx.navigation.NavController; import androidx.navigation.Navigation; + import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.databinding.FragmentLoginSyncErrorBinding; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; - public class LoginSyncErrorFragment extends Fragment { private App app; @@ -44,10 +44,10 @@ public class LoginSyncErrorFragment extends Fragment { assert getContext() != null; assert getActivity() != null; - b.errorDetails.setText(LoginActivity.error == null ? "" : LoginActivity.error.asReadableString(getActivity())); + b.errorDetails.setText(LoginActivity.error == null ? "" : LoginActivity.error.getStringReason(getActivity())); b.reportButton.setOnClickListener((v -> { - app.apiEdziennik.guiReportError(getActivity(), LoginActivity.error, null); + // TODO error report activity open here app.apiEdziennik.guiReportError(getActivity(), LoginActivity.error, null); })); b.nextButton.setOnClickListener((v -> { diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginSyncFragment.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginSyncFragment.kt index 696505e7..16a198b2 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginSyncFragment.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginSyncFragment.kt @@ -65,7 +65,7 @@ class LoginSyncFragment : Fragment() { @Subscribe(threadMode = ThreadMode.MAIN) fun onSyncErrorEvent(event: ApiTaskErrorEvent) { - LoginActivity.error = event.error.toAppError() + LoginActivity.error = event.error nav.navigate(R.id.loginSyncErrorFragment, null, LoginActivity.navOptions) } diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginVulcanFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginVulcanFragment.java index 7b65eead..9c81cdc2 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginVulcanFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginVulcanFragment.java @@ -3,27 +3,24 @@ package pl.szczodrzynski.edziennik.ui.modules.login; import android.content.Intent; import android.graphics.Color; import android.os.Bundle; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.databinding.DataBindingUtil; -import androidx.fragment.app.Fragment; - import android.text.Editable; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.WindowManager; -import com.danimahardhika.cafebar.CafeBar; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.databinding.DataBindingUtil; +import androidx.fragment.app.Fragment; +import androidx.navigation.NavController; +import androidx.navigation.Navigation; + import com.mikepenz.iconics.IconicsColor; import com.mikepenz.iconics.IconicsDrawable; import com.mikepenz.iconics.IconicsSize; import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial; -import androidx.navigation.NavController; -import androidx.navigation.Navigation; - import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import java.util.regex.Matcher; @@ -36,9 +33,10 @@ import javax.crypto.ShortBufferException; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.ui.modules.webpush.QrScannerActivity; -import pl.szczodrzynski.edziennik.data.api.AppError; +import pl.szczodrzynski.edziennik.api.v2.models.ApiError; import pl.szczodrzynski.edziennik.databinding.FragmentLoginVulcanBinding; +import pl.szczodrzynski.edziennik.ui.dialogs.error.ErrorSnackbar; +import pl.szczodrzynski.edziennik.ui.modules.webpush.QrScannerActivity; import pl.szczodrzynski.edziennik.utils.Utils; import static pl.szczodrzynski.edziennik.data.api.AppError.CODE_EXPIRED_TOKEN; @@ -53,6 +51,7 @@ public class LoginVulcanFragment extends Fragment { private NavController nav; private FragmentLoginVulcanBinding b; private static final String TAG = "LoginVulcan"; + private ErrorSnackbar errorSnackbar; public LoginVulcanFragment() { } @@ -62,6 +61,7 @@ public class LoginVulcanFragment extends Fragment { if (getActivity() != null) { app = (App) getActivity().getApplicationContext(); nav = Navigation.findNavController(getActivity(), R.id.nav_host_fragment); + errorSnackbar = ((LoginActivity) getActivity()).errorSnackbar; } else { return null; @@ -76,9 +76,9 @@ public class LoginVulcanFragment extends Fragment { assert getActivity() != null; view.postDelayed(() -> { - AppError error = LoginActivity.error; + ApiError error = LoginActivity.error; if (error != null) { - switch (error.errorCode) { + switch (error.getErrorCode()) { case CODE_INVALID_TOKEN: b.loginTokenLayout.setError(getString(R.string.login_error_incorrect_token)); break; @@ -89,28 +89,14 @@ public class LoginVulcanFragment extends Fragment { b.loginSymbolLayout.setError(getString(R.string.login_error_incorrect_symbol)); break; case CODE_INVALID_PIN: - if (!"?".equals(error.errorText)) { + /*if (!"?".equals(error.errorText)) { b.loginPinLayout.setError(getString(R.string.login_error_incorrect_pin_format, error.errorText)); break; - } + }*/ b.loginPinLayout.setError(getString(R.string.login_error_incorrect_pin)); break; - default: - CafeBar.builder(getActivity()) - .to(b.root) - .content(getString(R.string.login_error, error.asReadableString(getActivity()))) - .autoDismiss(false) - .positiveText(R.string.ok) - .onPositive(CafeBar::dismiss) - .floating(true) - .swipeToDismiss(true) - .neutralText(R.string.more) - .onNeutral(cafeBar -> app.apiEdziennik.guiShowErrorDialog(getActivity(), error, R.string.error_details)) - .negativeText(R.string.report) - .onNegative((cafeBar -> app.apiEdziennik.guiReportError(getActivity(), error, null))) - .show(); - break; } + errorSnackbar.addError(error).show(); LoginActivity.error = null; } }, 100); diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesComposeActivity.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesComposeActivity.java index ff22e48e..18153386 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesComposeActivity.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesComposeActivity.java @@ -4,7 +4,6 @@ import android.content.Context; import android.graphics.Color; import android.graphics.drawable.BitmapDrawable; import android.os.Bundle; -import android.os.Handler; import android.util.Log; import android.view.Menu; import android.view.MotionEvent; @@ -13,7 +12,6 @@ import android.widget.Toast; import androidx.annotation.NonNull; import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.AppCompatActivity; -import androidx.appcompat.widget.Toolbar; import androidx.databinding.DataBindingUtil; import com.afollestad.materialdialogs.MaterialDialog; @@ -35,12 +33,6 @@ import java.util.List; import pl.szczodrzynski.edziennik.App; import pl.szczodrzynski.edziennik.R; -import pl.szczodrzynski.edziennik.data.api.AppError; -import pl.szczodrzynski.edziennik.data.api.Edziennik; -import pl.szczodrzynski.edziennik.data.api.interfaces.SyncCallback; -import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore; -import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile; -import pl.szczodrzynski.edziennik.data.db.modules.profiles.ProfileFull; import pl.szczodrzynski.edziennik.data.db.modules.teachers.Teacher; import pl.szczodrzynski.edziennik.databinding.ActivityComposeMessageBinding; import pl.szczodrzynski.edziennik.utils.Colors; @@ -63,7 +55,7 @@ public class MessagesComposeActivity extends AppCompatActivity { b = DataBindingUtil.inflate(getLayoutInflater(), R.layout.activity_compose_message, null, false); setContentView(b.getRoot()); - composeInfo = Edziennik.getApi(app, app.profile.getLoginStoreType()).getComposeInfo(app.profile); + /*composeInfo = Edziennik.getApi(app, app.profile.getLoginStoreType()).getComposeInfo(app.profile); Toolbar toolbar = b.toolbar; setSupportActionBar(toolbar); @@ -99,7 +91,7 @@ public class MessagesComposeActivity extends AppCompatActivity { MessagesComposeSuggestionAdapter adapter = new MessagesComposeSuggestionAdapter(this, teachers); //ArrayAdapter adapter = new ArrayAdapter<>(this, android.R.layout.simple_dropdown_item_1line, teachers); b.nachoTextView.setAdapter(adapter); - }); + });*/ /*app.db.teacherDao().getAllTeachers(App.profileId).observe(this, teachers -> { });*/ diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesDetailsFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesDetailsFragment.java index 645b66d3..2bf92359 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesDetailsFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessagesDetailsFragment.java @@ -1,17 +1,12 @@ package pl.szczodrzynski.edziennik.ui.modules.messages; -import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.media.ThumbnailUtils; import android.net.Uri; -import android.os.AsyncTask; import android.os.Bundle; import android.os.Environment; -import android.os.Handler; -import android.text.Html; -import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -19,12 +14,18 @@ import android.widget.FrameLayout; import android.widget.ProgressBar; import android.widget.Toast; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.core.graphics.drawable.RoundedBitmapDrawable; +import androidx.core.graphics.drawable.RoundedBitmapDrawableFactory; +import androidx.databinding.DataBindingUtil; +import androidx.fragment.app.Fragment; + import com.afollestad.materialdialogs.MaterialDialog; import com.google.android.material.chip.Chip; import com.mikepenz.iconics.IconicsColor; import com.mikepenz.iconics.IconicsDrawable; import com.mikepenz.iconics.IconicsSize; -import com.mikepenz.iconics.typeface.IIcon; import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial; import com.theartofdev.edmodo.cropper.CropImage; @@ -39,36 +40,15 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.core.graphics.drawable.RoundedBitmapDrawable; -import androidx.core.graphics.drawable.RoundedBitmapDrawableFactory; -import androidx.databinding.DataBindingUtil; -import androidx.fragment.app.Fragment; - -import im.wangchao.mhttp.Response; -import im.wangchao.mhttp.callback.FileCallbackHandler; import pl.szczodrzynski.edziennik.App; -import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.MainActivity; -import pl.szczodrzynski.edziennik.data.api.Edziennik; -import pl.szczodrzynski.edziennik.data.api.AppError; -import pl.szczodrzynski.edziennik.data.api.interfaces.SyncCallback; -import pl.szczodrzynski.edziennik.databinding.MessagesDetailsBinding; -import pl.szczodrzynski.edziennik.data.db.modules.login.LoginStore; +import pl.szczodrzynski.edziennik.R; import pl.szczodrzynski.edziennik.data.db.modules.messages.MessageFull; -import pl.szczodrzynski.edziennik.data.db.modules.messages.MessageRecipientFull; -import pl.szczodrzynski.edziennik.data.db.modules.profiles.Profile; -import pl.szczodrzynski.edziennik.data.db.modules.profiles.ProfileFull; -import pl.szczodrzynski.edziennik.utils.models.Date; -import pl.szczodrzynski.edziennik.utils.models.Time; -import pl.szczodrzynski.edziennik.utils.Anim; +import pl.szczodrzynski.edziennik.databinding.MessagesDetailsBinding; import pl.szczodrzynski.edziennik.utils.Themes; import pl.szczodrzynski.edziennik.utils.Utils; import static android.app.Activity.RESULT_OK; -import static android.view.Gravity.CENTER_VERTICAL; -import static android.view.Gravity.END; import static pl.szczodrzynski.edziennik.utils.Utils.getResizedBitmap; import static pl.szczodrzynski.edziennik.utils.Utils.getStringFromFile; import static pl.szczodrzynski.edziennik.utils.Utils.readableFileSize; @@ -108,7 +88,7 @@ public class MessagesDetailsFragment extends Fragment { b.messageContent.setVisibility(View.GONE); - if (messageId != -1) { + /*if (messageId != -1) { AsyncTask.execute(() -> { if (app == null || app.profile == null || activity == null || b == null || !isAdded()) return; @@ -286,7 +266,7 @@ public class MessagesDetailsFragment extends Fragment { }); }); - } + }*/ // click to expand subject and sender b.messageSubject.setOnClickListener(v -> { @@ -359,7 +339,7 @@ public class MessagesDetailsFragment extends Fragment { File storageDir = Utils.getStorageDir(); - Edziennik.getApi(app, app.profile.getLoginStoreType()).getAttachment(activity, new SyncCallback() { + /*Edziennik.getApi(app, app.profile.getLoginStoreType()).getAttachment(activity, new SyncCallback() { @Override public void onLoginFirst(List profileList, LoginStore loginStore) { @@ -437,7 +417,7 @@ public class MessagesDetailsFragment extends Fragment { } }) .build() - .enqueue()); + .enqueue());*/ } @Subscribe(threadMode = ThreadMode.POSTING) diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml index f22cb668..d7aaa2ab 100644 --- a/app/src/main/res/layout/activity_login.xml +++ b/app/src/main/res/layout/activity_login.xml @@ -8,16 +8,17 @@ android:orientation="vertical" android:visibility="visible"> - + + - - - + + + + ERROR_REQUEST_FAILURE + ERROR_REQUEST_HTTP_400 + ERROR_REQUEST_HTTP_401 + ERROR_REQUEST_HTTP_403 + ERROR_REQUEST_HTTP_404 + ERROR_REQUEST_HTTP_405 + ERROR_REQUEST_HTTP_410 + ERROR_REQUEST_HTTP_500 + ERROR_RESPONSE_EMPTY + ERROR_LOGIN_DATA_MISSING + ERROR_LOGIN_DATA_INVALID + ERROR_PROFILE_MISSING + ERROR_INVALID_LOGIN_MODE + ERROR_LOGIN_METHOD_NOT_SATISFIED + ERROR_NOT_IMPLEMENTED + + ERROR_NO_STUDENTS_IN_ACCOUNT + + CODE_INTERNAL_LIBRUS_ACCOUNT_410 + CODE_INTERNAL_LIBRUS_SYNERGIA_EXPIRED + ERROR_LOGIN_LIBRUS_API_CAPTCHA_NEEDED + ERROR_LOGIN_LIBRUS_API_CONNECTION_PROBLEMS + ERROR_LOGIN_LIBRUS_API_INVALID_CLIENT + ERROR_LOGIN_LIBRUS_API_REG_ACCEPT_NEEDED + ERROR_LOGIN_LIBRUS_API_CHANGE_PASSWORD_ERROR + ERROR_LOGIN_LIBRUS_API_PASSWORD_CHANGE_REQUIRED + ERROR_LOGIN_LIBRUS_API_INVALID_LOGIN + ERROR_LOGIN_LIBRUS_API_OTHER + ERROR_LOGIN_LIBRUS_PORTAL_CSRF_MISSING + ERROR_LOGIN_LIBRUS_PORTAL_NOT_ACTIVATED + ERROR_LOGIN_LIBRUS_PORTAL_ACTION_ERROR + ERROR_LOGIN_LIBRUS_PORTAL_SYNERGIA_TOKEN_MISSING + ERROR_LIBRUS_API_TOKEN_EXPIRED + ERROR_LIBRUS_API_INSUFFICIENT_SCOPES + ERROR_LIBRUS_API_OTHER + ERROR_LIBRUS_API_ACCESS_DENIED + ERROR_LIBRUS_API_RESOURCE_NOT_FOUND + ERROR_LIBRUS_API_DATA_NOT_FOUND + ERROR_LIBRUS_API_TIMETABLE_NOT_PUBLIC + ERROR_LIBRUS_API_RESOURCE_ACCESS_DENIED + ERROR_LIBRUS_API_INVALID_REQUEST_PARAMS + ERROR_LIBRUS_API_INCORRECT_ENDPOINT + ERROR_LIBRUS_API_LUCKY_NUMBER_NOT_ACTIVE + ERROR_LIBRUS_API_NOTES_NOT_ACTIVE + ERROR_LOGIN_LIBRUS_SYNERGIA_NO_TOKEN + ERROR_LOGIN_LIBRUS_SYNERGIA_TOKEN_INVALID + ERROR_LOGIN_LIBRUS_SYNERGIA_NO_SESSION_ID + ERROR_LIBRUS_MESSAGES_ACCESS_DENIED + ERROR_LIBRUS_SYNERGIA_ACCESS_DENIED + ERROR_LOGIN_LIBRUS_MESSAGES_NO_SESSION_ID + ERROR_LIBRUS_PORTAL_ACCESS_DENIED + ERROR_LIBRUS_PORTAL_API_DISABLED + ERROR_LIBRUS_PORTAL_SYNERGIA_DISCONNECTED + ERROR_LIBRUS_PORTAL_OTHER + ERROR_LIBRUS_PORTAL_SYNERGIA_NOT_FOUND + ERROR_LOGIN_LIBRUS_PORTAL_OTHER + ERROR_LOGIN_LIBRUS_PORTAL_CODE_EXPIRED + ERROR_LOGIN_LIBRUS_PORTAL_CODE_REVOKED + ERROR_LOGIN_LIBRUS_PORTAL_NO_CLIENT_ID + ERROR_LOGIN_LIBRUS_PORTAL_NO_CODE + ERROR_LOGIN_LIBRUS_PORTAL_NO_REFRESH + ERROR_LOGIN_LIBRUS_PORTAL_NO_REDIRECT + ERROR_LOGIN_LIBRUS_PORTAL_UNSUPPORTED_GRANT + ERROR_LOGIN_LIBRUS_PORTAL_INVALID_CLIENT_ID + ERROR_LOGIN_LIBRUS_PORTAL_REFRESH_INVALID + ERROR_LOGIN_LIBRUS_PORTAL_REFRESH_REVOKED + ERROR_LIBRUS_SYNERGIA_OTHER + ERROR_LIBRUS_SYNERGIA_MAINTENANCE + + ERROR_LOGIN_MOBIDZIENNIK_WEB_INVALID_LOGIN + ERROR_LOGIN_MOBIDZIENNIK_WEB_OLD_PASSWORD + ERROR_LOGIN_MOBIDZIENNIK_WEB_INVALID_DEVICE + ERROR_LOGIN_MOBIDZIENNIK_WEB_ARCHIVED + ERROR_LOGIN_MOBIDZIENNIK_WEB_MAINTENANCE + ERROR_LOGIN_MOBIDZIENNIK_WEB_INVALID_ADDRESS + ERROR_LOGIN_MOBIDZIENNIK_WEB_OTHER + ERROR_MOBIDZIENNIK_WEB_ACCESS_DENIED + ERROR_MOBIDZIENNIK_WEB_NO_SESSION_KEY + ERROR_MOBIDZIENNIK_WEB_NO_SESSION_VALUE + ERROR_MOBIDZIENNIK_WEB_NO_SERVER_ID + ERROR_MOBIDZIENNIK_WEB_INVALID_RESPONSE + ERROR_LOGIN_MOBIDZIENNIK_WEB_NO_SESSION_ID + + ERROR_LOGIN_VULCAN_INVALID_SYMBOL + ERROR_LOGIN_VULCAN_INVALID_TOKEN + ERROR_LOGIN_VULCAN_INVALID_PIN + ERROR_LOGIN_VULCAN_INVALID_PIN_0_REMAINING + ERROR_LOGIN_VULCAN_INVALID_PIN_1_REMAINING + ERROR_LOGIN_VULCAN_INVALID_PIN_2_REMAINING + ERROR_LOGIN_VULCAN_EXPIRED_TOKEN + ERROR_LOGIN_VULCAN_OTHER + ERROR_LOGIN_VULCAN_ONLY_KINDERGARTEN + ERROR_LOGIN_VULCAN_NO_PUPILS + ERROR_VULCAN_API_MAINTENANCE + ERROR_VULCAN_API_BAD_REQUEST + ERROR_VULCAN_API_OTHER + + ERROR_LOGIN_IDZIENNIK_WEB_INVALID_LOGIN + ERROR_LOGIN_IDZIENNIK_WEB_INVALID_SCHOOL_NAME + ERROR_LOGIN_IDZIENNIK_WEB_PASSWORD_CHANGE_NEEDED + ERROR_LOGIN_IDZIENNIK_WEB_MAINTENANCE + ERROR_LOGIN_IDZIENNIK_WEB_SERVER_ERROR + ERROR_LOGIN_IDZIENNIK_WEB_OTHER + ERROR_LOGIN_IDZIENNIK_WEB_API_NO_ACCESS + ERROR_LOGIN_IDZIENNIK_WEB_NO_SESSION + ERROR_LOGIN_IDZIENNIK_WEB_NO_AUTH + ERROR_LOGIN_IDZIENNIK_WEB_NO_BEARER + ERROR_IDZIENNIK_WEB_ACCESS_DENIED + ERROR_IDZIENNIK_WEB_OTHER + ERROR_IDZIENNIK_WEB_MAINTENANCE + ERROR_IDZIENNIK_WEB_SERVER_ERROR + ERROR_IDZIENNIK_WEB_PASSWORD_CHANGE_NEEDED + ERROR_LOGIN_IDZIENNIK_FIRST_NO_SCHOOL_YEAR + ERROR_IDZIENNIK_WEB_REQUEST_NO_DATA + ERROR_IDZIENNIK_API_ACCESS_DENIED + ERROR_IDZIENNIK_API_OTHER + + ERROR_TEMPLATE_WEB_OTHER + + EXCEPTION_API_TASK + EXCEPTION_LOGIN_LIBRUS_API_TOKEN + EXCEPTION_LOGIN_LIBRUS_PORTAL_TOKEN + EXCEPTION_LIBRUS_PORTAL_SYNERGIA_TOKEN + EXCEPTION_LIBRUS_API_REQUEST + EXCEPTION_LIBRUS_SYNERGIA_REQUEST + EXCEPTION_MOBIDZIENNIK_WEB_REQUEST + EXCEPTION_VULCAN_API_REQUEST + EXCEPTION_NOTIFY_AND_SYNC + EXCEPTION_LIBRUS_MESSAGES_REQUEST + EXCEPTION_IDZIENNIK_WEB_REQUEST + EXCEPTION_IDZIENNIK_WEB_API_REQUEST + EXCEPTION_IDZIENNIK_API_REQUEST + + LOGIN_NO_ARGUMENTS + + Błąd odpowiedzi serwera + Błąd serwera: nieprawidłowe zapytanie + Błąd serwera: odmowa dostępu + Błąd serwera: dostęp zabroniony + Błąd serwera: plik nie znaleziony + Błąd serwera: nieprawidłowa metoda zapytania + Błąd serwera: odpowiedź niedostępna + Wewnętrzny błąd serwera + Brak odpowiedzi serwera + Dane logowania niekompletne + Nieprawidłowe dane logowania + Profil nie został ustawiony + Nieprawidłowy sposób logowania + Nie można wywołać metody logowania + Nie zaimplementowano + + Brak uczniów przypisanych do konta + + CODE_INTERNAL_LIBRUS_ACCOUNT_410 + CODE_INTERNAL_LIBRUS_SYNERGIA_EXPIRED + Wymagane wypełnienie CAPTCHA + Problem z połączeniem + Nieprawidłowy identyfikator klienta + Wymagana akceptacja regulaminu + Błąd zmiany hasła + Wymagana zmiana hasła + Nieprawidłowe dane logowania + Inny błąd logowania do API + Brak tokenu CSRF + Konto LIBRUS nie zostało aktywowane + Inny błąd logowania do Portalu LIBRUS + Nie znaleziono tokenu Synergia + Token API wygasł + Niewystarczające uprawnienia + Inny błąd API + Odmowa dostępu do API + Nie znaleziono zasobu API + Brak danych + Plan lekcji nie jest publiczny + Brak dostępu do zasobu + Nieprawidłowe parametry + Nieprawidłowy zasób + Szczęśliwy numerek nie jest aktywny + Uwagi nie są publiczne + Brak tokenu logowania Synergia + Nieprawidłowy token logowania Synergia + Brak ID sesji Synergia + Brak dostępu do Wiadomości + Brak dostępu do Synergii + Brak ID sesji Wiadomości + Odmowa dostępu do Portalu Librus + API Portalu Librus wyłączone + Konto Synergia zostało rozłączone + Inny błąd Portalu Librus + Nie znaleziono konta Synergia + Inny błąd logowania do Portalu Librus + ERROR_LOGIN_LIBRUS_PORTAL_CODE_EXPIRED + ERROR_LOGIN_LIBRUS_PORTAL_CODE_REVOKED + ERROR_LOGIN_LIBRUS_PORTAL_NO_CLIENT_ID + ERROR_LOGIN_LIBRUS_PORTAL_NO_CODE + ERROR_LOGIN_LIBRUS_PORTAL_NO_REFRESH + ERROR_LOGIN_LIBRUS_PORTAL_NO_REDIRECT + ERROR_LOGIN_LIBRUS_PORTAL_UNSUPPORTED_GRANT + ERROR_LOGIN_LIBRUS_PORTAL_INVALID_CLIENT_ID + ERROR_LOGIN_LIBRUS_PORTAL_REFRESH_INVALID + ERROR_LOGIN_LIBRUS_PORTAL_REFRESH_REVOKED + ERROR_LIBRUS_SYNERGIA_OTHER + ERROR_LIBRUS_SYNERGIA_MAINTENANCE + + ERROR_LOGIN_MOBIDZIENNIK_WEB_INVALID_LOGIN + ERROR_LOGIN_MOBIDZIENNIK_WEB_OLD_PASSWORD + ERROR_LOGIN_MOBIDZIENNIK_WEB_INVALID_DEVICE + ERROR_LOGIN_MOBIDZIENNIK_WEB_ARCHIVED + ERROR_LOGIN_MOBIDZIENNIK_WEB_MAINTENANCE + ERROR_LOGIN_MOBIDZIENNIK_WEB_INVALID_ADDRESS + ERROR_LOGIN_MOBIDZIENNIK_WEB_OTHER + ERROR_MOBIDZIENNIK_WEB_ACCESS_DENIED + ERROR_MOBIDZIENNIK_WEB_NO_SESSION_KEY + ERROR_MOBIDZIENNIK_WEB_NO_SESSION_VALUE + ERROR_MOBIDZIENNIK_WEB_NO_SERVER_ID + ERROR_MOBIDZIENNIK_WEB_INVALID_RESPONSE + ERROR_LOGIN_MOBIDZIENNIK_WEB_NO_SESSION_ID + + ERROR_LOGIN_VULCAN_INVALID_SYMBOL + ERROR_LOGIN_VULCAN_INVALID_TOKEN + ERROR_LOGIN_VULCAN_INVALID_PIN + ERROR_LOGIN_VULCAN_INVALID_PIN_0_REMAINING + ERROR_LOGIN_VULCAN_INVALID_PIN_1_REMAINING + ERROR_LOGIN_VULCAN_INVALID_PIN_2_REMAINING + ERROR_LOGIN_VULCAN_EXPIRED_TOKEN + ERROR_LOGIN_VULCAN_OTHER + ERROR_LOGIN_VULCAN_ONLY_KINDERGARTEN + ERROR_LOGIN_VULCAN_NO_PUPILS + ERROR_VULCAN_API_MAINTENANCE + ERROR_VULCAN_API_BAD_REQUEST + ERROR_VULCAN_API_OTHER + + ERROR_LOGIN_IDZIENNIK_WEB_INVALID_LOGIN + ERROR_LOGIN_IDZIENNIK_WEB_INVALID_SCHOOL_NAME + ERROR_LOGIN_IDZIENNIK_WEB_PASSWORD_CHANGE_NEEDED + ERROR_LOGIN_IDZIENNIK_WEB_MAINTENANCE + ERROR_LOGIN_IDZIENNIK_WEB_SERVER_ERROR + ERROR_LOGIN_IDZIENNIK_WEB_OTHER + ERROR_LOGIN_IDZIENNIK_WEB_API_NO_ACCESS + ERROR_LOGIN_IDZIENNIK_WEB_NO_SESSION + ERROR_LOGIN_IDZIENNIK_WEB_NO_AUTH + ERROR_LOGIN_IDZIENNIK_WEB_NO_BEARER + ERROR_IDZIENNIK_WEB_ACCESS_DENIED + ERROR_IDZIENNIK_WEB_OTHER + ERROR_IDZIENNIK_WEB_MAINTENANCE + ERROR_IDZIENNIK_WEB_SERVER_ERROR + ERROR_IDZIENNIK_WEB_PASSWORD_CHANGE_NEEDED + ERROR_LOGIN_IDZIENNIK_FIRST_NO_SCHOOL_YEAR + ERROR_IDZIENNIK_WEB_REQUEST_NO_DATA + ERROR_IDZIENNIK_API_ACCESS_DENIED + ERROR_IDZIENNIK_API_OTHER + + ERROR_TEMPLATE_WEB_OTHER + + EXCEPTION_API_TASK + EXCEPTION_LOGIN_LIBRUS_API_TOKEN + EXCEPTION_LOGIN_LIBRUS_PORTAL_TOKEN + EXCEPTION_LIBRUS_PORTAL_SYNERGIA_TOKEN + EXCEPTION_LIBRUS_API_REQUEST + EXCEPTION_LIBRUS_SYNERGIA_REQUEST + EXCEPTION_MOBIDZIENNIK_WEB_REQUEST + EXCEPTION_VULCAN_API_REQUEST + EXCEPTION_NOTIFY_AND_SYNC + EXCEPTION_LIBRUS_MESSAGES_REQUEST + EXCEPTION_IDZIENNIK_WEB_REQUEST + EXCEPTION_IDZIENNIK_WEB_API_REQUEST + EXCEPTION_IDZIENNIK_API_REQUEST + + Nie podano parametrów + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 2e711d11..462eaece 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1023,4 +1023,5 @@ następny %s (%s) Nie ma lekcji tego dnia Profil został usunięty. + Wystąpił błąd