码迷,mamicode.com
首页 > 其他好文 > 详细

Font Awesome Text 使用方法

时间:2014-07-31 16:29:46      阅读:272      评论:0      收藏:0      [点我收藏+]

标签:android   http   color   java   使用   os   io   for   

<!-- basic text-->
<com.beardedhen.androidbootstrap.FontAwesomeText
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    fontawesometext:fa_icon="fa-github"
    android:layout_margin="10dp" 
    android:textSize="32sp"
/>

fontawesometext:fa_icon="fa-github" the icon to place, as per the Font Awesome Cheat Sheet

android:textSize="12sp" Text size must always be in sp!

android:textColor="@color/bbutton_primary" you can change the textColor or background to any color, including the Bootstrap colours by typing bbutton_ and the type of colour e.g. bbutton_danger for the red danger colour.

NEW

fontAwesomeText.setIcon("fa-heart"); change the icon programmatically

Animations

//get access to some FontAwesomeText items in the layout
FontAwesomeText tv1 = (FontAwesomeText) findViewById(R.id.lblOne);
FontAwesomeText tv2 = (FontAwesomeText) findViewById(R.id.lblTwo);
FontAwesomeText tv3 = (FontAwesomeText) findViewById(R.id.lblThree);

//flashing forever FAST
tv1.startFlashing(this, true, FontAwesomeText.AnimationSpeed.FAST);

//rotating clockwise slowly
tv2.startRotate(this, true, FontAwesomeText.AnimationSpeed.SLOW);

//rotating anti-clockwise at medium speed
tv3.startRotate(this, false, FontAwesomeText.AnimationSpeed.MEDIUM);

Flashing Animations

startFlashing(Context context, boolean forever, AnimationSpeed speed);

@param context the current applications context

@param forever whether the item should flash repeatedly or just once

@param speed how fast the item should flash, chose between FontAwesomeText.AnimationSpeed.SLOW / FontAwesomeText.AnimationSpeed.MEDIUM / FontAwesomeText.AnimationSpeed.FAST

Rotation Animation

startRotate(Context context, boolean clockwise, AnimationSpeed speed);

@param context the current applications context

@param clockwise true for clockwise, false for anti clockwise spinning

@param speed how fast the item should flash, chose between FontAwesomeText.AnimationSpeed.SLOW / FontAwesomeText.AnimationSpeed.MEDIUM / FontAwesomeText.AnimationSpeed.FAST

Font Awesome Text 使用方法,布布扣,bubuko.com

Font Awesome Text 使用方法

标签:android   http   color   java   使用   os   io   for   

原文地址:http://www.cnblogs.com/boundary/p/3880767.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!