Skip to content
Snippets Groups Projects
Unverified Commit a4c1e5ee authored by harambasicluka's avatar harambasicluka Committed by GitHub
Browse files

set "enabled" for include_settings_switch_row in notifications settings, fixes...

set "enabled" for include_settings_switch_row in notifications settings, fixes wrong binding and removed clickable rows (#101)

Co-authored-by: default avatarmarcmuschko <marc.muschko@sap.com>
parent 11f0adbc
No related branches found
No related tags found
No related merge requests found
...@@ -56,13 +56,9 @@ class SettingsNotificationFragment : Fragment() { ...@@ -56,13 +56,9 @@ class SettingsNotificationFragment : Fragment() {
// Notifications about risk status // Notifications about risk status
val updateRiskNotificationSwitch = val updateRiskNotificationSwitch =
binding.settingsSwitchRowNotificationsRisk.settingsSwitchRowSwitch binding.settingsSwitchRowNotificationsRisk.settingsSwitchRowSwitch
val updateRiskNotificationRow =
binding.settingsSwitchRowNotificationsRisk.settingsSwitchRow
// Notifications about test status // Notifications about test status
val updateTestNotificationSwitch = val updateTestNotificationSwitch =
binding.settingsSwitchRowNotificationsTest.settingsSwitchRowSwitch binding.settingsSwitchRowNotificationsTest.settingsSwitchRowSwitch
val updateTestNotificationRow =
binding.settingsSwitchRowNotificationsTest.settingsSwitchRow
// Settings // Settings
val settingsRow = binding.settingsNavigationRowSystem.navigationRow val settingsRow = binding.settingsNavigationRowSystem.navigationRow
val goBack = val goBack =
...@@ -74,9 +70,6 @@ class SettingsNotificationFragment : Fragment() { ...@@ -74,9 +70,6 @@ class SettingsNotificationFragment : Fragment() {
settingsViewModel.toggleNotificationsRiskEnabled() settingsViewModel.toggleNotificationsRiskEnabled()
} }
} }
updateRiskNotificationRow.setOnClickListener {
settingsViewModel.toggleNotificationsRiskEnabled()
}
// Update Test // Update Test
updateTestNotificationSwitch.setOnCheckedChangeListener { _, _ -> updateTestNotificationSwitch.setOnCheckedChangeListener { _, _ ->
// android calls this listener also on start, so it has to be verified if the user pressed the switch // android calls this listener also on start, so it has to be verified if the user pressed the switch
...@@ -84,9 +77,6 @@ class SettingsNotificationFragment : Fragment() { ...@@ -84,9 +77,6 @@ class SettingsNotificationFragment : Fragment() {
settingsViewModel.toggleNotificationsTestEnabled() settingsViewModel.toggleNotificationsTestEnabled()
} }
} }
updateTestNotificationRow.setOnClickListener {
settingsViewModel.toggleNotificationsTestEnabled()
}
goBack.setOnClickListener { goBack.setOnClickListener {
(activity as MainActivity).goBack() (activity as MainActivity).goBack()
} }
......
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
app:showDivider="@{true}" app:showDivider="@{true}"
app:status="@{settingsViewModel.isNotificationsRiskEnabled()}" app:status="@{settingsViewModel.isNotificationsRiskEnabled()}"
app:statusText="@{FormatterSettingsHelper.formatStatus(settingsViewModel.isNotificationsRiskEnabled())}" app:statusText="@{FormatterSettingsHelper.formatStatus(settingsViewModel.isNotificationsRiskEnabled())}"
app:enabled="@{true}"
app:subtitle="@{@string/settings_notifications_subtitle_update_risk}" /> app:subtitle="@{@string/settings_notifications_subtitle_update_risk}" />
<include <include
...@@ -67,7 +68,8 @@ ...@@ -67,7 +68,8 @@
app:layout_constraintTop_toBottomOf="@+id/settings_switch_row_notifications_risk" app:layout_constraintTop_toBottomOf="@+id/settings_switch_row_notifications_risk"
app:showDivider="@{true}" app:showDivider="@{true}"
app:status="@{settingsViewModel.isNotificationsTestEnabled()}" app:status="@{settingsViewModel.isNotificationsTestEnabled()}"
app:statusText="@{FormatterSettingsHelper.formatStatus(settingsViewModel.isNotificationsRiskEnabled())}" app:enabled="@{true}"
app:statusText="@{FormatterSettingsHelper.formatStatus(settingsViewModel.isNotificationsTestEnabled())}"
app:subtitle="@{@string/settings_notifications_subtitle_update_test}" /> app:subtitle="@{@string/settings_notifications_subtitle_update_test}" />
<include <include
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment