Heh…. this morning I posted that I’d put highlighting aside for a while, and immediately a Market comment popped up requesting highlighting…

I figured it ight be a good idea to explain why highlighting is difficult and what I’ve done so far.

The problem isn’t so much in highlighting, but in finding a way that allows reliable text selection over all versions of Android that we support. Android 2.3 added basic support, and ICS added more comprehensive support for selecting text, but in both these cases you get a popup with copy / paste operations.

What I would want for PageTurner is that when the user long-presses a word, 2 markers appear at the boundaries of that word. The user can then drag those markers to select different portions of the text. Finally, either after a short delay or by touching the selection, a dialog pops up that offers options like:

  • Look up on Wikipedia
  • Look up in dictionary
  • Copy to clipboard
  • Share text
  • Highlight

Some of these options are already supported by long-pressing a single word, but I’d want them to be available for all selected text.

I have been hunting around StackOverflow and found some interesting posts about using an EditText instead of a TextView and configuring it to be non-editable. This allows text selection. Unfortunately, this method is incompatible with using a LinkMovementMethod, which means that clicking links no longer works.

The TextView on Android 4 has a textSelectable() property, but this always pops up a dialog with default text-edit actions, plus it would make this feature only available for a part of the users.

So… my conclusion so far is that if I want reliable text selection, I’ll have to code it myself including the code to draw and move the markers. This seems to be a strategy followed by a lot of apps, judging by the variation in selection markers I have seen.

This would require a couple of days of focused coding, something I simply don’t have the time for right now… So yes, selection is absolutely still planned, but it might take some time to get here.

Update, Dec 5: it’s a couple of months later, and I have made some interesting progress on this issue.

  • Instead of using LinkMovementMethod I can check if there is a ClickableSpan in the part of the text that has just been clicked and then activate that
  • I figured out how to customize the Android 4+ popup when selecting text.

This means that if I choose to only support text selection on newer platforms, I’m all set. I still want to give the 2.3 version a go though, since that would mean text-selection becomes available to a lot more users.


Site update & current priorities

I’ve updated the site so I can now keep a dev blog about the current activity on PageTurner development.

Right now I’m taking it pretty slow in adding new features since most of my time has to be dedicated to work and my MSc thesis. Still, I am dedicated to keeping up development for PageTurner.

What I’ve been working on:

  • Text selection / underline / share – I’ve been running experiments on how to get this working, but no luck so far. I’ve decided to let it rest for a while and give it a fresh look in a couple of weeks.
  • Keep screen on – A number of Dutch comments popped up on the Google Play market requesting this feature. It was pretty simple to add, so it’s now in the 1.3.4 release.
  • ICS issues – I got a new phone and tablet running Android 4.0.3 and this made some issues with Android 4 more apparent, most specifically the black borders when doing page-flips. This has been fixed in 1.3.4. Apart from that I’m pretty pleased with how well PageTurner works on Android 4 devices and / or bigger screens.

And of course the big one: page numbers.

When I started building PageTurner I thought page numbers made little sense for an e-reader that supports multiple devices and screen sizes. Considering the amount of people that have requested the addition of page numbers though, I have changed my stance. This means that I’ll be making it a priority to add page numbers to PageTurner.

There are a number of technical issues to work through though, mainly to do with performance. The best bet is probably to calculate the amount of pages for the book when importing books into the library, but I’ll have to run some tests to see if that is a viable strategy.

And finally a little personal pet peeve: the Google Play market is a great place to leave general feedback about what you like or dislike about the app.

It’s not so great for leaving feedback about technical issues though… the biggest problem is that I get no contact info whatsoever, so I can’t actually help resolve your issue. The same thing goes for feature requests: if there’s something you’d like to see added to PageTurner it helps a lot for me to be able to discuss it, ask questions, etc.

So… if there is something you would like support on, please either send e-mail to info@pageturner-reader.org or post in the forums… I’ll be more than happy to assist you and make sure you have the best reading experience possible. Also: if something doesn’t work, crashes or is just unclear… let me know. This kind of feedback is vital to making this app better for everyone.

OK, until next time :)