-
Notifications
You must be signed in to change notification settings - Fork 368
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
WIP: ToDo widget text highlighting #2452
base: master
Are you sure you want to change the base?
Conversation
See how the text in the Todo txt dialogs are highlighted. This will be a 1 function call |
@@ -86,4 +94,84 @@ public long getItemId(int position) { | |||
public boolean hasStableIds() { | |||
return false; | |||
} | |||
|
|||
private Spannable getTaskSpannable(TodoTxtTask task) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This static function will return a highlighter callable which can apply todotxt highlighting to a spannable.
So simply
final GsCallback.a1<Spannable> hl = getSttHighlighter();
for (Spannable s : lines) {
hl.callback(s)
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will highlight every line in lines
You will need to make getSttHighlighter public and move it somewhere appropriate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final GsCallback.a1<Spannable> hl = getSttHighlighter();
Spannable s = new SpannableString(_tasks.get(position).getLine());
hl.callback(s);
views.setTextViewText(R.id.todo_widget_item_text, s);
I couldn't make it work. What is wrong here?
It's also very important to remove creation dates, priority parentheses, etc. as they take up valuable space especially on narrower screens. How would that be achieved?,
from me:
|
Where should I get color from?