Skip to content
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

Rich text editing for notes #45

Open
avram opened this issue Oct 19, 2011 · 13 comments
Open

Rich text editing for notes #45

avram opened this issue Oct 19, 2011 · 13 comments

Comments

@avram
Copy link
Owner

avram commented Oct 19, 2011

As of 7aa1680, rich text notes are displayed properly. We need a way to edit them as rich text; the status quo is that they are edited as raw HTML. Current thinking is to do this with SpannableString, either by writing our own implementation or by importing someone else's, like droid-writer.

@avram
Copy link
Owner Author

avram commented Oct 22, 2011

When things calm down, try http://code.google.com/p/droid-writer/

@mlt
Copy link
Contributor

mlt commented Nov 30, 2011

Could WebView be used meanwhile with that TinyMCE meanwhile? Or is it gonna be too heavy?

@avram
Copy link
Owner Author

avram commented Nov 30, 2011

I'll look into it-- it may well be OK.

@mlt
Copy link
Contributor

mlt commented Dec 1, 2011

(only) Rendering for standalone notes works okay with WebView. However I'm new to android so I ended up adding WebView to list_data.xml to the same row as regular TextView. I make it invisible unless "label" is "note". Perhaps it is a bit ugly to have an extra widget and not showing it thus wasting resources. Otherwise I don't know how could I reuse view without inflating it every time.
I want to fiddle around with attached notes first before I push changes.

@avram
Copy link
Owner Author

avram commented Dec 2, 2011

Sounds exciting! If you get the basic functionality working with WebView, we can work out the resource implications later. It should be possible to use a separate layout only when needed, but that should be a simple change and we can leave it for now.

@mlt
Copy link
Contributor

mlt commented Dec 2, 2011

Turned out that jwysiwyg doesn't want to work inside of the WebView :( I didn't try anything else. Here is yet another approach to reuse wordpress editor.

Update
Turned out that TinyMCE does work as well as Yahoo's yui. However it is a pain to use from android browser. Perhaps html display with WebView and editing as a plain text may be enough.

@avram
Copy link
Owner Author

avram commented Dec 2, 2011

Do you have a version using TinyMCE built or tagged? Maybe we can get it working by tweaking TinyMCE some.

@mlt
Copy link
Contributor

mlt commented Dec 2, 2011

The HEAD of my repo has TinyMCE working. But it is a PITA to actually use it.

I think it worth adding a setting if user wants just to see notes and edit as html, or use TinyMCE for everything. The problem is with navigation. I can't move cursor in emulator. It jumps from field to field instead of moving between characters. I still have to try it on a real hardware.

I've made a stripped copy. Perhaps git submodule with pre-build step to copy jscripts folder would be better. I don't know if git and release versions of TinyMCE are different. Probably they do squeeze space out of javascripts.

@avram
Copy link
Owner Author

avram commented Dec 5, 2011

I worked on this some yesterday in the richtext branch (https://github.com/ajlyon/zandy/tree/richtext) -- good work getting something going. Now that I've seen what TinyMCE is like on my phone (Android 2.2, LG Optimus), I see why you shied away from using it. My current approach is using the WebView to display only, as you proposed, but I can't get the WebView to update when I send it new content, and I'm still struggling to get the back button to work. So there's still work to be done!

I'll be quiet on this front for several more days, since I have obligations at university for about one week more. Then I'll see what I can do on this and other major Zandy features.

@avram
Copy link
Owner Author

avram commented Dec 11, 2011

An option to not use WebView, which might be better for performance: http://developer.android.com/reference/android/text/Html.html

@mlt
Copy link
Contributor

mlt commented Dec 14, 2011

So what would be the view (class) that shows converted html?

@avram
Copy link
Owner Author

avram commented Dec 14, 2011

We can pass a SpannableString to the standard TextView.

@avram
Copy link
Owner Author

avram commented Dec 20, 2011

I moved this to Html in c3796da and 7aa1680; the revised version is pretty clean and quite serviceable for now. Since we don't need full-fledged rich text, we might be able to roll our own solution using SpannableString. I'll also run titles through Html before display, since there are styled titles out there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants