From 8b0f3490e39edabf7abdcb70214737cacb7a3a40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Sun, 4 Apr 2021 22:41:12 +0200 Subject: [PATCH] [UI/Settings] Fix hiding hiding sticks from old without devMode. --- .../settings/cards/SettingsRegisterCard.kt | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/cards/SettingsRegisterCard.kt b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/cards/SettingsRegisterCard.kt index 14afd0cb..36239083 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/cards/SettingsRegisterCard.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/ui/modules/settings/cards/SettingsRegisterCard.kt @@ -7,6 +7,7 @@ package pl.szczodrzynski.edziennik.ui.modules.settings.cards import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial import eu.szkolny.font.SzkolnyFont +import pl.szczodrzynski.edziennik.App import pl.szczodrzynski.edziennik.R import pl.szczodrzynski.edziennik.after import pl.szczodrzynski.edziennik.data.api.LOGIN_TYPE_LIBRUS @@ -141,12 +142,15 @@ class SettingsRegisterCard(util: SettingsUtil) : SettingsCard(util) { else null, - util.createPropertyItem( - text = R.string.settings_register_hide_sticks_from_old, - icon = CommunityMaterial.Icon3.cmd_numeric_1_box_outline, - value = configProfile.grades.hideSticksFromOld - ) { _, it -> - configProfile.grades.hideSticksFromOld = it - } + if (App.devMode) + util.createPropertyItem( + text = R.string.settings_register_hide_sticks_from_old, + icon = CommunityMaterial.Icon3.cmd_numeric_1_box_outline, + value = configProfile.grades.hideSticksFromOld + ) { _, it -> + configProfile.grades.hideSticksFromOld = it + } + else + null ) }