SimpledecoratedText ช่วยให้คุณสร้างทิวทัศน์ที่เรียบง่ายสวยงามฉลาดและตอบสนองได้
ทำความสะอาดการออกแบบที่ใช้งานง่าย - ด้วย SimpletextView คุณสามารถสร้างมุมมองข้อความที่สวยงามสำหรับแอปพลิเคชันของคุณในมุมมองเดียว
ทุกอย่างใน TextView เดียว - คลาส TextDecor มีความสามารถในการเพิ่มจำนวนมากเพิ่มการตกแต่งอย่างง่ายให้กับคุณข้อความ: ตัวหนาอิตาลีและเอฟเฟกต์ตัวยกเพื่อเพิ่มผู้ฟังคลิกในข้อความที่เลือกเปลี่ยนสีเพิ่มเงา
นอกกรอบ หากคุณต้องการการตกแต่งที่เฉพาะเจาะจงคุณสามารถเพิ่มคุณเป็นเจ้าของได้โดยใช้อินเทอร์เฟซ
แบบอักษรเลื่อนอย่างราบรื่นในรายการ ที่เพิ่มฟอนต์ลงในข้อความในรายการ hav no ในข้อตกลงบนคุณเลื่อนประสิทธิภาพ
การเริ่มต้นใช้งาน SimpledecoratedText นั้นง่ายมาก! เพียงเพิ่มการพึ่งพาโครงการของคุณและทำตามคำแนะนำด้านล่าง
คุณจะต้องการ:
compile ' com.dsdmsa.text:text_decor_V01:0.0.5 'หรือ
< dependency >
< groupId >com.dsdmsa.text</ groupId >
< artifactId >text_decor_V01</ artifactId >
< version >0.0.5</ version >
< type >pom</ type >
</ dependency > < com .decorator.text.textdecor.PrettyText
android : layout_width = " match_parent "
android : layout_margin = " 10dp "
android : layout_height = " match_parent "
android : id = " @+id/textDecor " /> TextDecor bold = new TextDecor . Builder ()
. decorate ( TextDecor . BOLD )
. build ();
TextDecor fontAndUndeline = new TextDecor . Builder ()
. decorate ( TextDecor . font ( this , "fonts/Roboto-Thin.ttf" ))
. decorate ( TextDecor . UNDERLINE )
. build ();
TextDecor roundRgadient = new TextDecor . Builder ()
. decorate ( TextDecor . setRoundBackground ( 9 , 2 , new LinearGradient ( 0 , 0 , 545 , 545 , Color . CYAN , Color . BLUE , Shader . TileMode . CLAMP ), Color . BLACK ))
. decorate ( TextDecor . BOLD )
. build ();
TextDecor redBack = new TextDecor . Builder ()
. decorate ( TextDecor . BOLD )
. decorate ( TextDecor . setTextColor ( Color . RED ))
. decorate ( TextDecor . setBackground ( Color . BLACK ))
. decorate ( TextDecor . absoluteTextSize ( 50 ))
. build ();
TextDecor shadowCol = new TextDecor . Builder ()
. decorate ( TextDecor . addShadow ( 2 , 2 , 5 , Color . BLACK ))
. decorate ( TextDecor . absoluteTextSize ( 40 ))
. build ();
prettyText = ( PrettyText ) findViewById ( R . id . textDecor ); prettyText . setText (
roundRgadient . withText ( "Lorem Ipsum" ),
fontAndUndeline . withText ( " is simply dummy text" ),
" of the printing and typesetting industry." ,
roundRgadient . withText ( " Lorem Ipsum " ),
"has been the industry's standard dummy text ever since the " ,
redBack . withText ( "1500s" ),
shadowCol . withText ( ", when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the " ),
redBack . withText ( "1960s" ),
" with the release of " ,
bold . withText ( "Letraset" ),
" sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of " ,
roundRgadient . withText ( "Lorem Ipsum" )
); public static Decoration decor ( final int param ){
return new Decoration () {
@ Override
public Object newDecorInstance () {
return new CustomSpan ( param );
}
};
} public static final Decoration STRINKE = new Decoration () {
@ Override
public Object newDecorInstance () {
return new StrikethroughSpan ();
}
};ส่งปัญหาไปยัง SimpledecoratedText GitHub หากคุณต้องการความช่วยเหลือใด ๆ และแน่นอนอย่าลังเลที่จะส่งคำขอดึงด้วยการแก้ไขข้อผิดพลาดหรือการเปลี่ยนแปลง