-
Notifications
You must be signed in to change notification settings - Fork 980
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
Added delay after toggling a habit and before sorting #1102
Conversation
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 for the PR, @kalina559.
R.id.actionSortColor -> { | ||
behavior.onSortByColor() | ||
{ behavior.onSortByColor() }.delay(SORT_DELAY_MILLIS) | ||
return true | ||
} |
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.
We don't need to delay the menu actions; changing the order should be done immediately. Could you please remove all calls to delay
in this file?
if (preferences.isSkipEnabled) { | ||
{ | ||
onToggle(value) | ||
performHapticFeedback(HapticFeedbackConstants.LONG_PRESS) | ||
invalidate() | ||
}.delay(TOGGLE_DELAY_MILLIS) | ||
} else { | ||
onToggle(value) | ||
performHapticFeedback(HapticFeedbackConstants.LONG_PRESS) | ||
invalidate() | ||
} |
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.
- We can apply the delay in all cases (not only when skips are enabled).
- I just realized that this solution unfortunately breaks the ripple effect. The ripple effect should play immediately after the checkmark is entered, but it's currently playing seconds after. I think a better place to add the delay might be around line 143 of HabitCardView.kt.
Closing the PR due to inactivity. If you are still working on this, please let me know and I can reopen it. |
I'm not sure about the exact delay lengths, these seems fine though. Also, should I add any delay after clicking the "Hide completed" checkbox? Resolves #1055