Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why deplay 600ms when click success? #74

Closed
Mystery00 opened this issue Dec 4, 2023 · 9 comments
Closed

Why deplay 600ms when click success? #74

Mystery00 opened this issue Dec 4, 2023 · 9 comments

Comments

@Mystery00
Copy link

Mystery00 commented Dec 4, 2023

coroutine.launch {
onDisableInput()
delay(BaseConstants.SUCCESS_DISMISS_DELAY)
onSelection()
onFinished()

After a successful operation, I noticed a delay of approximately 600 milliseconds before the completion callback for the subsequent operation is triggered. I'm curious about the reason behind this design. What is the intended purpose of this delay? I would appreciate an explanation. Thank you!

@Mystery00 Mystery00 changed the title why deplay 600ms when click success? Why deplay 600ms when click success? Dec 4, 2023
@Mystery00
Copy link
Author

Maybe provide a setting to adjust the delay time?

@maxkeppeler
Copy link
Owner

The 600ms delay happens when hiding the button view. This delay ensures the completion of the item animation for selection, preventing the dialog or view from disappearing abruptly. However, this delay is not applied if the dialog or view includes buttons.

The delay occurs before any listeners are triggered and before the dialog closes. A shorter delay might lead to issues, but using the buttons view could be more suitable for your use case. Once the user clicks the positive button, the dialog closes immediately.

@Mystery00
Copy link
Author

I still think that when there is no button displayed, a shorter delay should be provided for a better user experience. But I respect your existing logic.
Perhaps a delay of 600 ms provides a better experience on some low-spec devices, ensuring smooth animations without sudden disappearance of dialog boxes. Nonetheless, on high-spec devices, a 600 ms delay after clicking might give the impression that the app is unresponsive.
I will attempt to replace certain scenarios with a dialog format to avoid this delay.
I also want to express my gratitude to you for your contributions to this project and for taking the time to address my issues.

@maxkeppeler
Copy link
Owner

Can you show me a recording of this scenario? I remember that the duration of selection animations was up to 600 ms, which is why it's set to 600 ms. However, if I'm wrong and it's less, we can reduce it. A minimum would be around 300 ms.

@maxkeppeler maxkeppeler reopened this Jan 2, 2024
@Mystery00
Copy link
Author

@Mystery00
Copy link
Author

@Nek-12
Copy link

Nek-12 commented Jan 17, 2024

I agree, this delay is too much. The screencasts above clearly show that the app hangs for 600ms

@maxkeppeler
Copy link
Owner

Will be fixed when I find the time, promised!

@maxkeppeler
Copy link
Owner

I will go for a 300ms delay. Looks fine to me with the OptionDialog and CalendarDialog. If you see any issues due to this change, let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants