mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-22 05:38:55 +00:00
fix task rendering
This commit is contained in:
parent
ff70591cc5
commit
864d968f72
2 changed files with 20 additions and 2 deletions
|
|
@ -58,8 +58,25 @@ public class BaseTaskViewHolder extends RecyclerView.ViewHolder implements View.
|
|||
public void bindHolder(Task newTask, int position) {
|
||||
this.task = newTask;
|
||||
if (this.canContainMarkdown()) {
|
||||
this.titleTextView.setText(this.task.parsedText);
|
||||
this.notesTextView.setText(this.task.parsedNotes);
|
||||
if (this.task.parsedText != null) {
|
||||
this.titleTextView.setText(this.task.parsedText);
|
||||
this.notesTextView.setText(this.task.parsedNotes);
|
||||
} else {
|
||||
this.titleTextView.setText(this.task.getText());
|
||||
this.notesTextView.setText(this.task.getNotes());
|
||||
Observable.just(this.task)
|
||||
.map(task1 -> {
|
||||
task.parsedText = MarkdownParser.parseMarkdown(task.getText());
|
||||
task.parsedNotes = MarkdownParser.parseMarkdown(task.getNotes());
|
||||
return task;
|
||||
})
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(task2 -> {
|
||||
this.titleTextView.setText(this.task.parsedText);
|
||||
this.notesTextView.setText(this.task.parsedNotes);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.titleTextView.setText(this.task.getText());
|
||||
this.notesTextView.setText(this.task.getNotes());
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ public abstract class ChecklistedViewHolder extends BaseTaskViewHolder implement
|
|||
@Override
|
||||
public void bindHolder(Task newTask, int position) {
|
||||
super.bindHolder(newTask, position);
|
||||
this.checkbox.setChecked(this.task.completed);
|
||||
if (this.shouldDisplayAsActive()) {
|
||||
this.checkboxHolder.setBackgroundResource(this.task.getLightTaskColor());
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue