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

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

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

ViewPropertyAnimator.translationY介绍

暂无

代码示例

代码示例来源:origin: commonsguy/cw-omnibus

@Override
public ViewPropertyAnimator translationY(float value) {
  android.view.ViewPropertyAnimator n = mNative.get();
  if (n != null) {
    n.translationY(value);
  }
  return this;
}

代码示例来源:origin: xinghongfei/LookLook

private void viewEnterAnimationNest(View view, float offset, Interpolator interp) {
  view.setTranslationY(-offset);
  view.animate()
      .translationY(0f)
      .alpha(1f)
      .setDuration(50L)
      .setInterpolator(interp)
      .setListener(null)
      .start();
}

代码示例来源:origin: janishar/PlaceHolderView

protected static <V extends View>void itemAnimFromYAsc(V view, float yInit, float yFinal, float factor, int duration){
  view.setTranslationY(yInit);
  view.animate()
      .translationY(yFinal)
      .setInterpolator(new AccelerateInterpolator(factor))
      .setDuration(duration)
      .start();
}

代码示例来源:origin: xinghongfei/LookLook

private void viewEnterAnimationNest(View view, float offset, Interpolator interp) {
  view.setTranslationY(-offset);
  view.setAlpha(0.3f);
  view.animate()
      .translationY(0f)
      .alpha(1f)
      .setDuration(500L)
      .setInterpolator(interp)
      .setListener(null)
      .start();
}

代码示例来源:origin: xinghongfei/LookLook

private void viewEnterAnimation(View view, float offset, Interpolator interp) {
  view.setTranslationY(-offset);
  view.setAlpha(0.6f);
  view.animate()
      .translationY(0f)
      .alpha(1f)
      .setDuration(600L)
      .setInterpolator(interp)
      .setListener(null)
      .start();
}

代码示例来源:origin: xinghongfei/LookLook

private void viewEnterAnimation(View view, float offset, Interpolator interp) {
  view.setTranslationY(-offset);
  view.setAlpha(0f);
  view.animate()
      .translationY(0f)
      .alpha(1f)
      .setDuration(500L)
      .setInterpolator(interp)
      .setListener(null)
      .start();
}
private void viewEnterAnimationNest(View view, float offset, Interpolator interp) {

代码示例来源:origin: frogermcs/InstaMaterial

private void startIntroAnimation() {
  vUpperPanel.animate().translationY(0).setDuration(400).setInterpolator(DECELERATE_INTERPOLATOR);
  vLowerPanel.animate().translationY(0).setDuration(400).setInterpolator(DECELERATE_INTERPOLATOR).start();
}

代码示例来源:origin: arimorty/floatingsearchview

private void animateItem(View view) {
    view.setTranslationY(Util.getScreenHeight((Activity) view.getContext()));
    view.animate()
        .translationY(0)
        .setInterpolator(new DecelerateInterpolator(3.f))
        .setDuration(700)
        .start();
  }
}

代码示例来源:origin: frogermcs/InstaMaterial

private void animateUserProfileHeader() {
      vUserProfileRoot.setTranslationY(-vUserProfileRoot.getHeight());
      ivUserProfilePhoto.setTranslationY(-ivUserProfilePhoto.getHeight());
      vUserDetails.setTranslationY(-vUserDetails.getHeight());
      vUserStats.setAlpha(0);

      vUserProfileRoot.animate().translationY(0).setDuration(300).setInterpolator(INTERPOLATOR);
      ivUserProfilePhoto.animate().translationY(0).setDuration(300).setStartDelay(100).setInterpolator(INTERPOLATOR);
      vUserDetails.animate().translationY(0).setDuration(300).setStartDelay(200).setInterpolator(INTERPOLATOR);
      vUserStats.animate().alpha(1).setDuration(200).setStartDelay(400).setInterpolator(INTERPOLATOR).start();
  }
}

代码示例来源:origin: CameraKit/blurkit-android

@Override
  public void onAnimationEnd(Animator animation) {
    super.onAnimationEnd(animation);
    movement = movement > 0 ? -150 : 150;
    blurLayout.animate().translationY(movement).setDuration(1500).setListener(this).start();
  }
}).start();

代码示例来源:origin: frogermcs/InstaMaterial

private void runEnterAnimation(final FeedAdapter.CellFeedViewHolder holder) {
  final int screenHeight = Utils.getScreenHeight(holder.itemView.getContext());
  holder.itemView.setTranslationY(screenHeight);
  holder.itemView.animate()
      .translationY(0)
      .setInterpolator(new DecelerateInterpolator(3.f))
      .setDuration(700)
      .setListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
          dispatchAddFinished(holder);
        }
      })
      .start();
}

代码示例来源:origin: frogermcs/InstaMaterial

private void animateContent() {
  commentsAdapter.updateItems();
  llAddComment.animate().translationY(0)
      .setInterpolator(new DecelerateInterpolator())
      .setDuration(200)
      .start();
}

代码示例来源:origin: xinghongfei/LookLook

protected void hideOrShowToolbar() {
  mToolbar.animate()
      .translationY(mIsHidden ? 0 : -mToolbar.getHeight())
      .setInterpolator(new DecelerateInterpolator(2))
      .start();
  mIsHidden = !mIsHidden;
}

代码示例来源:origin: avjinder/Minimal-Todo

@Override
  public void hide() {
    CoordinatorLayout.LayoutParams lp = (CoordinatorLayout.LayoutParams) mAddToDoItemFAB.getLayoutParams();
    int fabMargin = lp.bottomMargin;
    mAddToDoItemFAB.animate().translationY(mAddToDoItemFAB.getHeight() + fabMargin).setInterpolator(new AccelerateInterpolator(2.0f)).start();
  }
};

代码示例来源:origin: frogermcs/InstaMaterial

private void startContentAnimation() {
  fabCreate.animate()
      .translationY(0)
      .setInterpolator(new OvershootInterpolator(1.f))
      .setStartDelay(300)
      .setDuration(ANIM_DURATION_FAB)
      .start();
  feedAdapter.updateItems(true);
}

代码示例来源:origin: Rukey7/MvpApp

@Override
  public void onPhotoClick() {
    mIsHideToolbar = !mIsHideToolbar;
    if (mIsHideToolbar) {
      mDragLayout.scrollOutScreen(300);
      mToolbar.animate().translationY(-mToolbar.getBottom()).setDuration(300);
    } else {
      mDragLayout.scrollInScreen(300);
      mToolbar.animate().translationY(0).setDuration(300);
    }
  }
});

代码示例来源:origin: Rukey7/MvpApp

@Override
  public void onPhotoClick() {
    mIsHideToolbar = !mIsHideToolbar;
    if (mIsHideToolbar) {
      mDragLayout.startOutAnim();
      mToolbar.animate().translationY(-mToolbar.getBottom()).setDuration(300);
    } else {
      mDragLayout.startInAnim();
      mToolbar.animate().translationY(0).setDuration(300);
    }
  }
});

代码示例来源:origin: frogermcs/InstaMaterial

@Override
public void onBackPressed() {
  ViewCompat.setElevation(getToolbar(), 0);
  contentRoot.animate()
      .translationY(Utils.getScreenHeight(this))
      .setDuration(200)
      .setListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
          CommentsActivity.super.onBackPressed();
          overridePendingTransition(0, 0);
        }
      })
      .start();
}

代码示例来源:origin: frogermcs/InstaMaterial

private void animateUserProfileOptions() {
  tlUserProfileTabs.setTranslationY(-tlUserProfileTabs.getHeight());
  tlUserProfileTabs.animate().translationY(0).setDuration(300).setStartDelay(USER_OPTIONS_ANIMATION_DELAY).setInterpolator(INTERPOLATOR);
}

代码示例来源:origin: nickbutcher/plaid

private void showFab() {
  fab.setAlpha(0f);
  fab.setScaleX(0f);
  fab.setScaleY(0f);
  fab.setTranslationY(fab.getHeight() / 2);
  fab.animate()
      .alpha(1f)
      .scaleX(1f)
      .scaleY(1f)
      .translationY(0f)
      .setDuration(300L)
      .setInterpolator(AnimUtils.getLinearOutSlowInInterpolator(this))
      .start();
}

相关文章