正确的文本淡入淡出编码(逐词)

时间:2019-05-03 04:50:19

标签: android animation textview android-animation

我可以通过此代码淡出完整的文本

final TextView mSwitcher = (TextView) findViewById(R.id.bookContent);
mSwitcher.setText("old text");

final Animation in = new AlphaAnimation(0.0f, 1.0f);
in.setDuration(3000);

final Animation out = new AlphaAnimation(1.0f, 0.0f);
out.setRepeatCount(Animation.INFINITE);
out.setRepeatMode(Animation.REVERSE);
out.setDuration(3000);
mSwitcher.startAnimation(out);

Button moveOn = (Button) findViewById(R.id.moveOn);
moveOn.setOnClickListener( new OnClickListener() {
    public void onClick(View v) {

        mSwitcher.startAnimation(out);
        mSwitcher.setText("new text");
        mSwitcher.startAnimation(in);

    }
});

但是我需要像逐个单词那样淡出文本的内容:

https://flamingtext.in/logo/Design-Memories-Animation

任何建议..拜托,谢谢

0 个答案:

没有答案