Animation switching between voice input and text input

Source: Internet
Author: User

With the rapid popularization of speech, many applications have begun to increase the voice input function. Below is a simple animation switching between voice and text input:

Layout file:

         
              
               
   "
          
              
               
           
      
 
ViewFlipper has many introductions on the Internet

Logical implementation:

ViewFlipper = (ViewFlipper) findViewById (R. id. viewFlipper1); image01 = (ImageView) findViewById (R. id. image01); image02 = (ImageView) findViewById (R. id. image02); leftInAnimation = AnimationUtils. loadAnimation (this, R. anim. left_in); leftOutAnimation = AnimationUtils. loadAnimation (this, R. anim. left_out); image01.setOnClickListener (new OnClickListener () {@ Overridepublic void onClick (View v) {viewFlipper. setInAnimation (leftInAnimation); viewFlipper. setOutAnimation (leftOutAnimation); viewFlipper. showNext (); // slide to the right}); image02.setOnClickListener (new OnClickListener () {@ Overridepublic void onClick (View v) {viewFlipper. setInAnimation (leftInAnimation); viewFlipper. setOutAnimation (leftOutAnimation); viewFlipper. showNext (); // slide to the right }});
Here we only provide some ideas. In fact, we can also use OnGestureListener for gesture slide operations.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.