forked from github/wulkanowy-mirror
Show subjects without grades in "Grades" (#947)
This commit is contained in:
parent
2a74b11cce
commit
e08abc1fc2
@ -80,6 +80,9 @@ class PreferencesRepository @Inject constructor(
|
||||
val showTimetableTimers: Boolean
|
||||
get() = getBoolean(R.string.pref_key_timetable_show_timers, R.bool.pref_default_timetable_show_timers)
|
||||
|
||||
val showSubjectsWithoutGrades: Boolean
|
||||
get() = getBoolean(R.string.pref_key_subjects_without_grades, R.bool.pref_default_subjects_without_grades)
|
||||
|
||||
private fun getString(id: Int, default: Int) = getString(context.getString(id), default)
|
||||
|
||||
private fun getString(id: String, default: Int) = sharedPref.getString(id, context.getString(default)) ?: context.getString(default)
|
||||
|
@ -186,7 +186,7 @@ class GradeDetailsPresenter @Inject constructor(
|
||||
|
||||
private fun createGradeItems(items: List<GradeDetailsWithAverage>): List<GradeDetailsItem> {
|
||||
return items
|
||||
.filter { it.grades.isNotEmpty() }
|
||||
.let { if (!preferencesRepository.showSubjectsWithoutGrades) it.filter { it.grades.isNotEmpty() } else it.filter { true }}
|
||||
.sortedBy { it.subject }
|
||||
.map { (subject, average, points, _, grades) ->
|
||||
val subItems = grades
|
||||
|
@ -359,6 +359,7 @@
|
||||
<string name="pref_view_timetable_show_timers">Oznaczaj bieżącą lekcję na planie</string>
|
||||
<string name="pref_view_grade_statistics_list">Pokazuj listę wykresów w ocenach klasy</string>
|
||||
<string name="pref_view_timetable_show_whole_class">Pokazuj lekcje całej klasy</string>
|
||||
<string name="pref_view_subjects_without_grades">Pokazuj przedmioty bez ocen w Oceny</string>
|
||||
<string name="pref_view_grade_color_scheme">Schemat kolorów ocen</string>
|
||||
<string name="pref_view_app_language">Język aplikacji</string>
|
||||
<string name="pref_notify_header">Powiadomienia</string>
|
||||
|
@ -20,4 +20,5 @@
|
||||
<bool name="pref_default_fill_message_content">true</bool>
|
||||
<string name="pref_default_timetable_show_whole_class">no</string>
|
||||
<bool name="pref_default_timetable_show_timers">false</bool>
|
||||
<bool name="pref_default_subjects_without_grades">false</bool>
|
||||
</resources>
|
||||
|
@ -22,4 +22,5 @@
|
||||
<string name="pref_key_fill_message_content">fill_message_content</string>
|
||||
<string name="pref_key_timetable_show_whole_class">show_whole_class_plan</string>
|
||||
<string name="pref_key_timetable_show_timers">timetable_show_timers</string>
|
||||
<string name="pref_key_subjects_without_grades">subjects_without_grades</string>
|
||||
</resources>
|
||||
|
@ -385,6 +385,7 @@
|
||||
<string name="pref_view_timetable_show_timers">Mark current lesson in timetable</string>
|
||||
<string name="pref_view_grade_statistics_list">Show chart list in class grades</string>
|
||||
<string name="pref_view_timetable_show_whole_class">Show whole class lessons</string>
|
||||
<string name="pref_view_subjects_without_grades">Show subjects without grades in Grades</string>
|
||||
<string name="pref_view_grade_color_scheme">Grades color scheme</string>
|
||||
<string name="pref_view_app_language">App language</string>
|
||||
|
||||
|
@ -40,6 +40,12 @@
|
||||
app:key="@string/pref_key_grade_statistics_list"
|
||||
app:singleLineTitle="false"
|
||||
app:title="@string/pref_view_grade_statistics_list" />
|
||||
<SwitchPreferenceCompat
|
||||
app:defaultValue="@bool/pref_default_subjects_without_grades"
|
||||
app:iconSpaceReserved="false"
|
||||
app:key="@string/pref_key_subjects_without_grades"
|
||||
app:singleLineTitle="false"
|
||||
app:title="@string/pref_view_subjects_without_grades" />
|
||||
<ListPreference
|
||||
app:defaultValue="@string/pref_default_timetable_show_whole_class"
|
||||
app:entries="@array/timetable_show_whole_class_entries"
|
||||
|
Loading…
x
Reference in New Issue
Block a user