Small clean-up

This commit is contained in:
Dimitry Ivanov 2017-11-05 12:55:36 +03:00
parent 6b1fb554f2
commit a221ba7ea3
6 changed files with 13 additions and 9 deletions

View File

@ -60,6 +60,7 @@ public class SpannableConfiguration {
return htmlParser;
}
@SuppressWarnings("unused")
public static class Builder {
private final Context context;

View File

@ -2,5 +2,8 @@ package ru.noties.markwon;
import android.text.Spanned;
/**
* @since 1.0.1
*/
interface SpannedReversed extends Spanned {
}

View File

@ -5,6 +5,7 @@ import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.text.TextUtils;
@SuppressWarnings({"unused", "WeakerAccess"})
public class UrlProcessorAndroidAssets implements UrlProcessor {
private final UrlProcessorRelativeToAbsolute assetsProcessor

View File

@ -113,10 +113,7 @@ public class SpannableMarkdownVisitor extends AbstractVisitor {
visitChildren(blockQuote);
setSpan(length, new BlockQuoteSpan(
configuration.theme(),
blockQuoteIndent
));
setSpan(length, new BlockQuoteSpan(configuration.theme()));
blockQuoteIndent -= 1;

View File

@ -12,11 +12,9 @@ public class BlockQuoteSpan implements LeadingMarginSpan {
private final SpannableTheme theme;
private final Rect rect = ObjectsPool.rect();
private final Paint paint = ObjectsPool.paint();
private final int indent;
public BlockQuoteSpan(@NonNull SpannableTheme theme, int indent) {
public BlockQuoteSpan(@NonNull SpannableTheme theme) {
this.theme = theme;
this.indent = indent;
}
@Override

View File

@ -12,6 +12,10 @@ import android.text.style.LeadingMarginSpan;
*/
public class TaskListSpan implements LeadingMarginSpan {
private static final int[] STATE_CHECKED = new int[]{android.R.attr.state_checked};
private static final int[] STATE_NONE = new int[0];
private final SpannableTheme theme;
private final int blockIndent;
private final boolean isDone;
@ -54,9 +58,9 @@ public class TaskListSpan implements LeadingMarginSpan {
if (drawable.isStateful()) {
final int[] state;
if (isDone) {
state = new int[]{android.R.attr.state_checked};
state = STATE_CHECKED;
} else {
state = new int[0];
state = STATE_NONE;
}
drawable.setState(state);
}