-
Notifications
You must be signed in to change notification settings - Fork 496
Make entire SettingsRow toggle the setting (closes #455) #466
Make entire SettingsRow toggle the setting (closes #455) #466
Conversation
…t the SettingsSwitchRowSwitch
(copy from the other PR, but still relevant) Todo: maybe fix the animation, stock Android has a little animation, filling the box from where you tapped. In the current implementation, it lights up the entire box immediately |
Hi @tomjschwanke , thanks for your contribution! But it isn't as easy as it's in your PR, at least for the settings tracing switch. We already had your proposal implemented but removed it because we had to introduce more complexity to the switch and the row. And to be consistent we also removed it for the simpler notification switch rows. So with the clickable row states like this can occur - the text says Reproduce:
That's only one wrong state maybe there are others. If you can fix this I'm happy to include your PR, but you would have to provide a list of manual tests. After this I'll verify that everything is working like expected and also that accessibility isn't broken with this new click target.
*circle has to be disabled via another formatter If you aren't willing to do this please close this PR. Cheers, PS: To avoid misunderstandings: we would like to have this in, but only if it works as expected :) |
Ahh I get it. Hitting the switch doesnt work now, as the switch doesn't have an OnClickListener anymore (thats on the Row now). This affects all switches. We'd just need to set an OnClickListener on both and update the other accordingly, I will look into this. I can't follow your steps, as I am unable to sign the app with the correct key (and therefore can't enable tracing), so once I come up with a potential fix, you'd need to test it. |
…rking. Switches AND Rows now have an OnClickListener to change the setting.
I have changed it back to the way it was before, but added additional OnClickListeners for the Rows. Notification settings now toggle when clicking either on the Row or on the Switch. The tracing switch should behave the same. Before, I was able to change the Switch but it had no effect (as there was no OnClickListener bound to it) but now when I hit the switch, it gives me the Error message (because it's not signed).
|
Scanned with Accessibility scanner by Google
I have already merged the switch sliding fix into this locally to test it, and everything is working. |
When using talkback, tapping on the settings row says "on" / "off" depending on the switch position. It only reads the corresponding text on the second tap and every tap afterwards (until going back and going into the settings again). This also happens in the production version, so this PR doesn't change that. |
Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/settings/SettingsNotificationFragment.kt
Outdated
Show resolved
Hide resolved
Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/settings/SettingsNotificationFragment.kt
Outdated
Show resolved
Hide resolved
@@ -101,6 +102,10 @@ class SettingsTracingFragment : Fragment(), | |||
switch.setOnClickListener { | |||
startStopTracing() | |||
} | |||
// Additional click target to toggle switch | |||
row.setOnClickListener { | |||
startStopTracing() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implemented in commit 0dc17a1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the check has to be added here
It seems to work fine with Talkback :) |
…r) checking if row is enabled before executing action
|
Thank's for the fast implementation, the builds due to a missing space. Click on Than you can open this Report: https://2305-268027139-gh.circle-artifacts.com/0/reports/ktlint/ktlintMainSourceSetCheck.txt To reproduce this locally run |
Thanks, I'm not used to CircleCI and style enforcement yet. |
Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/settings/SettingsTracingFragment.kt
Outdated
Show resolved
Hide resolved
@@ -101,6 +102,10 @@ class SettingsTracingFragment : Fragment(), | |||
switch.setOnClickListener { | |||
startStopTracing() | |||
} | |||
// Additional click target to toggle switch | |||
row.setOnClickListener { | |||
startStopTracing() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the check has to be added here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 💯
(put this in a new PR to not merge from master into dev)
fixes #455
Checklist
Description
#455 mentioned the settings being only toggleable by hitting the switch. This PR makes the entire SettingsRow toggle the switch, making it behave like stock Android settings.