|
4 | 4 | import android.graphics.Typeface;
|
5 | 5 | import android.os.Bundle;
|
6 | 6 | import android.preference.PreferenceManager;
|
7 |
| -import android.text.TextUtils; |
8 | 7 | import android.text.method.LinkMovementMethod;
|
9 | 8 | import android.util.TypedValue;
|
10 | 9 | import android.view.LayoutInflater;
|
@@ -76,28 +75,28 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
76 | 75 | markdownProcessor.factory(TextFactory.create());
|
77 | 76 | markdownProcessor.config(
|
78 | 77 | MarkDownUtil.getMarkDownConfiguration(noteContent.getContext())
|
79 |
| - .setOnTodoClickCallback((view, line, lineNumber) -> { |
80 |
| - String[] lines = TextUtils.split(note.getContent(), "\\r?\\n"); |
81 |
| - /* |
82 |
| - * Workaround for a bug when checkbox is the last line: |
83 |
| - * When (un)checking a checkbox which is in the last line, every time it gets toggled, the last character of the line gets lost. |
84 |
| - */ |
85 |
| - if ((lines.length - 1) == lineNumber) { |
86 |
| - if(lines[lineNumber].contains("- [ ]")) { |
87 |
| - lines[lineNumber] = lines[lineNumber].replace("- [ ]", "- [x]"); |
88 |
| - } else { |
89 |
| - lines[lineNumber] = lines[lineNumber].replace("- [x]", "- [ ]"); |
90 |
| - } |
91 |
| - |
92 |
| - } else if (lines.length >= lineNumber) { |
93 |
| - lines[lineNumber] = line; |
94 |
| - } |
95 |
| - changedText = TextUtils.join("\n", lines); |
96 |
| - noteContent.setText(markdownProcessor.parse(changedText)); |
97 |
| - saveNote(null); |
98 |
| - return line; |
99 |
| - } |
100 |
| - ) |
| 78 | +// .setOnTodoClickCallback((view, line, lineNumber) -> { |
| 79 | +// String[] lines = TextUtils.split(note.getContent(), "\\r?\\n"); |
| 80 | +// /* |
| 81 | +// * Workaround for a bug when checkbox is the last line: |
| 82 | +// * When (un)checking a checkbox which is in the last line, every time it gets toggled, the last character of the line gets lost. |
| 83 | +// */ |
| 84 | +// if ((lines.length - 1) == lineNumber) { |
| 85 | +// if(lines[lineNumber].contains("- [ ]")) { |
| 86 | +// lines[lineNumber] = lines[lineNumber].replace("- [ ]", "- [x]"); |
| 87 | +// } else { |
| 88 | +// lines[lineNumber] = lines[lineNumber].replace("- [x]", "- [ ]"); |
| 89 | +// } |
| 90 | +// |
| 91 | +// } else if (lines.length >= lineNumber) { |
| 92 | +// lines[lineNumber] = line; |
| 93 | +// } |
| 94 | +// changedText = TextUtils.join("\n", lines); |
| 95 | +// noteContent.setText(markdownProcessor.parse(changedText)); |
| 96 | +// saveNote(null); |
| 97 | +// return line; |
| 98 | +// } |
| 99 | +// ) |
101 | 100 | .build());
|
102 | 101 | setActiveTextView(noteContent);
|
103 | 102 | noteContent.setText(markdownProcessor.parse(note.getContent()));
|
|
0 commit comments