Skip to content

Commit

Permalink
Remove redundant preference apply calls
Browse files Browse the repository at this point in the history
The edit block applies automatically
  • Loading branch information
wax911 committed Apr 22, 2022
1 parent f69f945 commit f7ed5b9
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions app/src/main/java/com/mxt/anitrend/util/Settings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class Settings(
set(value) {
edit {
putBoolean(_isAuthenticated, value)
apply()
}
}

Expand All @@ -43,7 +42,6 @@ class Settings(
set(value) {
edit {
putLong(_lastDismissedNotificationId, value)
apply()
}
}

Expand All @@ -55,7 +53,6 @@ class Settings(
field = value
edit {
putString(resources.getString(R.string.pref_key_app_theme), value)
apply()
}
}

Expand All @@ -70,7 +67,6 @@ class Settings(
field = value
edit {
putBoolean(_freshInstall, field)
apply()
}
}

Expand All @@ -81,7 +77,6 @@ class Settings(
field = value
edit {
putString(resources.getString(R.string.pref_key_selected_language), field)
apply()
}
}

Expand All @@ -91,7 +86,6 @@ class Settings(
field = value
edit {
putInt(resources.getString(R.string.pref_key_list_view_style), field)
apply()
}
}

Expand All @@ -103,7 +97,6 @@ class Settings(
field = value
edit {
putInt(resources.getString(R.string.pref_key_sync_frequency), field)
apply()
}
}

Expand All @@ -113,7 +106,6 @@ class Settings(
field = value
edit {
putBoolean(resources.getString(R.string.pref_key_new_message_notifications), field)
apply()
}
}

Expand All @@ -123,7 +115,6 @@ class Settings(
field = value
edit {
putBoolean(resources.getString(R.string.pref_key_clear_notification_on_dismiss), field)
apply()
}
}

Expand All @@ -133,7 +124,6 @@ class Settings(
field = value
edit {
putBoolean(resources.getString(R.string.pref_key_crash_reports), field)
apply()
}
}

Expand All @@ -143,7 +133,6 @@ class Settings(
field = value
edit {
putBoolean(resources.getString(R.string.pref_key_usage_analytics), field)
apply()
}
}

Expand All @@ -153,7 +142,6 @@ class Settings(
field = value
edit {
putInt(KeyUtil.arg_seasonYear, field)
apply()
}
}

Expand All @@ -163,7 +151,6 @@ class Settings(
field = value
edit {
putBoolean(resources.getString(R.string.pref_key_display_adult_content), field)
apply()
}
}

Expand All @@ -176,7 +163,6 @@ class Settings(
field = value
edit {
putString(_sortOrder, value)
apply()
}
}

Expand All @@ -187,7 +173,6 @@ class Settings(
set(mediaStatus) {
edit {
putString(_mediaStatus, mediaStatus)
apply()
}
}

Expand All @@ -198,7 +183,6 @@ class Settings(
set(mediaFormat) {
edit {
putString(_mediaFormat, mediaFormat)
apply()
}
}

Expand All @@ -209,7 +193,6 @@ class Settings(
set(animeFormat) {
edit {
putString(_animeFormat, animeFormat)
apply()
}
}

Expand All @@ -220,7 +203,6 @@ class Settings(
set(mangaFormat) {
edit {
putString(_mangaFormat, mangaFormat)
apply()
}
}

Expand All @@ -231,7 +213,6 @@ class Settings(
set(mediaSource) {
edit {
putString(_mediaSource, mediaSource)
apply()
}
}

Expand All @@ -242,7 +223,6 @@ class Settings(
set(airingSort) {
edit {
putString(_airingSort, airingSort)
apply()
}
}

Expand All @@ -253,7 +233,6 @@ class Settings(
set(characterSort) {
edit {
putString(_characterSort, characterSort)
apply()
}
}

Expand All @@ -264,7 +243,6 @@ class Settings(
set(mediaListSort) {
edit {
putString(_mediaListSort, mediaListSort)
apply()
}
}

Expand All @@ -275,7 +253,6 @@ class Settings(
set(mediaSort) {
edit {
putString(_mediaSort, mediaSort)
apply()
}
}
@set:KeyUtil.MediaTrendSort
Expand All @@ -285,7 +262,6 @@ class Settings(
set(mediaTrendSort) {
edit {
putString(_mediaTrendSort, mediaTrendSort)
apply()
}
}

Expand All @@ -296,7 +272,6 @@ class Settings(
set(reviewSort) {
edit {
putString(_reviewSort, reviewSort)
apply()
}
}

Expand All @@ -307,7 +282,6 @@ class Settings(
set(staffSort) {
edit {
putString(_staffSort, staffSort)
apply()
}
}

Expand All @@ -318,7 +292,6 @@ class Settings(
set(channel) {
edit {
putString(_updateChannel, channel)
apply()
}
}

Expand All @@ -331,7 +304,6 @@ class Settings(
field = value
edit {
putInt(_versionCode, value)
apply()
}
}

Expand All @@ -345,7 +317,6 @@ class Settings(
.convertToJson(selectedIndices)
edit {
putString(_genreFilter, selected)
apply()
}
}

Expand Down Expand Up @@ -373,7 +344,6 @@ class Settings(
fun saveSeasonYear(year: Int) {
edit {
putInt(KeyUtil.arg_seasonYear, year)
apply()
}
}

Expand All @@ -385,21 +355,18 @@ class Settings(
fun disableTipFor(@KeyUtil.TapTargetType tipType: String) {
edit {
putBoolean(tipType, false)
apply()
}
}

fun saveSortOrder(@KeyUtil.SortOrderType sortOrder: String) {
edit {
putString(_sortOrder, sortOrder)
apply()
}
}

fun setUpdated() {
edit {
putInt(_versionCode, BuildConfig.VERSION_CODE)
apply()
}
}

Expand All @@ -408,7 +375,6 @@ class Settings(
const val _updateChannel = "_updateChannel"
const val _appTheme = "application_theme"

/** Api Keys */
private const val _genreFilter = "_genreFilter"
private const val _tagFilter = "_tagFilter"
private const val _sortOrder = "_sortOrder"
Expand Down

0 comments on commit f7ed5b9

Please sign in to comment.