app/src/main/java/org/taitasciore/android/paymettest/details/DetailsPresenter.java
@Override
    public SpannableStringBuilder buildDescriptionSpan(Context context, String description) {
        if (description == null) {
            return null;
        }

        SpannableStringBuilder ssb;
        CalligraphyTypefaceSpan typefaceSpan = new CalligraphyTypefaceSpan(
                TypefaceUtils.load(context.getAssets(), "fonts/OpenSans-Semibold.ttf"));
        RelativeSizeSpan sizeSpan = new RelativeSizeSpan(1.1f);
        ForegroundColorSpan colorSpan = new ForegroundColorSpan(Color.BLACK);

        String descriptionSpan = "Description: " + Html.fromHtml(description);
        ssb = new SpannableStringBuilder(descriptionSpan);
        int start = descriptionSpan.indexOf(":") + 1;
        int end = descriptionSpan.length();
        ssb.setSpan(typefaceSpan, start, end, Spanned.SPAN_INCLUSIVE_INCLUSIVE);
        ssb.setSpan(sizeSpan, start, end, Spanned.SPAN_INCLUSIVE_INCLUSIVE);
        ssb.setSpan(colorSpan, start, end, Spanned.SPAN_INCLUSIVE_INCLUSIVE);

        return ssb;
    }
/**
     * This method builds a span for the description field of a comic.
     * Note that the description may be null, so we need to check for that and return
     * immediately in that case or an exception will be thrown.
     * @param context Current context
     * @param description Description text
     * @return Built span
     */
This method builds a span for the description field of a comic.
Note that the description may be null, so we need to check for that and return
immediately in that case or an exception will be thrown.
@param context Current context
@param description Description text
@return Built span
This method builds a span for the description field of a comic . Note that the description may be null so we need to check for that and return immediately in that case or an exception will be thrown . @param context Current context @param description Description text @return Built span
@Override
    public SpannableStringBuilder buildDescriptionSpan(Context context, String description) {
        if (description == null) {
            return null;
        }
        SpannableStringBuilder ssb;
        CalligraphyTypefaceSpan typefaceSpan = new CalligraphyTypefaceSpan(
                TypefaceUtils.load(context.getAssets(), "fonts/OpenSans-Semibold.ttf"));
        RelativeSizeSpan sizeSpan = new RelativeSizeSpan(1.1f);
        ForegroundColorSpan colorSpan = new ForegroundColorSpan(Color.BLACK);
        String descriptionSpan = "Description: " + Html.fromHtml(description);
        ssb = new SpannableStringBuilder(descriptionSpan);
        int start = descriptionSpan.indexOf(":") + 1;
        int end = descriptionSpan.length();
        ssb.setSpan(typefaceSpan, start, end, Spanned.SPAN_INCLUSIVE_INCLUSIVE);
        ssb.setSpan(sizeSpan, start, end, Spanned.SPAN_INCLUSIVE_INCLUSIVE);
        ssb.setSpan(colorSpan, start, end, Spanned.SPAN_INCLUSIVE_INCLUSIVE);
        return ssb;
    }
@ Override public SpannableStringBuilder buildDescriptionSpan ( Context context , String description ) { if ( description == null ) { return null ; } SpannableStringBuilder ssb ; CalligraphyTypefaceSpan typefaceSpan = new CalligraphyTypefaceSpan ( TypefaceUtils . load ( context . getAssets ( ) , "fonts/OpenSans-Semibold.ttf" ) ) ; RelativeSizeSpan sizeSpan = new RelativeSizeSpan ( 1.1f ) ; ForegroundColorSpan colorSpan = new ForegroundColorSpan ( Color . BLACK ) ; String descriptionSpan = "Description: " + Html . fromHtml ( description ) ; ssb = new SpannableStringBuilder ( descriptionSpan ) ; int start = descriptionSpan . indexOf ( ":" ) + 1 ; int end = descriptionSpan . length ( ) ; ssb . setSpan ( typefaceSpan , start , end , Spanned . SPAN_INCLUSIVE_INCLUSIVE ) ; ssb . setSpan ( sizeSpan , start , end , Spanned . SPAN_INCLUSIVE_INCLUSIVE ) ; ssb . setSpan ( colorSpan , start , end , Spanned . SPAN_INCLUSIVE_INCLUSIVE ) ; return ssb ; }
This method builds a span for the description field of a comic.
This method builds a span for the description field of a comic .