设置动画时间
public class MyApplication extends Application {
@Override
public void onCreate() {
// TODO Auto-generated method stub
super.onCreate();
SwitchLayout.animDuration = 300;
}
}
切换activity 还有view的动画效果应用
public class SecondActivity extends Activity implements SwichLayoutInterFace {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_second);
setEnterSwichLayout();
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
switch (keyCode) {
case KeyEvent.KEYCODE_BACK:
setExitSwichLayout();
break;
default:
break;
}
return true;
}
@Override
public void setEnterSwichLayout() {// 设置进入动画
SwitchLayout.get3DRotateFromRight(this, false,
BaseEffects.getQuickToSlowEffect());
}
@Override
public void setExitSwichLayout() {// 设置退出动画
SwitchLayout.getSlideToLeft(this, true, null);
}
}