From d17614fa642c6ca63c1b2b714a1c21c54da9dbe9 Mon Sep 17 00:00:00 2001 From: sadorowo Date: Thu, 21 Mar 2024 20:17:05 +0100 Subject: [PATCH] add: new settings fragment + basic functionality --- .../repositories/PreferencesRepository.kt | 37 +++- .../ui/modules/dashboard/DashboardItem.kt | 11 ++ .../wulkanowy/ui/modules/more/MoreFragment.kt | 89 ---------- .../ui/modules/more/MorePresenter.kt | 30 +--- .../wulkanowy/ui/modules/more/MoreView.kt | 3 - .../mod_settings/ModSettingsFragment.kt | 165 ++++++++++++++++++ .../mod_settings/ModSettingsPresenter.kt | 39 +++++ .../settings/mod_settings/ModSettingsView.kt | 10 ++ app/src/main/res/values-cs/mod_values.xml | 6 +- app/src/main/res/values-da-rDK/mod_values.xml | 6 +- app/src/main/res/values-de/mod_values.xml | 6 +- app/src/main/res/values-es-rES/mod_values.xml | 6 +- app/src/main/res/values-it-rIT/mod_values.xml | 6 +- app/src/main/res/values-pl/mod_values.xml | 6 +- app/src/main/res/values-ru/mod_values.xml | 6 +- app/src/main/res/values-sk/mod_values.xml | 6 +- app/src/main/res/values-uk/mod_values.xml | 6 +- app/src/main/res/values/mod_values.xml | 38 +++- app/src/main/res/xml/scheme_preferences.xml | 5 + .../xml/scheme_preferences_mod_settings.xml | 65 +++++++ app/src/play/res/xml/scheme_preferences.xml | 5 + 21 files changed, 391 insertions(+), 160 deletions(-) create mode 100644 app/src/main/java/io/github/wulkanowy/ui/modules/settings/mod_settings/ModSettingsFragment.kt create mode 100644 app/src/main/java/io/github/wulkanowy/ui/modules/settings/mod_settings/ModSettingsPresenter.kt create mode 100644 app/src/main/java/io/github/wulkanowy/ui/modules/settings/mod_settings/ModSettingsView.kt create mode 100644 app/src/main/res/xml/scheme_preferences_mod_settings.xml diff --git a/app/src/main/java/io/github/wulkanowy/data/repositories/PreferencesRepository.kt b/app/src/main/java/io/github/wulkanowy/data/repositories/PreferencesRepository.kt index 8707c54a..91b2b7f4 100644 --- a/app/src/main/java/io/github/wulkanowy/data/repositories/PreferencesRepository.kt +++ b/app/src/main/java/io/github/wulkanowy/data/repositories/PreferencesRepository.kt @@ -9,6 +9,7 @@ import androidx.core.content.edit import com.fredporciuncula.flow.preferences.FlowSharedPreferences import com.fredporciuncula.flow.preferences.Preference import com.fredporciuncula.flow.preferences.Serializer +import com.fredporciuncula.flow.preferences.map import dagger.hilt.android.qualifiers.ApplicationContext import io.github.wulkanowy.R import io.github.wulkanowy.data.enums.AppTheme @@ -308,16 +309,20 @@ class PreferencesRepository @Inject constructor( } var attendancePercentage: Float? - get() { - val value = attendancePercentagePreference.get() - return if (value == context.resources.getInteger(R.integer.pref_default_attendance_percentage).toFloat()) { - null - } else { - value - } + get() = getString( + R.string.pref_key_attendance_percentage, + R.string.pref_default_attendance_percentage + ).let { if (it.isNullOrEmpty()) null else it.toFloat() } + set(value) = sharedPref.edit { + putString( + context.getString(R.string.pref_key_attendance_percentage), + value?.toString() ?: "-1" + ) } - set(value) = value?.let { attendancePercentagePreference.set(it) } - ?: attendancePercentagePreference.delete() + + var hiddenAttendanceItems: List + get() = hiddenAttendanceItemsPreference.get().toList() + set(value) = hiddenAttendanceItemsPreference.set(value.toSet()) var hiddenGrades: List get() = hiddenGradesPreference.get().toList() @@ -331,6 +336,20 @@ class PreferencesRepository @Inject constructor( return flowSharedPref.getStringSet(prefKey, defaultSet) } + private val hiddenAttendanceItemsPreference: Preference> + get() { + val defaultSet = + context.resources.getStringArray(R.array.pref_default_hidden_attendance_items).toSet() + val prefKey = "hidden_attendance_items" + + return flowSharedPref + .getStringSet(prefKey, defaultSet) + .map( + mapper = { it -> it.map { DashboardItem.HiddenAttendanceTile.valueOf(it) }.toSet() }, + reverse = { it -> it.map { it.name }.toSet() } + ) + } + private val selectedDashboardTilesPreference: Preference> get() { val defaultSet = diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/dashboard/DashboardItem.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/dashboard/DashboardItem.kt index 6a05b105..45e11ad4 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/dashboard/DashboardItem.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/dashboard/DashboardItem.kt @@ -153,6 +153,17 @@ sealed class DashboardItem(val type: Type) { NOTES, ATTENDANCE, } + + enum class HiddenAttendanceTile { + UNEXCUSED_ABSENCE, + EXEMPTION, + EXCUSED_LATENESS, + UNEXCUSED_LATENESS, + PRESENT, + DELETED, + EXCUSED_ABSENCE, + UNKNOWN, + } } fun DashboardItem.Tile.toDashboardItemType() = when (this) { diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/more/MoreFragment.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/more/MoreFragment.kt index d26cb2f2..27023d13 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/more/MoreFragment.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/more/MoreFragment.kt @@ -1,45 +1,19 @@ package io.github.wulkanowy.ui.modules.more import android.os.Bundle -import android.text.InputFilter -import android.text.InputType -import android.text.Spanned import android.view.View -import android.widget.EditText -import androidx.appcompat.app.AlertDialog import androidx.recyclerview.widget.LinearLayoutManager -import com.google.android.material.dialog.MaterialAlertDialogBuilder import dagger.hilt.android.AndroidEntryPoint import io.github.wulkanowy.R import io.github.wulkanowy.data.repositories.PreferencesRepository import io.github.wulkanowy.databinding.FragmentMoreBinding import io.github.wulkanowy.ui.base.BaseFragment import io.github.wulkanowy.ui.modules.Destination -import io.github.wulkanowy.ui.modules.dashboard.DashboardItem import io.github.wulkanowy.ui.modules.main.MainActivity import io.github.wulkanowy.ui.modules.main.MainView import io.github.wulkanowy.ui.modules.message.MessageFragment -import timber.log.Timber import javax.inject.Inject -private class AttendancePercentageFilter : InputFilter { - override fun filter( - source: CharSequence?, - start: Int, - end: Int, - dest: Spanned?, - dstart: Int, - dend: Int - ): CharSequence? { - val input = dest.toString() + source.toString() - val floatRepresentation = input.toFloatOrNull() - - if (floatRepresentation != null && floatRepresentation in 0.0..100.0) return null - - return "" - } -} - @AndroidEntryPoint class MoreFragment : BaseFragment(R.layout.fragment_more), MoreView, MainView.TitledView, MainView.MainChildView { @@ -68,7 +42,6 @@ class MoreFragment : BaseFragment(R.layout.fragment_more), override fun initView() { moreAdapter.onClickListener = presenter::onItemSelected - moreAdapter.onLongClickListener = presenter::onItemHold with(binding.moreRecycler) { layoutManager = LinearLayoutManager(context) @@ -105,68 +78,6 @@ class MoreFragment : BaseFragment(R.layout.fragment_more), super.onDestroyView() } - private fun showGradeDialog() { - val hiddenGrades = preferencesRepository.hiddenGrades - - val grades = requireContext().resources.getStringArray(R.array.hidden_settings_bad_grades) - val selectedItemsState = grades.map { grade -> hiddenGrades.any { it == grade } } - - MaterialAlertDialogBuilder(requireContext()) - .setTitle(R.string.pref_hidden_settings_hide_grades_title) - .setMultiChoiceItems(grades, selectedItemsState.toBooleanArray()) { _, _, _ -> } - .setPositiveButton(android.R.string.ok) { dialog, _ -> - val selectedState = (dialog as AlertDialog).listView.checkedItemPositions - val selectedValues = grades.filterIndexed { index, _ -> selectedState[index] } - - Timber.i("Selected hidden grades: $selectedValues") - presenter.onHiddenGradesSelected(selectedValues) - } - .show() - } - - override fun showHiddenSettings(data: List) { - val entries = requireContext().resources.getStringArray(R.array.hidden_settings_entries) - val values = requireContext().resources.getStringArray(R.array.hidden_settings_values) - val selectedItemsState = values.map { value -> data.any { it.name == value } } - - val attendancePercentage = preferencesRepository.attendancePercentage - - val input = EditText(requireContext()).apply { - setPadding(40, 20, 40, 20) - hint = requireContext().getString(R.string.pref_hidden_settings_hint) - filters = arrayOf(AttendancePercentageFilter()) - inputType = InputType.TYPE_CLASS_NUMBER or InputType.TYPE_NUMBER_FLAG_DECIMAL - } - - // enable only if attendance modifier is enabled - val attendanceModifierEnabled = data.any { it == DashboardItem.HiddenSettingTile.ATTENDANCE } - input.isEnabled = attendanceModifierEnabled - - if (attendancePercentage != null) input.setText(attendancePercentage.toString()) - - MaterialAlertDialogBuilder(requireContext()) - .setTitle(R.string.pref_hidden_settings_title) - .setMultiChoiceItems(entries, selectedItemsState.toBooleanArray()) { dialog, index, _ -> - // if attendance modifier is enabled, enable text input - if (index == values.indexOf(DashboardItem.HiddenSettingTile.ATTENDANCE.name)) - input.isEnabled = (dialog as AlertDialog).listView.checkedItemPositions[index] - } - .setView(input) - .setPositiveButton(android.R.string.ok) { dialog, _ -> - val selectedState = (dialog as AlertDialog).listView.checkedItemPositions - val selectedValues = values.filterIndexed { index, _ -> selectedState[index] } - val inputAttendancePercentage = selectedValues - .find { it == DashboardItem.HiddenSettingTile.ATTENDANCE.name } - ?.let { input.text.toString().toFloatOrNull() } - - Timber.i("Selected hidden settings: $selectedValues") - presenter.onHiddenSettingsSelected(selectedValues, inputAttendancePercentage) - } - .setNegativeButton(android.R.string.cancel) { _, _ -> } - .setNeutralButton(R.string.pref_hidden_settings_hide_grades_title) { _, _ -> showGradeDialog() } - .show() - } - override fun restartApp() { startActivity(MainActivity.getStartIntent(requireContext())) requireActivity().finishAffinity() diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/more/MorePresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/more/MorePresenter.kt index 7e36e3c8..0ebaf4c7 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/more/MorePresenter.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/more/MorePresenter.kt @@ -6,23 +6,19 @@ import io.github.wulkanowy.data.repositories.StudentRepository import io.github.wulkanowy.ui.base.BasePresenter import io.github.wulkanowy.ui.base.ErrorHandler import io.github.wulkanowy.ui.modules.Destination -import io.github.wulkanowy.ui.modules.dashboard.DashboardItem -import okhttp3.internal.notify import timber.log.Timber import javax.inject.Inject class MorePresenter @Inject constructor( errorHandler: ErrorHandler, studentRepository: StudentRepository, - private val preferencesRepository: PreferencesRepository + preferencesRepository: PreferencesRepository ) : BasePresenter(errorHandler, studentRepository) { private val moreAppMenuItem = preferencesRepository.appMenuItemOrder .sortedBy { it.order } .drop(4) - private val selectedHiddenSettingsTiles = preferencesRepository.selectedHiddenSettingTiles - override fun onAttachView(view: MoreView) { super.onAttachView(view) view.initView() @@ -36,30 +32,6 @@ class MorePresenter @Inject constructor( view?.openView(moreItem.destination) } - fun onItemHold(moreItem: MoreItem) { - Timber.i("More item hold") - - when (moreItem.destination) { - Destination.Settings -> view?.showHiddenSettings(selectedHiddenSettingsTiles) - else -> return - } - } - - fun onHiddenSettingsSelected(selectedItems: List, attendance: Float?) { - preferencesRepository.selectedHiddenSettingTiles = selectedItems.map { - DashboardItem.HiddenSettingTile.valueOf(it) - } - - preferencesRepository.attendancePercentage = attendance - - view?.restartApp() - } - - fun onHiddenGradesSelected(selectedItems: List) { - preferencesRepository.hiddenGrades = selectedItems - view?.restartApp() - } - fun onViewReselected() { Timber.i("More view is reselected") view?.popView(2) diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/more/MoreView.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/more/MoreView.kt index ab2f1444..05b426d6 100644 --- a/app/src/main/java/io/github/wulkanowy/ui/modules/more/MoreView.kt +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/more/MoreView.kt @@ -2,7 +2,6 @@ package io.github.wulkanowy.ui.modules.more import io.github.wulkanowy.ui.base.BaseView import io.github.wulkanowy.ui.modules.Destination -import io.github.wulkanowy.ui.modules.dashboard.DashboardItem interface MoreView : BaseView { @@ -14,7 +13,5 @@ interface MoreView : BaseView { fun openView(destination: Destination) - fun showHiddenSettings(data: List) - fun restartApp() } diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/settings/mod_settings/ModSettingsFragment.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/settings/mod_settings/ModSettingsFragment.kt new file mode 100644 index 00000000..4b98eff0 --- /dev/null +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/settings/mod_settings/ModSettingsFragment.kt @@ -0,0 +1,165 @@ +package io.github.wulkanowy.ui.modules.settings.mod_settings + +import android.content.SharedPreferences +import android.os.Bundle +import android.view.View +import androidx.appcompat.app.AlertDialog +import androidx.preference.EditTextPreference +import androidx.preference.PreferenceFragmentCompat +import com.google.android.material.dialog.MaterialAlertDialogBuilder +import dagger.hilt.android.AndroidEntryPoint +import io.github.wulkanowy.R +import io.github.wulkanowy.data.repositories.PreferencesRepository +import io.github.wulkanowy.ui.base.BaseActivity +import io.github.wulkanowy.ui.base.ErrorDialog +import io.github.wulkanowy.ui.modules.dashboard.DashboardItem +import io.github.wulkanowy.ui.modules.main.MainActivity +import io.github.wulkanowy.ui.modules.main.MainView +import io.github.wulkanowy.utils.AppInfo +import timber.log.Timber +import javax.inject.Inject + +@AndroidEntryPoint +class ModSettingsFragment : PreferenceFragmentCompat(), + SharedPreferences.OnSharedPreferenceChangeListener, + MainView.TitledView, ModSettingsView { + + @Inject + lateinit var presenter: ModSettingsPresenter + + @Inject + lateinit var appInfo: AppInfo + + @Inject + lateinit var preferencesRepository: PreferencesRepository + + override val titleStringId get() = R.string.pref_settings_advanced_title + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + presenter.onAttachView(this) + } + + override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { + setPreferencesFromResource(R.xml.scheme_preferences_mod_settings, rootKey) + + val etp: EditTextPreference? = findPreference("attendance_percentage") + etp?.setOnBindEditTextListener { editText -> + editText.inputType = android.text.InputType.TYPE_CLASS_NUMBER or android.text.InputType.TYPE_NUMBER_FLAG_DECIMAL + editText.filters = arrayOf( + android.text.InputFilter { source, _, _, dest, _, _ -> + if (source == "." && dest.isEmpty()) { + return@InputFilter "0." + } + + val input = dest.toString() + source.toString() + if (input == "100.00") { + return@InputFilter null + } + + val inputVal = input.toFloatOrNull() + if (inputVal != null && inputVal >= 0 && inputVal <= 100) { + null + } else { + "" + } + } + ) + } + } + + override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) { + presenter.onSharedPreferenceChanged(key) + } + + override fun showError(text: String, error: Throwable) { + (activity as? BaseActivity<*, *>)?.showError(text, error) + } + + override fun showMessage(text: String) { + (activity as? BaseActivity<*, *>)?.showMessage(text) + } + + override fun showExpiredCredentialsDialog() { + (activity as? BaseActivity<*, *>)?.showExpiredCredentialsDialog() + } + + override fun onCaptchaVerificationRequired(url: String?) { + (activity as? BaseActivity<*, *>)?.onCaptchaVerificationRequired(url) + } + + override fun showDecryptionFailedDialog() { + (activity as? BaseActivity<*, *>)?.showDecryptionFailedDialog() + } + + override fun showChangePasswordSnackbar(redirectUrl: String) { + (activity as? BaseActivity<*, *>)?.showChangePasswordSnackbar(redirectUrl) + } + + override fun openClearLoginView() { + (activity as? BaseActivity<*, *>)?.openClearLoginView() + } + + override fun showErrorDetailsDialog(error: Throwable) { + ErrorDialog.newInstance(error).show(childFragmentManager, error.toString()) + } + + override fun showAuthDialog() { + (activity as? BaseActivity<*, *>)?.showAuthDialog() + } + + override fun onResume() { + super.onResume() + preferenceScreen.sharedPreferences?.registerOnSharedPreferenceChangeListener(this) + } + + override fun onPause() { + super.onPause() + preferenceScreen.sharedPreferences?.unregisterOnSharedPreferenceChangeListener(this) + } + + override fun showGradeDialogSettings() { + val hiddenGrades = preferencesRepository.hiddenGrades + + val grades = requireContext().resources.getStringArray(R.array.hidden_settings_bad_grades) + val selectedItemsState = grades.map { grade -> hiddenGrades.any { it == grade } } + + MaterialAlertDialogBuilder(requireContext()) + .setTitle(R.string.pref_hidden_settings_hidden_grades) + .setMultiChoiceItems(grades, selectedItemsState.toBooleanArray()) { _, _, _ -> } + .setPositiveButton(android.R.string.ok) { dialog, _ -> + val selectedState = (dialog as AlertDialog).listView.checkedItemPositions + val selectedValues = grades.filterIndexed { index, _ -> selectedState[index] } + + Timber.i("Selected hidden grades: $selectedValues") + presenter.onHiddenGradesSelected(selectedValues) + } + .show() + } + + override fun showAttendanceSettings(items: List) { + val entries = requireContext().resources.getStringArray(R.array.mod_settings_attendance_entries) + val values = requireContext().resources.getStringArray(R.array.mod_settings_attendance_values) + val selectedItemsState = values.map { value -> items.any { it.name == value } } + + MaterialAlertDialogBuilder(requireContext()) + .setTitle(R.string.attendance_title) + .setMultiChoiceItems(entries, selectedItemsState.toBooleanArray()) { _, _, _ -> } + .setPositiveButton(android.R.string.ok) { dialog, _ -> + val selectedState = (dialog as AlertDialog).listView.checkedItemPositions + val selectedValues = values + .filterIndexed { index, _ -> selectedState[index] } + .map { DashboardItem.HiddenAttendanceTile.valueOf(it) } + + Timber.i("Selected attendance to hide: $selectedValues") + presenter.onAttendanceSettingsSelected(selectedValues) + } + .setNegativeButton(android.R.string.cancel) { _, _ -> } + .show() + } + + override fun restartApp() { + startActivity(MainActivity.getStartIntent(requireContext())) + requireActivity().finishAffinity() + } +} diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/settings/mod_settings/ModSettingsPresenter.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/settings/mod_settings/ModSettingsPresenter.kt new file mode 100644 index 00000000..1f81732f --- /dev/null +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/settings/mod_settings/ModSettingsPresenter.kt @@ -0,0 +1,39 @@ +package io.github.wulkanowy.ui.modules.settings.mod_settings + +import io.github.wulkanowy.data.repositories.PreferencesRepository +import io.github.wulkanowy.data.repositories.StudentRepository +import io.github.wulkanowy.ui.base.BasePresenter +import io.github.wulkanowy.ui.base.ErrorHandler +import io.github.wulkanowy.ui.modules.dashboard.DashboardItem +import io.github.wulkanowy.utils.AnalyticsHelper +import timber.log.Timber +import javax.inject.Inject + +class ModSettingsPresenter @Inject constructor( + errorHandler: ErrorHandler, + studentRepository: StudentRepository, + private val analytics: AnalyticsHelper, + private val preferencesRepository: PreferencesRepository +) : BasePresenter(errorHandler, studentRepository) { + + override fun onAttachView(view: ModSettingsView) { + super.onAttachView(view) + Timber.i("Mod settings view was initialized") + } + + fun onSharedPreferenceChanged(key: String?) { + key ?: return + Timber.i("Change mod settings $key") + analytics.logEvent("setting_changed", "name" to key) + } + + fun onHiddenGradesSelected(selectedItems: List) { + preferencesRepository.hiddenGrades = selectedItems + view?.restartApp() + } + + fun onAttendanceSettingsSelected(selectedValues: List) { + preferencesRepository.hiddenAttendanceItems = selectedValues + view?.restartApp() + } +} diff --git a/app/src/main/java/io/github/wulkanowy/ui/modules/settings/mod_settings/ModSettingsView.kt b/app/src/main/java/io/github/wulkanowy/ui/modules/settings/mod_settings/ModSettingsView.kt new file mode 100644 index 00000000..115a551e --- /dev/null +++ b/app/src/main/java/io/github/wulkanowy/ui/modules/settings/mod_settings/ModSettingsView.kt @@ -0,0 +1,10 @@ +package io.github.wulkanowy.ui.modules.settings.mod_settings + +import io.github.wulkanowy.ui.base.BaseView +import io.github.wulkanowy.ui.modules.dashboard.DashboardItem + +interface ModSettingsView : BaseView { + fun restartApp() + fun showGradeDialogSettings() + fun showAttendanceSettings(items: List) +} diff --git a/app/src/main/res/values-cs/mod_values.xml b/app/src/main/res/values-cs/mod_values.xml index 02b35b92..62229dde 100644 --- a/app/src/main/res/values-cs/mod_values.xml +++ b/app/src/main/res/values-cs/mod_values.xml @@ -1,8 +1,8 @@ - Skrytá nastavení - Procento docházky - Skrýt známky + Skrytá nastavení + Procento docházky + Skrýt známky Špatná účast diff --git a/app/src/main/res/values-da-rDK/mod_values.xml b/app/src/main/res/values-da-rDK/mod_values.xml index 1d61d6c8..af223cdb 100644 --- a/app/src/main/res/values-da-rDK/mod_values.xml +++ b/app/src/main/res/values-da-rDK/mod_values.xml @@ -1,8 +1,8 @@ - Hidden settings - Attendance percentage - Hide grades + Hidden settings + Attendance percentage + Hide grades Bad attendance diff --git a/app/src/main/res/values-de/mod_values.xml b/app/src/main/res/values-de/mod_values.xml index 5a9728c3..3e56dc5d 100644 --- a/app/src/main/res/values-de/mod_values.xml +++ b/app/src/main/res/values-de/mod_values.xml @@ -1,8 +1,8 @@ - Geheime Einstellungen - Prozentuale Erwartung - Hide Grades + Geheime Einstellungen + Prozentuale Erwartung + Hide Grades Schlechte Anwesenheit diff --git a/app/src/main/res/values-es-rES/mod_values.xml b/app/src/main/res/values-es-rES/mod_values.xml index 1d61d6c8..af223cdb 100644 --- a/app/src/main/res/values-es-rES/mod_values.xml +++ b/app/src/main/res/values-es-rES/mod_values.xml @@ -1,8 +1,8 @@ - Hidden settings - Attendance percentage - Hide grades + Hidden settings + Attendance percentage + Hide grades Bad attendance diff --git a/app/src/main/res/values-it-rIT/mod_values.xml b/app/src/main/res/values-it-rIT/mod_values.xml index 1d61d6c8..af223cdb 100644 --- a/app/src/main/res/values-it-rIT/mod_values.xml +++ b/app/src/main/res/values-it-rIT/mod_values.xml @@ -1,8 +1,8 @@ - Hidden settings - Attendance percentage - Hide grades + Hidden settings + Attendance percentage + Hide grades Bad attendance diff --git a/app/src/main/res/values-pl/mod_values.xml b/app/src/main/res/values-pl/mod_values.xml index b2fc8e65..c2a4688e 100644 --- a/app/src/main/res/values-pl/mod_values.xml +++ b/app/src/main/res/values-pl/mod_values.xml @@ -1,8 +1,8 @@ - Sekretne ustawienia - Procent frekwencji - Ukryj oceny + Sekretne ustawienia + Procent frekwencji + Ukryj oceny Słaba frekwencja diff --git a/app/src/main/res/values-ru/mod_values.xml b/app/src/main/res/values-ru/mod_values.xml index 98474259..8e64ef8b 100644 --- a/app/src/main/res/values-ru/mod_values.xml +++ b/app/src/main/res/values-ru/mod_values.xml @@ -1,8 +1,8 @@ - Секретные настройки - Процент посещаемости - Скрыть оценки + Секретные настройки + Процент посещаемости + Скрыть оценки Плохая посещаемость diff --git a/app/src/main/res/values-sk/mod_values.xml b/app/src/main/res/values-sk/mod_values.xml index 402ae178..f7d6c3d8 100644 --- a/app/src/main/res/values-sk/mod_values.xml +++ b/app/src/main/res/values-sk/mod_values.xml @@ -1,8 +1,8 @@ - Skryté nastavenia - Percento dochádzky - Skryť známky + Skryté nastavenia + Percento dochádzky + Skryť známky Zlá účasť diff --git a/app/src/main/res/values-uk/mod_values.xml b/app/src/main/res/values-uk/mod_values.xml index 1e34afbc..57b726ba 100644 --- a/app/src/main/res/values-uk/mod_values.xml +++ b/app/src/main/res/values-uk/mod_values.xml @@ -1,8 +1,8 @@ - Секретні налаштування - Відсоток відвідуваності - Приховати оцінки + Секретні налаштування + Відсоток відвідуваності + Приховати оцінки Погана відвідуваність diff --git a/app/src/main/res/values/mod_values.xml b/app/src/main/res/values/mod_values.xml index 4b2f1cec..acf84529 100644 --- a/app/src/main/res/values/mod_values.xml +++ b/app/src/main/res/values/mod_values.xml @@ -1,9 +1,41 @@ - Hidden settings - Attendance percentage + Wulkanowy MOD settings + Hidden attendance items + Attendance percentage + Hidden grades + + attendance_items attendance_percentage - Hide grades + + + + + + Unexcused absence + Exemption + Excused lateness + Unexcused lateness + Present + Deleted + Excused absence + Unknown + + + + UNEXCUSED_ABSENCE + EXEMPTION + EXCUSED_LATENESS + UNEXCUSED_LATENESS + PRESENT + DELETED + EXCUSED_ABSENCE + UNKNOWN + + + + + Bad attendance diff --git a/app/src/main/res/xml/scheme_preferences.xml b/app/src/main/res/xml/scheme_preferences.xml index 5bf7ad8a..b0d37b93 100644 --- a/app/src/main/res/xml/scheme_preferences.xml +++ b/app/src/main/res/xml/scheme_preferences.xml @@ -30,4 +30,9 @@ app:key="about" app:summary="@string/pref_about_category_summary" app:title="@string/about_title" /> + diff --git a/app/src/main/res/xml/scheme_preferences_mod_settings.xml b/app/src/main/res/xml/scheme_preferences_mod_settings.xml new file mode 100644 index 00000000..d61364be --- /dev/null +++ b/app/src/main/res/xml/scheme_preferences_mod_settings.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/play/res/xml/scheme_preferences.xml b/app/src/play/res/xml/scheme_preferences.xml index 05b0bf64..62b01703 100644 --- a/app/src/play/res/xml/scheme_preferences.xml +++ b/app/src/play/res/xml/scheme_preferences.xml @@ -36,4 +36,9 @@ app:key="about" app:summary="@string/pref_about_category_summary" app:title="@string/about_title" /> +