Merge lp:~mrasmus/tomdroid/fix-660116 into lp:~tomdroid-maintainers/tomdroid/main

Proposed by Matthew Rasmus
Status: Merged
Merged at revision: 222
Proposed branch: lp:~mrasmus/tomdroid/fix-660116
Merge into: lp:~tomdroid-maintainers/tomdroid/main
Diff against target: 40 lines (+6/-4)
2 files modified
res/layout/note_view.xml (+1/-1)
src/org/tomdroid/xml/NoteContentHandler.java (+5/-3)
To merge this branch: bzr merge lp:~mrasmus/tomdroid/fix-660116
Reviewer Review Type Date Requested Status
Tomdroid Maintainers Pending
Review via email: mp+43384@code.launchpad.net

Description of the change

The TextView in note_view was ignoring the indentation and bullets when wrapping (it would wrap for "Line 1" instead of " <> Line 1"). Changing its layout_width parameter to FILL_PARENT fixed this. Also, if a note began with more than one listItem's, the first item's bullet point would not appear (which has been fixed as well).

To post a comment you must log in.
Revision history for this message
Benoit Garret (benoit.garret) wrote :

Thanks for your work, merged.

Actually, list items at the beginning of a note would have their bullets rendered. The first characters of the note content always are the title and you can't really put lists in there. But the extra check doesn't hurt, so thanks for your eagle eyes.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'res/layout/note_view.xml'
--- res/layout/note_view.xml 2010-09-26 19:57:31 +0000
+++ res/layout/note_view.xml 2010-12-10 19:34:51 +0000
@@ -49,7 +49,7 @@
49 <TextView 49 <TextView
50 xmlns:android="http://schemas.android.com/apk/res/android"50 xmlns:android="http://schemas.android.com/apk/res/android"
51 android:id="@+id/content"51 android:id="@+id/content"
52 android:layout_width="wrap_content" 52 android:layout_width="fill_parent"
53 android:layout_height="wrap_content"53 android:layout_height="wrap_content"
54 android:singleLine="false"54 android:singleLine="false"
55 android:text="@string/strWait"55 android:text="@string/strWait"
5656
=== modified file 'src/org/tomdroid/xml/NoteContentHandler.java'
--- src/org/tomdroid/xml/NoteContentHandler.java 2010-08-30 16:33:02 +0000
+++ src/org/tomdroid/xml/NoteContentHandler.java 2010-12-10 19:34:51 +0000
@@ -213,7 +213,7 @@
213 inListItem = false;213 inListItem = false;
214 // TODO new sexier bullets?214 // TODO new sexier bullets?
215 // Show a leading margin that is as wide as the nested level we are in215 // Show a leading margin that is as wide as the nested level we are in
216 ssb.setSpan(new LeadingMarginSpan.Standard(10*inListLevel), listItemStartPos.get(inListLevel-1), listItemEndPos.get(inListLevel-1), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);216 ssb.setSpan(new LeadingMarginSpan.Standard(30*inListLevel), listItemStartPos.get(inListLevel-1), listItemEndPos.get(inListLevel-1), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
217 ssb.setSpan(new BulletSpan(), listItemStartPos.get(inListLevel-1), listItemEndPos.get(inListLevel-1), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);217 ssb.setSpan(new BulletSpan(), listItemStartPos.get(inListLevel-1), listItemEndPos.get(inListLevel-1), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
218 listItemStartPos.set(inListLevel-1, new Integer(0));218 listItemStartPos.set(inListLevel-1, new Integer(0));
219 listItemEndPos.set(inListLevel-1, new Integer(0));219 listItemEndPos.set(inListLevel-1, new Integer(0));
@@ -304,10 +304,12 @@
304 // Book keeping of where the list-items started and where they end304 // Book keeping of where the list-items started and where they end
305 // we need to do that because characters() can be called several times for the same tag305 // we need to do that because characters() can be called several times for the same tag
306 306
307 // if listItem's position not already in tracking array, add it. Otherwise if it equals 0 then set307 // if listItem's position not already in tracking array, add it.
308 // Otherwise if both the start and end positions equal 0 then set
309 // (the check on EndPos prevents some issues if a listItem starts at position 0).
308 if (listItemStartPos.size() < inListLevel) {310 if (listItemStartPos.size() < inListLevel) {
309 listItemStartPos.add(new Integer(strLenStart));311 listItemStartPos.add(new Integer(strLenStart));
310 } else if (listItemStartPos.get(inListLevel-1) == 0) {312 } else if (listItemStartPos.get(inListLevel-1) == 0 && listItemEndPos.get(inListLevel-1) == 0) {
311 listItemStartPos.set(inListLevel-1, new Integer(strLenStart)); 313 listItemStartPos.set(inListLevel-1, new Integer(strLenStart));
312 }314 }
313 // no matter what, we track the end (we add if array not big enough or set otherwise) 315 // no matter what, we track the end (we add if array not big enough or set otherwise)

Subscribers

People subscribed via source and target branches