Android implements the animation animation of the interface component's jitter effect in the system-supplied API Demos:
The table of contents for Android-sdksamplesandroid-8apidemos has achieved a simple dithering effect:
The specific use is as follows:
Step one: Prepare two animation effects of the XML file, add to the res/anim/directory:
Shake.xml file:
<translate xmlns:android= "Http://schemas.android.com/apk/res/android"
Android:fromxdelta= "0"
Android:toxdelta= "10"
android:duration= "1000"
Android:interpolator= "@anim/cycle_7"/>
Cycle_7.xml file:
<cycleinterpolator xmlns:android= "Http://schemas.android.com/apk/res/android"
android:cycles= "7"/>
The second step://code uses animation effect:
Animation shake = Animationutils.loadanimation (this, r.anim.shake);//Load Animation resource file
Findviewbyid (r.id.xxxx). Startanimation (shake); Play animation effects on components