/** * Factory method to obtain a {@link Builder} instance initialized with default values taken * from current application theme. * * @param context Context to obtain default styling values (colors, etc) * @return {@link Builder} instance * @since 1.0.0 */ @NonNull public static Builder builderWithDefaults(@NonNull Context context) { // by default we will be using link color for the checkbox color // & window background as a checkMark color final int linkColor = resolve(context, android.R.attr.textColorLink); final int backgroundColor = resolve(context, android.R.attr.colorBackground); // before 1.0.5 build had `linkColor` set, but in order for spans to use default link color // set directly in widget (or any caller), we should not pass it here final Dip dip = new Dip(context); return new Builder() .codeMultilineMargin(dip.toPx(8)) .blockMargin(dip.toPx(24)) .blockQuoteWidth(dip.toPx(4)) .bulletListItemStrokeWidth(dip.toPx(1)) .headingBreakHeight(dip.toPx(1)) .thematicBreakHeight(dip.toPx(4)) .tableCellPadding(dip.toPx(4)) .tableBorderWidth(dip.toPx(1)) .taskListDrawable(new TaskListDrawable(linkColor, linkColor, backgroundColor)); }