Skip to content

Commit

Permalink
added enable/disable ads setting
Browse files Browse the repository at this point in the history
  • Loading branch information
itszechs committed Jun 24, 2023
1 parent 70dc550 commit be54abc
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class SettingsFragment : BaseFragment() {
setupThemeMenu()
setupDefaultPlayerMenu()
setupCheckForUpdates()
setupAdsSetting()
}

private fun setupThemeMenu() {
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit be54abc

Please sign in to comment.