简体   繁体   中英

Changing Text color animation in Android

I want to display a text paragraph(in black color) and a "PLAY" button. When the user clicks on "PLAY" button, it should start speaking(TTS) the text sentence by sentence alongside it should change the spoken text color to green (character by character)
Any suggestions appreciated... :)

You can use a TextSwitcher

See these tutorials / examples. They will help you get started:

  1. http://www.example8.com/category/view/id/15552
  2. http://www.coderzheaven.com/2011/07/02/textswitching-animation-in-android-or-textswitcher-control-in-android/
  3. http://www.java2s.com/Code/Android/UI/UsesaTextSwitcher.htm

And finally, I believe an example is also available in the API demos from the Samples For SDK (API 13 I think) package in the SDK Manager

You will naturally have to code for synchronizing the TTS speech and the animation itself.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM