-
-
Notifications
You must be signed in to change notification settings - Fork 195
Display unpinned clipboard items on top #1903
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
Display unpinned clipboard items on top #1903
Conversation
|
Yes, this should definitely be optional as I expect it may break flow many people are used to. |
|
Added setting. Also:
|
Definitely fine and makes sense. Not sure why it was actually nullable, while other variable were lateinit from the start (1cbbf49).
This is only triggered when changing the setting in the settings screen, so being inefficient and reloading twice is not an issue. |
| override fun compareTo(other: ClipboardHistoryEntry): Int { | ||
| val result = other.isPinned.compareTo(isPinned) | ||
| var result = other.isPinned.compareTo(isPinned) | ||
| if (Settings.getValues()?.mClipboardHistoryUnpinnedFirst == true) result = -result |
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.
Did you have some issues where SettingsValues were not yet loaded when the list is being sorted?
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.
Yes, before I removed this line. But then I decided to keep this safe call just in case.
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! Reproduced and fixed by loading settings before calling ClipboardHistoryManager.onCreate
That doesn't work, because the
I have. |
Reorder comparison logic.
|
Reordered comparison logic, to make it slightly more efficient, and maybe a bit clearer. |
I think that doesn't matter, but the |
Does this change need to be optional?
Fixes #1902, fixes #1976.