[ReaderHighlight] NT: add better support for extending highlights#13917
Conversation
|
Not familiar with select_mode, @hius07 is probably most apt to review this. |
|
Any comments? |
| this:startSelection(index) | ||
| this:onClose() | ||
| if not Device:isTouchDevice() then | ||
| self:onStartHighlightIndicator() |
| return true | ||
| end | ||
| -- Check if we're in select mode (or extending an existing highlight) | ||
| if self.select_mode and self.highlight_idx then |
There was a problem hiding this comment.
highlight_idx always exists in the select mode.
There was a problem hiding this comment.
I don't understand NT things, is onHighlightPress a combination of tap and hold?
On touch devices the action onTap in select mode depends on whether we tap a starting fragment or not:
koreader/frontend/apps/reader/modules/readerhighlight.lua
Lines 1029 to 1031 in b2f9530
There was a problem hiding this comment.
NT essentially fakes all touch gestures, depending on context onHighlightPress is either a tap, or a hold or a hold release. In this case following the exact touch device behaviour was cumbersome with buttons, so i made some adjustments, tapping the first fragment is now replaced by pressing back (makes more sense) and the double step selection also didn’t make much sense, see the screen recording at the top
what's new
frontend/apps/reader/modules/readerhighlight.lua: Updatedinit()to conditionally triggeronStartHighlightIndicator()for non-touch devices.frontend/apps/reader/modules/readerhighlight.lua: EnhancedonHighlightPress()to handle select mode, improving the user experience for extending highlights.frontend/apps/reader/modules/readerhighlight.lua: UpdatedonStopHighlightIndicator()to properly end selection mode when the user presses back. Temporary highlights are deleted, and UI regions are refreshed for non-temporary highlights.related PRs
screen recording
This change is