diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/App.kt b/app/src/main/java/pl/szczodrzynski/edziennik/App.kt index 65836b5e..9a2f84d6 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/App.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/App.kt @@ -57,8 +57,8 @@ class App : MultiDexApplication(), Configuration.Provider, CoroutineScope { val profileId get() = profile.id - var devMode = false var debugMode = false + var devMode = false } val notificationChannelsManager by lazy { NotificationChannelsManager(this) } @@ -107,7 +107,7 @@ class App : MultiDexApplication(), Configuration.Provider, CoroutineScope { .readTimeout(30, TimeUnit.SECONDS) builder.installHttpsSupport(this) - if (debugMode || BuildConfig.DEBUG) { + if (devMode || BuildConfig.DEBUG) { HyperLog.initialize(this) HyperLog.setLogLevel(Log.VERBOSE) HyperLog.setLogFormat(DebugLogFormat(this)) @@ -162,7 +162,7 @@ class App : MultiDexApplication(), Configuration.Provider, CoroutineScope { Iconics.registerFont(SzkolnyFont) App.db = AppDb(this) Themes.themeInt = config.ui.theme - debugMode = config.debugMode + devMode = config.debugMode MHttp.instance().customOkHttpClient(http) if (!profileLoadById(config.lastProfileId)) { @@ -173,9 +173,9 @@ class App : MultiDexApplication(), Configuration.Provider, CoroutineScope { setLanguage(it) } - devMode = BuildConfig.DEBUG + debugMode = BuildConfig.DEBUG if (BuildConfig.DEBUG) - debugMode = true + devMode = true Signing.getCert(this) @@ -185,7 +185,7 @@ class App : MultiDexApplication(), Configuration.Provider, CoroutineScope { if (config.devModePassword != null) checkDevModePassword() - debugMode = devMode || config.debugMode + devMode = debugMode || config.debugMode if (config.sync.enabled) SyncWorker.scheduleNext(this@App, false) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt b/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt index 28331a75..0bbc77f7 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/MainActivity.kt @@ -232,7 +232,7 @@ class MainActivity : AppCompatActivity(), CoroutineScope { list += NavTarget(TARGET_MESSAGES_DETAILS, R.string.menu_message, MessageFragment::class).withPopTo(DRAWER_ITEM_MESSAGES) list += NavTarget(TARGET_MESSAGES_COMPOSE, R.string.menu_message_compose, MessagesComposeFragment::class) list += NavTarget(TARGET_WEB_PUSH, R.string.menu_web_push, WebPushFragment::class) - if (App.debugMode) { + if (App.devMode) { list += NavTarget(DRAWER_ITEM_DEBUG, R.string.menu_debug, DebugFragment::class) list += NavTarget(TARGET_LAB, R.string.menu_lab, LabFragment::class) .withIcon(CommunityMaterial.Icon.cmd_flask_outline) @@ -566,7 +566,7 @@ class MainActivity : AppCompatActivity(), CoroutineScope { .withIcon(CommunityMaterial.Icon2.cmd_help_circle_outline) .withOnClickListener(View.OnClickListener { loadTarget(TARGET_FEEDBACK) }) ) - if (App.debugMode) { + if (App.devMode) { bottomSheet += BottomSheetPrimaryItem(false) .withTitle(R.string.menu_debug) .withIcon(CommunityMaterial.Icon.cmd_android_studio) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/vulcan/login/VulcanLoginWebMain.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/vulcan/login/VulcanLoginWebMain.kt index 467beea3..896f64e8 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/vulcan/login/VulcanLoginWebMain.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/vulcan/login/VulcanLoginWebMain.kt @@ -89,7 +89,7 @@ class VulcanLoginWebMain(val data: DataVulcan, val onSuccess: () -> Unit) { return true } - val fsLogin = FSLogin(data.app.http, debug = App.debugMode) + val fsLogin = FSLogin(data.app.http, debug = App.devMode) fsLogin.performLogin( realm = realm, username = data.webUsername ?: data.webEmail ?: return false, diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/models/Data.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/models/Data.kt index 6bd9aa83..8dda9543 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/models/Data.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/models/Data.kt @@ -136,7 +136,7 @@ abstract class Data(val app: App, val profile: Profile?, val loginStore: LoginSt val db: AppDb by lazy { app.db } init { - if (App.devMode) { + if (App.debugMode) { fakeLogin = loginStore.hasLoginData("fakeLogin") } clear() diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventDetailsDialog.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventDetailsDialog.kt index b1683ac5..b41da04b 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventDetailsDialog.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/event/EventDetailsDialog.kt @@ -193,7 +193,7 @@ class EventDetailsDialog( b.goToTimetableButton.attachToastHint(R.string.hint_go_to_timetable) // RE-DOWNLOAD - b.downloadButton.isVisible = App.debugMode + b.downloadButton.isVisible = App.devMode b.downloadButton.onClick { EdziennikTask.eventGet(event.profileId, event).enqueue(activity) } diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/grade/GradeDetailsDialog.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/grade/GradeDetailsDialog.kt index 20f3ad21..4877413f 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/grade/GradeDetailsDialog.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/grade/GradeDetailsDialog.kt @@ -57,7 +57,7 @@ class GradeDetailsDialog( b.grade = grade b.weightText = manager.getWeightString(app, grade) b.commentVisible = false - b.devMode = App.debugMode + b.devMode = App.devMode b.gradeName.setTextColor(if (ColorUtils.calculateLuminance(gradeColor) > 0.3) 0xaa000000.toInt() else 0xccffffff.toInt()) b.gradeName.background.setTintColor(gradeColor) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/timetable/LessonDetailsDialog.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/timetable/LessonDetailsDialog.kt index 6dc6edb6..5896def0 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/timetable/LessonDetailsDialog.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/dialogs/timetable/LessonDetailsDialog.kt @@ -78,7 +78,7 @@ class LessonDetailsDialog( ) } - if (App.debugMode) + if (App.devMode) b.lessonId.visibility = View.VISIBLE update() diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/AttendanceDetailsDialog.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/AttendanceDetailsDialog.kt index ce49efbd..9e6c14d6 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/AttendanceDetailsDialog.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/attendance/AttendanceDetailsDialog.kt @@ -55,7 +55,7 @@ class AttendanceDetailsDialog( val attendanceColor = manager.getAttendanceColor(attendance) b.attendance = attendance - b.devMode = App.debugMode + b.devMode = App.devMode b.attendanceName.setTextColor(if (ColorUtils.calculateLuminance(attendanceColor) > 0.3) 0xaa000000.toInt() else 0xccffffff.toInt()) b.attendanceName.background.setTintColor(attendanceColor) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/error/ErrorDetailsDialog.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/error/ErrorDetailsDialog.kt index 36a64a3e..32ec46b9 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/error/ErrorDetailsDialog.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/error/ErrorDetailsDialog.kt @@ -45,7 +45,7 @@ class ErrorDetailsDialog( listOf( it.getStringReason(activity).asBoldSpannable().asColoredSpannable(R.attr.colorOnBackground.resolveAttr(activity)), activity.getString(R.string.error_unknown_format, it.errorCode, it.tag), - if (App.debugMode) + if (App.devMode) it.throwable?.stackTraceString ?: it.throwable?.localizedMessage else it.throwable?.localizedMessage diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginFormFragment.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginFormFragment.kt index d0676105..7a5410fa 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginFormFragment.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/login/LoginFormFragment.kt @@ -127,7 +127,7 @@ class LoginFormFragment : Fragment(), CoroutineScope { "loginMode" to loginMode ) - if (App.devMode && b.fakeLogin.isChecked) { + if (App.debugMode && b.fakeLogin.isChecked) { payload.putBoolean("fakeLogin", true) } diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessageFragment.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessageFragment.kt index e8a4e343..b2623b64 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessageFragment.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/messages/MessageFragment.kt @@ -108,7 +108,7 @@ class MessageFragment : Fragment(), CoroutineScope { .setNegativeButton(R.string.cancel, null) .show() } - b.downloadButton.isVisible = App.debugMode + b.downloadButton.isVisible = App.devMode b.downloadButton.onClick { EdziennikTask.messageGet(App.profileId, message).enqueue(activity) } diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/SettingsNewFragment.java b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/SettingsNewFragment.java index 534c6b0d..551efd01 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/SettingsNewFragment.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/SettingsNewFragment.java @@ -581,7 +581,7 @@ public class SettingsNewFragment extends MaterialAboutFragment { syncCardIntervalItem.setChecked(app.getConfig().getSync().getEnabled()); syncCardIntervalItem.setOnClickAction(() -> { List intervalNames = new ArrayList<>(); - if (App.Companion.getDevMode() && false) { + if (App.Companion.getDebugMode() && false) { intervalNames.add(ExtensionsKt.plural(activity, R.plurals.time_till_seconds, 30)); intervalNames.add(ExtensionsKt.plural(activity, R.plurals.time_till_minutes, 2)); } @@ -593,7 +593,7 @@ public class SettingsNewFragment extends MaterialAboutFragment { intervalNames.add(ExtensionsKt.plural(activity, R.plurals.time_till_hours, 3)); intervalNames.add(ExtensionsKt.plural(activity, R.plurals.time_till_hours, 4)); List intervals = new ArrayList<>(); - if (App.Companion.getDevMode() && false) { + if (App.Companion.getDebugMode() && false) { intervals.add(30); intervals.add(2 * 60); } @@ -1263,7 +1263,7 @@ public class SettingsNewFragment extends MaterialAboutFragment { }) .build());*/ - if (App.Companion.getDebugMode()) { + if (App.Companion.getDevMode()) { items.add(new MaterialAboutActionItem.Builder() .text(R.string.settings_about_crash_text) .subText(R.string.settings_about_crash_subtext) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/utils/Utils.java b/app/src/main/java/pl/szczodrzynski/edziennik/utils/Utils.java index 082d800d..910fc6f0 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/utils/Utils.java +++ b/app/src/main/java/pl/szczodrzynski/edziennik/utils/Utils.java @@ -108,7 +108,7 @@ public class Utils { public static List debugLog = new ArrayList<>(); public static void d(String TAG, String message) { - if (App.Companion.getDebugMode()) { + if (App.Companion.getDevMode()) { HyperLog.d("Szkolny/"+TAG, message); //debugLog.add(TAG+": "+message); }