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; return htmlParser;
} }
@SuppressWarnings("unused")
public static class Builder { public static class Builder {
private final Context context; private final Context context;

View File

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

View File

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

View File

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

View File

@ -12,11 +12,9 @@ public class BlockQuoteSpan implements LeadingMarginSpan {
private final SpannableTheme theme; private final SpannableTheme theme;
private final Rect rect = ObjectsPool.rect(); private final Rect rect = ObjectsPool.rect();
private final Paint paint = ObjectsPool.paint(); 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.theme = theme;
this.indent = indent;
} }
@Override @Override

View File

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