diff --git a/app/src/main/java/zechs/drive/stream/ui/settings/SettingsFragment.kt b/app/src/main/java/zechs/drive/stream/ui/settings/SettingsFragment.kt index 8e3d233..08634a4 100644 --- a/app/src/main/java/zechs/drive/stream/ui/settings/SettingsFragment.kt +++ b/app/src/main/java/zechs/drive/stream/ui/settings/SettingsFragment.kt @@ -56,6 +56,7 @@ class SettingsFragment : BaseFragment() { setupThemeMenu() setupDefaultPlayerMenu() setupCheckForUpdates() + setupAdsSetting() } private fun setupThemeMenu() { @@ -157,6 +158,14 @@ class SettingsFragment : BaseFragment() { } + private fun setupAdsSetting() { + binding.switchAdsSupport.isChecked = mainViewModel.adsEnabled + binding.settingAdsSupport.setOnClickListener { + binding.switchAdsSupport.isChecked = !binding.switchAdsSupport.isChecked + mainViewModel.setEnableAds(binding.switchAdsSupport.isChecked) + } + } + private fun showSnackBar(message: String) { Snackbar.make( binding.root,