@@ -31,9 +31,9 @@ import java.util.concurrent.TimeUnit
3131class FeedViewModel (
3232 private val application : Application ,
3333 groupId : Long = FeedGroupEntity .GROUP_ALL_ID ,
34- initialShowPlayedItems : Boolean = true ,
35- initialShowPartiallyPlayedItems : Boolean = true ,
36- initialShowFutureItems : Boolean = true
34+ initialShowPlayedItems : Boolean ,
35+ initialShowPartiallyPlayedItems : Boolean ,
36+ initialShowFutureItems : Boolean
3737) : ViewModel() {
3838 private val feedDatabaseManager = FeedDatabaseManager (application)
3939
@@ -119,39 +119,33 @@ class FeedViewModel(
119119 val t4 : OffsetDateTime ?
120120 )
121121
122- fun setShowPlayedItems (showPlayedItems : Boolean ) {
122+ fun setSaveShowPlayedItems (showPlayedItems : Boolean ) {
123123 this .showPlayedItems.onNext(showPlayedItems)
124- }
125-
126- fun saveShowPlayedItemsToPreferences (showPlayedItems : Boolean ) =
127124 PreferenceManager .getDefaultSharedPreferences(application).edit {
128125 this .putBoolean(application.getString(R .string.feed_show_watched_items_key), showPlayedItems)
129126 this .apply ()
130127 }
128+ }
131129
132130 fun getShowPlayedItemsFromPreferences () = getShowPlayedItemsFromPreferences(application)
133131
134- fun setShowPartiallyPlayedItems (showPartiallyPlayedItems : Boolean ) {
132+ fun setSaveShowPartiallyPlayedItems (showPartiallyPlayedItems : Boolean ) {
135133 this .showPartiallyPlayedItems.onNext(showPartiallyPlayedItems)
136- }
137-
138- fun saveShowPartiallyPlayedItemsToPreferences (showPartiallyPlayedItems : Boolean ) =
139134 PreferenceManager .getDefaultSharedPreferences(application).edit {
140135 this .putBoolean(application.getString(R .string.feed_show_partially_watched_items_key), showPartiallyPlayedItems)
141136 this .apply ()
142137 }
138+ }
143139
144140 fun getShowPartiallyPlayedItemsFromPreferences () = getShowPartiallyPlayedItemsFromPreferences(application)
145141
146- fun setShowFutureItems (showFutureItems : Boolean ) {
142+ fun setSaveShowFutureItems (showFutureItems : Boolean ) {
147143 this .showFutureItems.onNext(showFutureItems)
148- }
149-
150- fun saveShowFutureItemsToPreferences (showFutureItems : Boolean ) =
151144 PreferenceManager .getDefaultSharedPreferences(application).edit {
152145 this .putBoolean(application.getString(R .string.feed_show_future_items_key), showFutureItems)
153146 this .apply ()
154147 }
148+ }
155149
156150 fun getShowFutureItemsFromPreferences () = getShowFutureItemsFromPreferences(application)
157151
0 commit comments