Text Wrap

Text wrap may seem like a trivial feature to implement. After all, it should only be a matter of breaking lines at the right places. However, DroidEdit uses an extended version of the EditText class that comes with the Android SDK to simplify most of the editing stuff (copy/cut/paste, selections, cursor and drawing text in general) and changing some of its internal behaviors isn’t easy at all.

I’ve been trying to get it working for some time now and I think I finally have a reasonable working solution with minimum compromises. So, since version 1.6 you can enable text wrapping in the preferences screen of DroidEdit. Keep in mind that this is the first version having this feature and that there is plenty of new code, so some things might not work as expected. Please be patient and report any bugs in this post.

Known outstanding issues:

  • One strange thing that you might notice is that DroidEdit will never break a word in half. This might seem odd when editing code, specially if you are using a small screen. The reason for this is, once again, the EditText class. This class was not meant to edit code and I still haven’t figured out how to workaround this problem.
  • DroidEdit may become very slow with larger files if text wrapping is active.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s