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
1=== modified file 'res/layout/note_view.xml'
2--- res/layout/note_view.xml 2010-09-26 19:57:31 +0000
3+++ res/layout/note_view.xml 2010-12-10 19:34:51 +0000
4@@ -49,7 +49,7 @@
5 <TextView
6 xmlns:android="http://schemas.android.com/apk/res/android"
7 android:id="@+id/content"
8- android:layout_width="wrap_content"
9+ android:layout_width="fill_parent"
10 android:layout_height="wrap_content"
11 android:singleLine="false"
12 android:text="@string/strWait"
13
14=== modified file 'src/org/tomdroid/xml/NoteContentHandler.java'
15--- src/org/tomdroid/xml/NoteContentHandler.java 2010-08-30 16:33:02 +0000
16+++ src/org/tomdroid/xml/NoteContentHandler.java 2010-12-10 19:34:51 +0000
17@@ -213,7 +213,7 @@
18 inListItem = false;
19 // TODO new sexier bullets?
20 // Show a leading margin that is as wide as the nested level we are in
21- ssb.setSpan(new LeadingMarginSpan.Standard(10*inListLevel), listItemStartPos.get(inListLevel-1), listItemEndPos.get(inListLevel-1), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
22+ ssb.setSpan(new LeadingMarginSpan.Standard(30*inListLevel), listItemStartPos.get(inListLevel-1), listItemEndPos.get(inListLevel-1), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
23 ssb.setSpan(new BulletSpan(), listItemStartPos.get(inListLevel-1), listItemEndPos.get(inListLevel-1), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
24 listItemStartPos.set(inListLevel-1, new Integer(0));
25 listItemEndPos.set(inListLevel-1, new Integer(0));
26@@ -304,10 +304,12 @@
27 // Book keeping of where the list-items started and where they end
28 // we need to do that because characters() can be called several times for the same tag
29
30- // if listItem's position not already in tracking array, add it. Otherwise if it equals 0 then set
31+ // if listItem's position not already in tracking array, add it.
32+ // Otherwise if both the start and end positions equal 0 then set
33+ // (the check on EndPos prevents some issues if a listItem starts at position 0).
34 if (listItemStartPos.size() < inListLevel) {
35 listItemStartPos.add(new Integer(strLenStart));
36- } else if (listItemStartPos.get(inListLevel-1) == 0) {
37+ } else if (listItemStartPos.get(inListLevel-1) == 0 && listItemEndPos.get(inListLevel-1) == 0) {
38 listItemStartPos.set(inListLevel-1, new Integer(strLenStart));
39 }
40 // 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