Home

Awesome

Android Gems Android Arsenal @iwgang

SimplifySpan

A easy-to-use and powerful Spannable library

screenshot


gradle

implementation 'com.github.iwgang:simplifyspan:2.2'

Support Units

Support Methods

how to use ?

Sample Code

// sample 1
tvText.setText(new SimplifySpanBuild("距离您:").append(new SpecialTextUnit("385", Color.BLUE)).append(" 米").build());

// sample 2
CharSequence spannableString = new SimplifySpanBuild(" 艾客优品雷霆Dock 2 雷电转USB3.0/火线/esata 扩展HUB")
        .appendToFirst(new SpecialLabelUnit("1212", Color.WHITE, sp2px(8), Color.RED, 70, 35).useTextBold().setGravity(SpecialGravity.CENTER))
        .appendToFirst(new SpecialLabelUnit("天猫", Color.WHITE, sp2px(8), 0xFFFF5000, 60, 35).setGravity(SpecialGravity.CENTER))
        .build();
tvText.setText(spannableString);