Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Settings switches don't work when sliding them #607

Closed
tomjschwanke opened this issue Jun 17, 2020 · 5 comments · Fixed by #612
Closed

Settings switches don't work when sliding them #607

tomjschwanke opened this issue Jun 17, 2020 · 5 comments · Fixed by #612
Assignees
Labels
bug Something isn't working in progress The issue is currently being resolved

Comments

@tomjschwanke
Copy link
Contributor

tomjschwanke commented Jun 17, 2020

Describe the bug

When you slide a switch in the app settings, the option doesn't change.

Expected behaviour

When sliding a switch in the app settings the option should change.

Steps to reproduce the issue

Go into the apps settings, to notifications or tracing.
Instead of clicking the switch, drag / slide it manually with your finger.
See that the option did not change.

Technical details

OnePlus 7 Pro OxygenOS 10 (Android 10)
App version 1.0.0

Possible Fix

Add an additional listener, I'll look into it.

@tomjschwanke tomjschwanke added the bug Something isn't working label Jun 17, 2020
@tomjschwanke
Copy link
Contributor Author

tomjschwanke commented Jun 17, 2020

Adding a simple OnDragListener wouldn't really work, as the user might start sliding it, but then slide it back, so only having the toggleSetting() function doesn't really help.
We'd either need a setSetting(boolean state) or get the switch position before the user starts sliding and on USER_DRAG_FINISHED (or similar) compare the previous state with the current one and toggle or don't toggle accordingly.

@kolyaopahle
Copy link
Contributor

I think setOnCheckedChangeListener is the proper listener for this?

@kolyaopahle kolyaopahle self-assigned this Jun 17, 2020
@kolyaopahle kolyaopahle added the in progress The issue is currently being resolved label Jun 17, 2020
@tomjschwanke
Copy link
Contributor Author

setOnCheckedChangeListener leaves the options quickly flickering on and off for me.

@kolyaopahle kolyaopahle linked a pull request Jun 17, 2020 that will close this issue
8 tasks
@kolyaopahle
Copy link
Contributor

i did some work in #612 can you check if the flickering happens there for you?

@tomjschwanke
Copy link
Contributor Author

This works perfectly, no flickering happening

harambasicluka added a commit that referenced this issue Jul 1, 2020
* Changed setOnClickListener to setOnCheckedChangeListener to allow for swipe input on the settings switch

Signed-off-by: Kolya Opahle <k.opahle@sap.com>

* More changes of setOnClickListener to setOnCheckedChangeListener

Signed-off-by: Kolya Opahle <k.opahle@sap.com>

* Added isAccessibilityFocused check to support talk back

* DataBinding now sets a tag on switch when changing its status via code

Co-authored-by: harambasicluka <64483219+harambasicluka@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working in progress The issue is currently being resolved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants