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

Added delay after toggling a habit and before sorting #1102

Closed
wants to merge 2 commits into from

Conversation

kalina559
Copy link
Collaborator

@kalina559 kalina559 commented Sep 12, 2021

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

Copy link
Owner

@iSoron iSoron left a 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.

Comment on lines 126 to 129
R.id.actionSortColor -> {
behavior.onSortByColor()
{ behavior.onSortByColor() }.delay(SORT_DELAY_MILLIS)
return true
}
Copy link
Owner

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?

Comment on lines +92 to +102
if (preferences.isSkipEnabled) {
{
onToggle(value)
performHapticFeedback(HapticFeedbackConstants.LONG_PRESS)
invalidate()
}.delay(TOGGLE_DELAY_MILLIS)
} else {
onToggle(value)
performHapticFeedback(HapticFeedbackConstants.LONG_PRESS)
invalidate()
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. We can apply the delay in all cases (not only when skips are enabled).
  2. 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.

@iSoron
Copy link
Owner

iSoron commented Sep 29, 2021

Closing the PR due to inactivity. If you are still working on this, please let me know and I can reopen it.

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

Successfully merging this pull request may close these issues.

Introduce a small delay between toggling a check mark and hiding the habit or sorting the list
2 participants