android.view.ViewPropertyAnimator.withEndAction()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(251)

本文整理了Java中android.view.ViewPropertyAnimator.withEndAction()方法的一些代码示例,展示了ViewPropertyAnimator.withEndAction()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ViewPropertyAnimator.withEndAction()方法的具体详情如下:
包路径:android.view.ViewPropertyAnimator
类名称:ViewPropertyAnimator
方法名:withEndAction

ViewPropertyAnimator.withEndAction介绍

暂无

代码示例

代码示例来源:origin: XunMengWinter/CircularAnim

@Override
  public void onAnimationEnd() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
      mFullView.animate().alpha(0).withEndAction(new Runnable() {
        @Override
        public void run() {
          mFullView.setVisibility(View.GONE);
          mFullView.setAlpha(1);
        }
      }).start();
    } else {
      mFullView.setVisibility(View.GONE);
    }
    showFragment(mIsTest2Fragment ? mTest1Fragment : mTest2Fragment);
    mIsTest2Fragment = !mIsTest2Fragment;
    view.setEnabled(true);
  }
});

代码示例来源:origin: qiujuer/Genius-Android

@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public void animateClose() {
  mBalloonMarkerDrawable.stop();
  ViewPropertyAnimator animator = mNumber.animate();
  animator.alpha(0f);
  animator.setDuration(100);
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
    animator.withEndAction(new Runnable() {
      @Override
      public void run() {
        //We use INVISIBLE instead of GONE to avoid a requestLayout
        mNumber.setVisibility(View.INVISIBLE);
        mBalloonMarkerDrawable.animateToNormal();
      }
    });
  } else {
    animator.setListener(new AnimatorListener() {
      @Override
      public void onAnimationEnd(Animator animation) {
        //We use INVISIBLE instead of GONE to avoid a requestLayout
        mNumber.setVisibility(View.INVISIBLE);
        mBalloonMarkerDrawable.animateToNormal();
      }
    });
  }
  animator.start();
}

代码示例来源:origin: westnordost/StreetComplete

private void animateChange(View view, float scale)
  {
    view.animate()
      .scaleX(scale).scaleY(scale)
      .setInterpolator(new DecelerateInterpolator(2f))
      .setDuration(100)
      .withEndAction(() ->
      {
        view.animate()
          .scaleX(1).scaleY(1)
          .setInterpolator(new AccelerateDecelerateInterpolator())
          .setDuration(100);
      });
  }
}

代码示例来源:origin: westnordost/StreetComplete

private void flingQuestMarkerTo(View quest, View target, Runnable onFinished)
{
  int[] targetPos = new int[2];
  target.getLocationOnScreen(targetPos);
  quest.animate()
    .scaleX(1.6f).scaleY(1.6f)
    .setInterpolator(new OvershootInterpolator(8f))
    .setDuration(250)
    .withEndAction(() -> {
      quest.animate()
        .scaleX(0.2f).scaleY(0.2f)
        .alpha(0.8f)
        .x(targetPos[0]).y(targetPos[1])
        .setDuration(250)
        .setInterpolator(new AccelerateInterpolator())
        .withEndAction(onFinished);
  });
}

代码示例来源:origin: pili-engineering/PLDroidShortVideo

public void focusFail() {
  if (mState == STATE_FOCUSING) {
    setBackgroundResource(R.drawable.ic_focus_failed);
    animate().withLayer().setDuration(SCALING_DOWN_TIME).scaleX(1f)
        .scaleY(1f).withEndAction(mEndAction);
    mState = STATE_FINISHING;
  }
}

代码示例来源:origin: pili-engineering/PLDroidShortVideo

public void focusSuccess() {
  if (mState == STATE_FOCUSING) {
    setBackgroundResource(R.drawable.ic_focus_focused);
    animate().withLayer().setDuration(SCALING_DOWN_TIME).scaleX(1f)
        .scaleY(1f).withEndAction(mEndAction);
    mState = STATE_FINISHING;
  }
}

代码示例来源:origin: wasdennnoch/AndroidN-ify

@Override
  public void run() {
    ripple.animate().alpha(0).setDuration(RIPPLE_DURATION / 2)
        .withEndAction(new Runnable() {
          @Override
          public void run() {
            ripple.setVisibility(View.INVISIBLE);
            mLayout.postDelayed(mRippleRunnable, RIPPLE_PAUSE);
          }
        }).start();
  }
}).start();

代码示例来源:origin: VictorAlbertos/BreadcrumbsView

void animateFromVisitedStepToNextStep(Runnable endAnim) {
  separatorViewVisitedStep
    .animate()
    .scaleX(0)
    .withEndAction(endAnim);
 }
}

代码示例来源:origin: VictorAlbertos/DeviceAnimationTestRule

@Override public void onClick(View view) {
  tvCheckResult.animate()
    .setDuration(5000)
    .alpha(1)
    .withEndAction(new Runnable() {
     @Override public void run() {
      tvCheckResult.setText("Finish");
     }
    });
 }
});

代码示例来源:origin: VictorAlbertos/BreadcrumbsView

void animateFromNextStepToVisitedStep(Runnable endAnim) {
 separatorViewVisitedStep
   .animate()
   .scaleX(1)
   .withEndAction(endAnim);
}

代码示例来源:origin: SachinVin/citra_android

private void showScreenshot()
{
 Animations.fadeViewIn(mImageView)
     .withEndAction(afterShowingScreenshot);
}

代码示例来源:origin: rallat/smokeAndMirrors

@Override
  public void onClick(@NonNull View v) {
    assert view != null;
    view.animate().x(width).y(height).setDuration(2000).withEndAction(new Runnable() {
      @Override
      public void run() {
        view.setX(0);
        view.setY(0);
      }
    }).start();
  }
});

代码示例来源:origin: rallat/smokeAndMirrors

@Override
  public void onClick(@NonNull View v) {
    assert view != null;
    view.animate().x(width).y(height).setDuration(2000).withEndAction(new Runnable() {
      @Override
      public void run() {
        view.setX(0);
        view.setY(0);
      }
    }).start();
  }
});

代码示例来源:origin: VictorAlbertos/BreadcrumbsView

void animateFromVisitedStepToNextStep(Runnable endAnim) {
  dotViewVisitedStep
    .animate()
    .scaleX(0)
    .scaleY(0)
    .withEndAction(endAnim);
 }
}

代码示例来源:origin: jjhesk/KickAssSlidingMenu

protected void hideLoadingCircle() {
  if (mProgress != null && mProgress.getVisibility() == View.VISIBLE) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
      mProgress.animate().alpha(0f).withEndAction(new Runnable() {
        @Override
        public void run() {
          mProgress.setVisibility(View.INVISIBLE);
        }
      });
    } else {
      mProgress.setVisibility(View.INVISIBLE);
    }
  }
}

代码示例来源:origin: VictorAlbertos/BreadcrumbsView

void animateFromNextStepToVisitedStep(Runnable endAnim) {
 dotViewVisitedStep
   .animate()
   .scaleX(1)
   .scaleY(1)
   .withEndAction(endAnim);
}

代码示例来源:origin: maxyou/CalendarPicker

private void closeFragment() {
  calendar_time_chooser_layout.animate().y(getActivity().findViewById(android.R.id.content).getHeight()).setDuration(300).withEndAction(new Runnable() {
    @Override
    public void run() {
      calendar_time_chooser_viewpager.closeFragment();
      getActivity().getFragmentManager().beginTransaction().remove(FragmentCalendarPicker.this).commit();
    }
  });
}

代码示例来源:origin: wasdennnoch/AndroidN-ify

public void show(ArrayList<Object> records, boolean animated) {
  if (isShown) return;
  initShow(records);
  if (animated) {
    setAlpha(0);
    animate().alpha(1)
        .withEndAction(mShowAnimationListener)
        .start();
  } else {
    setAlpha(1);
  }
}

代码示例来源:origin: Michenux/YourAppIdea

@Override
  public boolean onTouch(View arg0, MotionEvent arg1) {
    if (arg1.getAction() == MotionEvent.ACTION_DOWN) {
      button.animate().setInterpolator(decelerator).
          scaleX(.7f).scaleY(.7f);
    } else if (arg1.getAction() == MotionEvent.ACTION_UP) {
      button.animate().setInterpolator(overshooter).
          scaleX(1.6f).scaleY(1.6f).withEndAction(onEndRunnable);
    }
    return false;
  }
});

代码示例来源:origin: wasdennnoch/AndroidN-ify

public void hide(boolean animated) {
  if (!isShown) return;
  saveAndHide();
  if (animated) {
    animate().alpha(1)
        .withEndAction(mHideAnimationListener)
        .start();
  } else {
    mHideAnimationListener.run();
  }
  if (ConfigUtils.qs().fix_header_space && !ConfigUtils.qs().reconfigure_notification_panel)
    this.setVisibility(View.INVISIBLE);
}

相关文章