diff options
Diffstat (limited to 'app/src/main/java/Settings')
-rw-r--r-- | app/src/main/java/Settings/MainPreferenceFragment.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/src/main/java/Settings/MainPreferenceFragment.java b/app/src/main/java/Settings/MainPreferenceFragment.java index af498294..8e3b7d99 100644 --- a/app/src/main/java/Settings/MainPreferenceFragment.java +++ b/app/src/main/java/Settings/MainPreferenceFragment.java @@ -17,6 +17,7 @@ import javax.inject.Inject; import ml.docilealligator.infinityforreddit.ChangeNSFWBlurEvent; import ml.docilealligator.infinityforreddit.ChangeNSFWEvent; +import ml.docilealligator.infinityforreddit.ChangeSpoilerBlurEvent; import ml.docilealligator.infinityforreddit.Infinity; import ml.docilealligator.infinityforreddit.R; import ml.docilealligator.infinityforreddit.SharedPreferencesUtils; @@ -44,6 +45,7 @@ public class MainPreferenceFragment extends PreferenceFragmentCompat { SwitchPreference nsfwSwitch = findPreference(SharedPreferencesUtils.NSFW_KEY); SwitchPreference blurNSFWSwitch = findPreference(SharedPreferencesUtils.BLUR_NSFW_KEY); + SwitchPreference blurSpoilerSwitch = findPreference(SharedPreferencesUtils.BLUR_SPOILER_KEY); ListPreference themePreference = findPreference(SharedPreferencesUtils.THEME_KEY); if(nsfwSwitch != null) { @@ -71,6 +73,13 @@ public class MainPreferenceFragment extends PreferenceFragmentCompat { }); } + if(blurSpoilerSwitch != null) { + blurSpoilerSwitch.setOnPreferenceChangeListener((preference, newValue) -> { + EventBus.getDefault().post(new ChangeSpoilerBlurEvent((Boolean) newValue)); + return true; + }); + } + boolean systemDefault = Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q; if(themePreference != null) { |