WEB开发网
开发学院手机开发Android 开发 Android 抽屉式Activity 阅读

Android 抽屉式Activity

 2012-07-17 14:06:29 来源:WEB开发网   
核心提示:// 回退时的位移动画mStopAnimation = new TranslateAnimation(TranslateAnimation.ABSOLUTE,0,TranslateAnimation.ABSOLUTE,-shift,TranslateAnimation.ABSOLUTE,0,TranslateAnima
 // 回退时的位移动画
 mStopAnimation = new TranslateAnimation(
  TranslateAnimation.ABSOLUTE,
  0,
  TranslateAnimation.ABSOLUTE,
  -shift,
  TranslateAnimation.ABSOLUTE,
  0,
  TranslateAnimation.ABSOLUTE,
  0);
 // 持续时间
 mStartAnimation
  .setDuration(DURATION_MS);
 // 动画完成时停留在结束位置
 mStartAnimation
  .setFillAfter(true);
 mStartAnimation
  .setAnimationListener(new AnimationListener() {
   @Override
   public void onAnimationStart(
    Animation animation) {
   }
   @Override
   public void onAnimationRepeat(
    Animation animation) {
   }
   @Override
   public void onAnimationEnd(
    Animation animation) {
   // 动画结束时回调
   // 将imageview固定在位移后的位置
   mCover.setAnimation(null);
   @SuppressWarnings("deprecation")
   final android.widget.AbsoluteLayout.LayoutParams lp = new android.widget.AbsoluteLayout.LayoutParams(
    LayoutParams.FILL_PARENT,
    LayoutParams.FILL_PARENT,
    shift,
    0);
   mCover.setLayoutParams(lp);
   }
  });
 mStopAnimation
  .setDuration(DURATION_MS);
 mStopAnimation
  .setFillAfter(true);
 mStopAnimation
  .setAnimationListener(new AnimationListener() {
   @Override
   public void onAnimationStart(
    Animation animation) {
   }
   @Override
   public void onAnimationRepeat(
    Animation animation) {
   }

上一页  1 2 3 4 5 6 7  下一页

Tags:Android 抽屉式 Activity

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接