Android for window jitter effect

Source: Internet
Author: User

When we enter the content is wrong, enter the next time, should not take effect, the page is not a hint of what is also not very friendly, this can let the input box shake a bit


The following will be animated animation, we can use a bit OH

Cycle.xml file, mainly used to specify how many times the animation is executed

<?xml version= "1.0" encoding= "Utf-8"? ><cycleinterpolator     xmlns:android= "http://schemas.android.com/ Apk/res/android "    android:cycles=" 2 "/>

Then put the animation effect Myanim.xml

<?xml version= "1.0" encoding= "Utf-8"? ><set xmlns:android= "Http://schemas.android.com/apk/res/android"        Android:interpolator= "@anim/cycle" > <translate android:duration= "android:fromxdelta=" 0 " Android:fromydelta= "0" android:toxdelta= " -10" android:toydelta= " -10"/> <translate Android :d uration= "android:fromxdelta=" 0 "android:fromydelta=" 0 "android:startoffset=" Androi " D:toxdelta= "Ten" android:toydelta= " -10"/> <translate android:duration= "Android:fromxdel" Ta= "0" android:fromydelta= "0" android:startoffset= "android:toxdelta=" -10 "Android:toydelt        A= "Ten"/> <translate android:duration= "0" android:fromxdelta= "0" android:startoffset= "Android:toxdelta=" "Ten" Android:toydelta= "ten"/></set>


Try it in the code.

Animation anim = animationutils.loadanimation (Animactivity.this, R.anim.myanim);
Controls that require dithering. Startanimation (ANIM);



Android for window jitter effect

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.