Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ public static Builder builderWithDefaults(@NonNull Context context) {
// width of bullet, by default min(blockMargin, height) / 2
protected final int bulletWidth;

// whether ordered lists show the number part in bold
protected final boolean boldListItemNumber;

// by default - main text color
protected final int codeTextColor;

Expand Down Expand Up @@ -196,6 +199,7 @@ protected MarkwonTheme(@NonNull Builder builder) {
this.listItemColor = builder.listItemColor;
this.bulletListItemStrokeWidth = builder.bulletListItemStrokeWidth;
this.bulletWidth = builder.bulletWidth;
this.boldListItemNumber = builder.boldListItemNumber;
this.codeTextColor = builder.codeTextColor;
this.codeBlockTextColor = builder.codeBlockTextColor;
this.codeBackgroundColor = builder.codeBackgroundColor;
Expand Down Expand Up @@ -278,6 +282,10 @@ public void applyListItemStyle(@NonNull Paint paint) {
if (bulletListItemStrokeWidth != 0) {
paint.setStrokeWidth(bulletListItemStrokeWidth);
}

if (boldListItemNumber) {
paint.setTypeface(Typeface.create(Typeface.DEFAULT, Typeface.BOLD));
}
}

public int getBulletWidth(int height) {
Expand Down Expand Up @@ -469,6 +477,7 @@ public static class Builder {
private int listItemColor;
private int bulletListItemStrokeWidth;
private int bulletWidth;
private boolean boldListItemNumber;
private int codeTextColor;
private int codeBlockTextColor; // @since 1.0.5
private int codeBackgroundColor;
Expand Down Expand Up @@ -497,6 +506,7 @@ public static class Builder {
this.listItemColor = theme.listItemColor;
this.bulletListItemStrokeWidth = theme.bulletListItemStrokeWidth;
this.bulletWidth = theme.bulletWidth;
this.boldListItemNumber = theme.boldListItemNumber;
this.codeTextColor = theme.codeTextColor;
this.codeBlockTextColor = theme.codeBlockTextColor;
this.codeBackgroundColor = theme.codeBackgroundColor;
Expand Down Expand Up @@ -561,6 +571,12 @@ public Builder bulletWidth(@Px int bulletWidth) {
return this;
}

@NonNull
public Builder boldListItemNumber(boolean boldListItemNumber) {
this.boldListItemNumber = boldListItemNumber;
return this;
}

@NonNull
public Builder codeTextColor(@ColorInt int codeTextColor) {
this.codeTextColor = codeTextColor;
Expand Down