在网上找的一段滑动动画效果代码
  1. /**
  2. *定义从右侧进入的动画效果
  3. *@return
  4. */
  5. protectedAnimationinFromRightAnimation(){
  6. AnimationinFromRight=newTranslateAnimation(
  7. Animation.RELATIVE_TO_PARENT,+1.0f,
  8. Animation.RELATIVE_TO_PARENT,0.0f,
  9. Animation.RELATIVE_TO_PARENT,0.0f,
  10. Animation.RELATIVE_TO_PARENT,0.0f);
  11. inFromRight.setDuration(500);
  12. inFromRight.setInterpolator(newAccelerateInterpolator());
  13. returninFromRight;
  14. }
  15. /**
  16. *定义从左侧退出的动画效果
  17. *@return
  18. */
  19. protectedAnimationoutToLeftAnimation(){
  20. AnimationouttoLeft=newTranslateAnimation(
  21. Animation.RELATIVE_TO_PARENT,0.0f,
  22. Animation.RELATIVE_TO_PARENT,-1.0f,
  23. Animation.RELATIVE_TO_PARENT,0.0f,
  24. Animation.RELATIVE_TO_PARENT,0.0f);
  25. outtoLeft.setDuration(500);
  26. outtoLeft.setInterpolator(newAccelerateInterpolator());
  27. returnouttoLeft;
  28. }
  29. /**
  30. *定义从左侧进入的动画效果
  31. *@return
  32. */
  33. protectedAnimationinFromLeftAnimation(){
  34. AnimationinFromLeft=newTranslateAnimation(
  35. Animation.RELATIVE_TO_PARENT,-1.0f,
  36. Animation.RELATIVE_TO_PARENT,0.0f,
  37. Animation.RELATIVE_TO_PARENT,0.0f,
  38. Animation.RELATIVE_TO_PARENT,0.0f);
  39. inFromLeft.setDuration(500);
  40. inFromLeft.setInterpolator(newAccelerateInterpolator());
  41. returninFromLeft;
  42. }
  43. /**
  44. *定义从右侧退出时的动画效果
  45. *@return
  46. */
  47. protectedAnimationoutToRightAnimation(){
  48. AnimationouttoRight=newTranslateAnimation(
  49. Animation.RELATIVE_TO_PARENT,0.0f,
  50. Animation.RELATIVE_TO_PARENT,+1.0f,
  51. Animation.RELATIVE_TO_PARENT,0.0f,
  52. Animation.RELATIVE_TO_PARENT,0.0f);
  53. outtoRight.setDuration(500);
  54. outtoRight.setInterpolator(newAccelerateInterpolator());
  55. returnouttoRight;
  56. }

更多相关文章

  1. Android使用RecyclerView实现瀑布流效果的列表展示
  2. Android实现Banner轮播效果
  3. android 在Resource中定义arrays
  4. Android实现win8磁铁效果
  5. Android垂直跑马灯效果
  6. android 弹性效果
  7. Android购物分类效果实现
  8. Android 如何 画 柱状图 -------自定义View
  9. 点击listitem按下效果替换默认颜色

随机推荐

  1. 使用file_get_contents()函数读取文件内
  2. PHP后门的一些用法
  3. PHP并发性能调优实战(性能提升104%)
  4. 使用file_put_contents()创建及向文档内
  5. 面向对象的程序设计语言是一种什么语言
  6. Dockerfile构建PHP镜像
  7. phpcms模板怎么安装
  8. 面向对象的方法是什么意思
  9. PHP多进程、信号量及孤儿进程和僵尸进程
  10. print不是函数