跳至主要内容

博文

目前显示的是标签为“animation”的博文

css keyframe

@keyframes myfirst { frame {background: red;} to {background: yellow;} } @keyframes myfirst { 0% {background: red;} 25% {background: yellow;} 50% {background: blue;} 100% {background: green;} } <div style="animation: myfirst 5s;">asd</div>

android animation set

AnimationSet animationSet= new AnimationSet(getApplicationContext() ,null ) ; animationSet.addAnimation( new AlphaAnimation( 0f , 1f )) ; animationSet.addAnimation( new TranslateAnimation( 0 , 0 , editText_repeat .getHeight() , 0 )) ; animationSet.setDuration(getResources().getInteger(android.R.integer. config_shortAnimTime )) ; editText_repeat .startAnimation(animationSet) ;

android scale animation

public void scaleViewY (View v , float startScale , float endScale) { Animation anim = new ScaleAnimation( 1f , 1f , // Start and end values for the X axis scaling startScale , endScale , // Start and end values for the Y axis scaling Animation. RELATIVE_TO_SELF , 0f , // Pivot point of X scaling Animation. RELATIVE_TO_SELF , 0.5f ) ; // Pivot point of Y scaling anim.setFillAfter( true ) ; // Needed to keep the result of the animation anim.setDuration( 500 ) ; v.startAnimation(anim) ; }

android overidePendingTransition Scale

Intent intent= new Intent(MainActivity. this, Main2Activity. class ) ; startActivity(intent) ; overridePendingTransition(R.anim. zoomin , R.anim. zoomout ); @Override public void onBackPressed () { super .onBackPressed() ; overridePendingTransition(R.anim. fade_in , R.anim. fade_out ) ; } XML file : <? xml version= "1.0" encoding= "utf-8" ?> <set xmlns: android = "http://schemas.android.com/apk/res/android" > <scale android :fromXScale= "100%" android :toXScale= "0%" android :fromYScale= "100%" android :toYScale= "0%" android :pivotX= "50%" android :pivotY= "50%" android :duration= "1000" /> </set>

Android Animation

button.getPivotX()*2  == button's  width button.getX()  ==  button's  absolute x float sx1 = button .getPivotX() , sy1= button .getScaleY() , sy2= textView .getScaleY() ; TranslateAnimation translateAnimation= new TranslateAnimation ( Animation. ABSOLUTE , 0f , Animation. ABSOLUTE , sx1 , Animation. ABSOLUTE , 0f , Animation. ABSOLUTE , sy1+sy2 ) ; translateAnimation.setFillAfter( true ) ; translateAnimation.setDuration( 1000 ) ; textView .startAnimation(translateAnimation) ; animation. setRepeatCount ( 10 ); animation. setRepeatMod  ( Animation. REVERSE ); 四、具体实现 2 、 .java 文件 Animation Set :             AnimationSet animationSet =   new   AnimationSet( true );             animationSet.addAnimation(alphaAnimation...