Prepare 4.5.0 release
This commit is contained in:
parent
e4bfe9f790
commit
6cd53c340f
@ -1,6 +1,6 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
# SNAPSHOT
|
# 4.5.0
|
||||||
|
|
||||||
#### Added
|
#### Added
|
||||||
* `core` - `MovementMethodPlugin.none()`, `MovementMethodPlugin.link()` factory methods
|
* `core` - `MovementMethodPlugin.none()`, `MovementMethodPlugin.link()` factory methods
|
||||||
|
@ -8,7 +8,7 @@ android.enableJetifier=true
|
|||||||
android.enableBuildCache=true
|
android.enableBuildCache=true
|
||||||
android.buildCacheDir=build/pre-dex-cache
|
android.buildCacheDir=build/pre-dex-cache
|
||||||
|
|
||||||
VERSION_NAME=4.5.0-SNAPSHOT
|
VERSION_NAME=4.5.0
|
||||||
|
|
||||||
GROUP=io.noties.markwon
|
GROUP=io.noties.markwon
|
||||||
POM_DESCRIPTION=Markwon markdown for Android
|
POM_DESCRIPTION=Markwon markdown for Android
|
||||||
|
@ -49,7 +49,7 @@ public abstract class MarkwonReducer {
|
|||||||
Node temp;
|
Node temp;
|
||||||
|
|
||||||
while (node != null) {
|
while (node != null) {
|
||||||
// @since $SNAPSHOT; do not include LinkReferenceDefinition node (would result
|
// @since 4.5.0 do not include LinkReferenceDefinition node (would result
|
||||||
// in empty textView if rendered in recycler-view)
|
// in empty textView if rendered in recycler-view)
|
||||||
if (!(node instanceof LinkReferenceDefinition)) {
|
if (!(node instanceof LinkReferenceDefinition)) {
|
||||||
list.add(node);
|
list.add(node);
|
||||||
|
@ -115,14 +115,14 @@ public class CorePlugin extends AbstractMarkwonPlugin {
|
|||||||
// @since 4.0.0
|
// @since 4.0.0
|
||||||
private final List<OnTextAddedListener> onTextAddedListeners = new ArrayList<>(0);
|
private final List<OnTextAddedListener> onTextAddedListeners = new ArrayList<>(0);
|
||||||
|
|
||||||
// @since $SNAPSHOT;
|
// @since 4.5.0
|
||||||
private boolean hasExplicitMovementMethod;
|
private boolean hasExplicitMovementMethod;
|
||||||
|
|
||||||
protected CorePlugin() {
|
protected CorePlugin() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since $SNAPSHOT;
|
* @since 4.5.0
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("UnusedReturnValue")
|
@SuppressWarnings("UnusedReturnValue")
|
||||||
@NonNull
|
@NonNull
|
||||||
@ -201,7 +201,7 @@ public class CorePlugin extends AbstractMarkwonPlugin {
|
|||||||
// let's ensure that there is a movement method applied
|
// let's ensure that there is a movement method applied
|
||||||
// we do it `afterSetText` so any user-defined movement method won't be
|
// we do it `afterSetText` so any user-defined movement method won't be
|
||||||
// replaced (it should be done in `beforeSetText` or manually on a TextView)
|
// replaced (it should be done in `beforeSetText` or manually on a TextView)
|
||||||
// @since $SNAPSHOT; we additionally check if we should apply _implicit_ movement method
|
// @since 4.5.0 we additionally check if we should apply _implicit_ movement method
|
||||||
if (!hasExplicitMovementMethod && textView.getMovementMethod() == null) {
|
if (!hasExplicitMovementMethod && textView.getMovementMethod() == null) {
|
||||||
textView.setMovementMethod(LinkMovementMethod.getInstance());
|
textView.setMovementMethod(LinkMovementMethod.getInstance());
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,7 @@ public class MarkwonTheme {
|
|||||||
protected final int linkColor;
|
protected final int linkColor;
|
||||||
|
|
||||||
// specifies whether we underline links, by default is true
|
// specifies whether we underline links, by default is true
|
||||||
// @since $SNAPSHOT;
|
// @since 4.5.0
|
||||||
protected final boolean isLinkedUnderlined;
|
protected final boolean isLinkedUnderlined;
|
||||||
|
|
||||||
// used in quote, lists
|
// used in quote, lists
|
||||||
@ -462,7 +462,7 @@ public class MarkwonTheme {
|
|||||||
public static class Builder {
|
public static class Builder {
|
||||||
|
|
||||||
private int linkColor;
|
private int linkColor;
|
||||||
private boolean isLinkUnderlined = true; // @since $SNAPSHOT;
|
private boolean isLinkUnderlined = true; // @since 4.5.0
|
||||||
private int blockMargin;
|
private int blockMargin;
|
||||||
private int blockQuoteWidth;
|
private int blockQuoteWidth;
|
||||||
private int blockQuoteColor;
|
private int blockQuoteColor;
|
||||||
|
@ -18,7 +18,7 @@ public class AsyncDrawable extends Drawable {
|
|||||||
private final ImageSize imageSize;
|
private final ImageSize imageSize;
|
||||||
private final ImageSizeResolver imageSizeResolver;
|
private final ImageSizeResolver imageSizeResolver;
|
||||||
|
|
||||||
// @since $SNAPSHOT;
|
// @since 4.5.0
|
||||||
private final Drawable placeholder;
|
private final Drawable placeholder;
|
||||||
|
|
||||||
private Drawable result;
|
private Drawable result;
|
||||||
@ -30,7 +30,7 @@ public class AsyncDrawable extends Drawable {
|
|||||||
// @since 2.0.1 for use-cases when image is loaded faster than span is drawn and knows canvas width
|
// @since 2.0.1 for use-cases when image is loaded faster than span is drawn and knows canvas width
|
||||||
private boolean waitingForDimensions;
|
private boolean waitingForDimensions;
|
||||||
|
|
||||||
// @since $SNAPSHOT; in case if result is Animatable and this drawable was detached, we
|
// @since 4.5.0 in case if result is Animatable and this drawable was detached, we
|
||||||
// keep the state to resume when we are going to be attached again (when used in RecyclerView)
|
// keep the state to resume when we are going to be attached again (when used in RecyclerView)
|
||||||
private boolean wasPlayingBefore = false;
|
private boolean wasPlayingBefore = false;
|
||||||
|
|
||||||
@ -136,13 +136,13 @@ public class AsyncDrawable extends Drawable {
|
|||||||
result.setCallback(callback);
|
result.setCallback(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @since $SNAPSHOT; we trigger loading only if we have no result (and result is not placeholder)
|
// @since 4.5.0 we trigger loading only if we have no result (and result is not placeholder)
|
||||||
final boolean shouldLoad = result == null || result == placeholder;
|
final boolean shouldLoad = result == null || result == placeholder;
|
||||||
|
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
result.setCallback(callback);
|
result.setCallback(callback);
|
||||||
|
|
||||||
// @since $SNAPSHOT;
|
// @since 4.5.0
|
||||||
if (result instanceof Animatable && wasPlayingBefore) {
|
if (result instanceof Animatable && wasPlayingBefore) {
|
||||||
((Animatable) result).start();
|
((Animatable) result).start();
|
||||||
}
|
}
|
||||||
@ -229,7 +229,7 @@ public class AsyncDrawable extends Drawable {
|
|||||||
|
|
||||||
public void setResult(@NonNull Drawable result) {
|
public void setResult(@NonNull Drawable result) {
|
||||||
|
|
||||||
// @since $SNAPSHOT; revert this flag when we have new source
|
// @since 4.5.0 revert this flag when we have new source
|
||||||
wasPlayingBefore = false;
|
wasPlayingBefore = false;
|
||||||
|
|
||||||
// if we have previous one, detach it
|
// if we have previous one, detach it
|
||||||
|
@ -22,7 +22,7 @@ public class MovementMethodPlugin extends AbstractMarkwonPlugin {
|
|||||||
*
|
*
|
||||||
* @see #create(MovementMethod)
|
* @see #create(MovementMethod)
|
||||||
* @see #link()
|
* @see #link()
|
||||||
* @deprecated $SNAPSHOT; use {@link #link()}
|
* @deprecated 4.5.0 use {@link #link()}
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ -31,7 +31,7 @@ public class MovementMethodPlugin extends AbstractMarkwonPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since $SNAPSHOT;
|
* @since 4.5.0
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
public static MovementMethodPlugin link() {
|
public static MovementMethodPlugin link() {
|
||||||
@ -42,7 +42,7 @@ public class MovementMethodPlugin extends AbstractMarkwonPlugin {
|
|||||||
* Special {@link MovementMethodPlugin} that is <strong>not</strong> applying a MovementMethod on a TextView
|
* Special {@link MovementMethodPlugin} that is <strong>not</strong> applying a MovementMethod on a TextView
|
||||||
* implicitly
|
* implicitly
|
||||||
*
|
*
|
||||||
* @since $SNAPSHOT;
|
* @since 4.5.0
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
public static MovementMethodPlugin none() {
|
public static MovementMethodPlugin none() {
|
||||||
@ -58,7 +58,7 @@ public class MovementMethodPlugin extends AbstractMarkwonPlugin {
|
|||||||
private final MovementMethod movementMethod;
|
private final MovementMethod movementMethod;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Since $SNAPSHOT; change to be <em>nullable</em>
|
* Since 4.5.0 change to be <em>nullable</em>
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("WeakerAccess")
|
@SuppressWarnings("WeakerAccess")
|
||||||
MovementMethodPlugin(@Nullable MovementMethod movementMethod) {
|
MovementMethodPlugin(@Nullable MovementMethod movementMethod) {
|
||||||
@ -73,7 +73,7 @@ public class MovementMethodPlugin extends AbstractMarkwonPlugin {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void beforeSetText(@NonNull TextView textView, @NonNull Spanned markdown) {
|
public void beforeSetText(@NonNull TextView textView, @NonNull Spanned markdown) {
|
||||||
// @since $SNAPSHOT; check for equality
|
// @since 4.5.0 check for equality
|
||||||
final MovementMethod current = textView.getMovementMethod();
|
final MovementMethod current = textView.getMovementMethod();
|
||||||
if (current != movementMethod) {
|
if (current != movementMethod) {
|
||||||
textView.setMovementMethod(movementMethod);
|
textView.setMovementMethod(movementMethod);
|
||||||
|
@ -83,7 +83,7 @@ public abstract class JLatexMathTheme {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since $SNAPSHOT;
|
* @since 4.5.0
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
public static Padding of(int left, int top, int right, int bottom) {
|
public static Padding of(int left, int top, int right, int bottom) {
|
||||||
|
@ -28,7 +28,7 @@ public abstract class SimpleTagHandler extends TagHandler {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handle(@NonNull MarkwonVisitor visitor, @NonNull MarkwonHtmlRenderer renderer, @NonNull HtmlTag tag) {
|
public void handle(@NonNull MarkwonVisitor visitor, @NonNull MarkwonHtmlRenderer renderer, @NonNull HtmlTag tag) {
|
||||||
// @since $SNAPSHOT; check if tag is block one and visit children
|
// @since 4.5.0 check if tag is block one and visit children
|
||||||
if (tag.isBlock()) {
|
if (tag.isBlock()) {
|
||||||
visitChildren(visitor, renderer, tag.getAsBlock());
|
visitChildren(visitor, renderer, tag.getAsBlock());
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ public class GlideImagesPlugin extends AbstractMarkwonPlugin {
|
|||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
public static GlideImagesPlugin create(@NonNull final Context context) {
|
public static GlideImagesPlugin create(@NonNull final Context context) {
|
||||||
// @since $SNAPSHOT; cache RequestManager
|
// @since 4.5.0 cache RequestManager
|
||||||
// sometimes `cancel` would be called after activity is destroyed,
|
// sometimes `cancel` would be called after activity is destroyed,
|
||||||
// so `Glide.with(context)` will throw an exception
|
// so `Glide.with(context)` will throw an exception
|
||||||
return create(Glide.with(context));
|
return create(Glide.with(context));
|
||||||
|
@ -29,7 +29,7 @@ public class BangInlineProcessor extends InlineProcessor {
|
|||||||
|
|
||||||
return node;
|
return node;
|
||||||
} else {
|
} else {
|
||||||
// @since $SNAPSHOT; return null in case no match (multiple inline
|
// @since 4.5.0 return null in case no match (multiple inline
|
||||||
// processors can define `!` as _special_ character, so let them handle it)
|
// processors can define `!` as _special_ character, so let them handle it)
|
||||||
// NB! do not forget to reset index
|
// NB! do not forget to reset index
|
||||||
index = startIndex;
|
index = startIndex;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user