跳动的文字

效果图:

 

Github地址:https://github.com/frakbot/JumpingBeans
Demo地址:http://play.google.com/store/apps/details?id=net.frakbot.jumpingbeans.demo

步骤:

1.gradle中

dependencies {
    compile 'net.frakbot:jumpingbeans:1.3.0'
}

2.两种效果

(1)文字后添加三个点

final TextView textView1 = (TextView) findViewById(R.id.jumping_text_1);
jumpingBeans1 = JumpingBeans.with(textView1)
        .appendJumpingDots()
        .build();

(2)指定两个位置之间跳动

final TextView textView2 = (TextView) findViewById(R.id.jumping_text_2);
jumpingBeans2 = JumpingBeans.with(textView2)
        .makeTextJump(0, textView2.getText().toString().indexOf(' '))
        .setIsWave(false)
        .setLoopDuration(1000)  // ms
        .build();

 

posted @ 2017-02-24 15:22  嘉禾世兴  阅读(203)  评论(0编辑  收藏  举报