btate / BTAndroidWebViewSelection

Example user selection for android web views.
313 stars 126 forks source link

drag handlers not showing on next page #8

Open coder4567 opened 11 years ago

coder4567 commented 11 years ago

Hy, I'm applying the selection on a webview which is put horizontally, so I scroll over the webview horizontally to go from a page to another. when I want to make the selection the drag handlers show only on the first page but do not show on the others, while the quickAction popupwindow and the actual selection show everywhere. I tried to manipulate the x of startParams in drawSelectionHandlesHandler I decrease it by the screen width so it can show on the next page, but still not working. when I apply createSelectionLayer(context) the context given is the one of the webview, I was wondering if there is a way to give the context of the parentLayer where the webview is initialized. Any suggestion or hint would be appreciated, Thanks in advance!

btate commented 11 years ago

I'm not sure I follow you.

coder4567 commented 11 years ago

ok, here's the thing, I'm working on an ebook project, so my webview's width depends on the number of pages I have in each chapter. when I go to the second page in my webview using the following javascript ("javascript:window.HTMLOUT.scrolltopage(window.scrollTo("+ scrollToX + ",0));";) and I try to do the selection, the start handle and the end handle show on the first page instead, while the popwindow and the selection show on the second page(where their supposed to show); I'm wondering how can I modify the startHandle and endHandle to show on the second page as well. I tried to manipulate their coordinate in drawSelectionHandlesHandler by changing the x of startParams and endParams, but it didn't work they just disappeared instead. I hope you can give me a suggestion that I can work on, thank you

coder4567 commented 11 years ago

oh well problem solved I had to increase layerParams.width before manipulating the coordinates that's why it was disappearing, Anyway thank u, and hope this helps someone.

spdeepa commented 11 years ago

I too had a problem in this. draghandler in not visible in second page. I too working on ebook project Can you please say how you highlighted the selectedText after user press button in contextmenu and i need to select more than one selection in a single page that is i dont want to clear the selection after user highlighted.

btate commented 11 years ago

I don't have support for multiple selections. The highlighting was adding css. The rangy library supports this. It's something along these lines rangy.createCssClassApplier("highlighted", true); You'll need this module to make it work, http://code.google.com/p/rangy/wiki/CSSClassApplierModule