コード例 #1
0
ファイル: PostFragment.java プロジェクト: Nodebuck/Pr0
  private void showPostVoteAnimation(Vote vote) {
    if (vote == null || vote == Vote.NEUTRAL) return;

    // quickly center the vote button
    simulateScroll();

    String text = vote == Vote.UP ? "+" : (vote == Vote.DOWN ? "-" : "*");
    voteAnimationIndicator.setText(text);

    voteAnimationIndicator.setVisibility(View.VISIBLE);
    voteAnimationIndicator.setAlpha(0);
    voteAnimationIndicator.setScaleX(0.7f);
    voteAnimationIndicator.setScaleY(0.7f);

    ObjectAnimator animator =
        ObjectAnimator.ofPropertyValuesHolder(
            voteAnimationIndicator,
            ofFloat(View.ALPHA, 0, 0.6f, 0.7f, 0.6f, 0),
            ofFloat(View.SCALE_X, 0.7f, 1.3f),
            ofFloat(View.SCALE_Y, 0.7f, 1.3f));

    animator.start();
    animator.addListener(
        new AnimatorListenerAdapter() {
          @Override
          public void onAnimationEnd(Animator animation) {
            View view = PostFragment.this.voteAnimationIndicator;
            if (view != null) {
              view.setVisibility(View.GONE);
            }
          }
        });
  }
 private void _showTapCount(int size) {
   _tapEventCountShow.setText(String.valueOf(size));
   _tapEventCountShow.setVisibility(View.VISIBLE);
   _tapEventCountShow.setScaleX(1f);
   _tapEventCountShow.setScaleY(1f);
   ViewCompat.animate(_tapEventCountShow)
       .scaleXBy(-1f)
       .scaleYBy(-1f)
       .setDuration(800)
       .setStartDelay(100);
 }