Allow TaskListSpan isDone mutation
This commit is contained in:
parent
65ece1621c
commit
b531684872
@ -18,7 +18,9 @@ public class TaskListSpan implements LeadingMarginSpan {
|
|||||||
|
|
||||||
private final SpannableTheme theme;
|
private final SpannableTheme theme;
|
||||||
private final int blockIndent;
|
private final int blockIndent;
|
||||||
private final boolean isDone;
|
|
||||||
|
// @since 2.0.1 field is NOT final (to allow mutation)
|
||||||
|
private boolean isDone;
|
||||||
|
|
||||||
public TaskListSpan(@NonNull SpannableTheme theme, int blockIndent, boolean isDone) {
|
public TaskListSpan(@NonNull SpannableTheme theme, int blockIndent, boolean isDone) {
|
||||||
this.theme = theme;
|
this.theme = theme;
|
||||||
@ -26,6 +28,23 @@ public class TaskListSpan implements LeadingMarginSpan {
|
|||||||
this.isDone = isDone;
|
this.isDone = isDone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @since 2.0.1
|
||||||
|
*/
|
||||||
|
public boolean isDone() {
|
||||||
|
return isDone;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update {@link #isDone} property of this span. Please note that this is merely a visual change
|
||||||
|
* which is not changing underlying text in any means.
|
||||||
|
*
|
||||||
|
* @since 2.0.1
|
||||||
|
*/
|
||||||
|
public void setDone(boolean isDone) {
|
||||||
|
this.isDone = isDone;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getLeadingMargin(boolean first) {
|
public int getLeadingMargin(boolean first) {
|
||||||
return theme.getBlockMargin() * blockIndent;
|
return theme.getBlockMargin() * blockIndent;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user