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

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

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

ViewPropertyAnimator.translationYBy介绍

暂无

代码示例

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

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

代码示例来源:origin: alibaba/Tangram-Android

@Override
  public ViewPropertyAnimator onGetFixViewDisappearAnimator(View fixView) {
    int height = fixView.getMeasuredHeight();
    return fixView.animate().translationYBy(-height).setDuration(duration);
  }
});

代码示例来源:origin: alibaba/Tangram-Android

@Override
public ViewPropertyAnimator onGetFixViewAppearAnimator(View fixView) {
  int height = fixView.getMeasuredHeight();
  fixView.setTranslationY(-height);
  return fixView.animate().translationYBy(height).setDuration(duration);
}

代码示例来源:origin: alibaba/Tangram-Android

@Override
  public ViewPropertyAnimator onGetFixViewDisappearAnimator(View fixView) {
    int height = fixView.getMeasuredHeight();
    return fixView.animate().translationYBy(-height).setDuration(duration);
  }
});

代码示例来源:origin: alibaba/Tangram-Android

@Override
public ViewPropertyAnimator onGetFixViewAppearAnimator(View fixView) {
  int height = fixView.getMeasuredHeight();
  fixView.setTranslationY(-height);
  return fixView.animate().translationYBy(height).setDuration(duration);
}

代码示例来源:origin: mmin18/RealtimeBlurView

public void doSlide(View v) {
    final View view = findViewById(R.id.blur_frame);
    view.animate().translationYBy((slideUp ? -1 : 1) * view.getHeight()).setDuration(1000).start();
    slideUp = !slideUp;
  }
}

代码示例来源:origin: zhihu/Matisse

@Override
public void onClick() {
  if (!mSpec.autoHideToobar) {
    return;
  }
  if (mIsToolbarHide) {
    mTopToolbar.animate()
        .setInterpolator(new FastOutSlowInInterpolator())
        .translationYBy(mTopToolbar.getMeasuredHeight())
        .start();
    mBottomToolbar.animate()
        .translationYBy(-mBottomToolbar.getMeasuredHeight())
        .setInterpolator(new FastOutSlowInInterpolator())
        .start();
  } else {
    mTopToolbar.animate()
        .setInterpolator(new FastOutSlowInInterpolator())
        .translationYBy(-mTopToolbar.getMeasuredHeight())
        .start();
    mBottomToolbar.animate()
        .setInterpolator(new FastOutSlowInInterpolator())
        .translationYBy(mBottomToolbar.getMeasuredHeight())
        .start();
  }
  mIsToolbarHide = !mIsToolbarHide;
}

代码示例来源:origin: hitherejoe/animate

@OnClick(R.id.text_animate)
public void animate() {
  int padding =
      mFloatingActionButton.getPaddingBottom() + mFloatingActionButton.getPaddingTop();
  int height = mLayoutRoot.getHeight() - padding;
  ActionBar actionBar = getSupportActionBar();
  if (actionBar != null) height -= actionBar.getHeight();
  if (!mIsButtonAtTop) height = -height;
  mIsButtonAtTop = !mIsButtonAtTop;
  mFloatingActionButton.animate().setInterpolator(getSelectedInterpolator())
      .setDuration(500)
      .setStartDelay(200)
      .translationYBy(height)
      .setListener(new Animator.AnimatorListener() {
        @Override
        public void onAnimationStart(Animator animation) {
          mAnimateText.setEnabled(false);
        }
        @Override
        public void onAnimationEnd(Animator animation) {
          mAnimateText.setEnabled(true);
        }
        @Override
        public void onAnimationCancel(Animator animation) { }
        @Override
        public void onAnimationRepeat(Animator animation) { }
      })
      .start();
}

代码示例来源:origin: com.nineoldandroids/library

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

代码示例来源:origin: Android500/AwesomeDrawer

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

代码示例来源:origin: 8enet/AppOpsX

@Override
 public void onGlobalLayout() {
  offset = ((View) fab.getParent()).getBottom() - fab.getTop();
  if (offset != 0) {
   ScrollTopHelper.this.fab.animate().translationYBy(offset).start();
   ScrollTopHelper.this.fab.getViewTreeObserver().removeOnGlobalLayoutListener(this);
  }
 }
});

代码示例来源:origin: 8enet/AppOpsX

private void hide() {
 childPos = RecyclerView.NO_POSITION;
 if (fab.getAlpha() == 1) {
  fab.animate().translationYBy(offset).alpha(0).start();
 }
}

代码示例来源:origin: 8enet/AppOpsX

private void show() {
 fab.setEnabled(true);
 if (fab.getAlpha() == 0) {
  fab.animate().translationYBy(-offset).alpha(1).start();
 }
}

代码示例来源:origin: AntonioRedondo/AnotherMonitor

@Override
  public void onClick(View v) {
    mPrefs.edit().putBoolean(C.welcome, false).apply();
    mLWelcome.animate().setDuration(animDuration).setListener(new AnimatorListenerAdapter() {
      @Override
      public void onAnimationEnd(Animator animation) {
        ((ViewManager) mLWelcome.getParent()).removeView(mLWelcome);
        mLWelcome = null;
      }
    }).setStartDelay(0).alpha(0).translationYBy(-15*sD);
  }
});

代码示例来源:origin: AntonioRedondo/AnotherMonitor

@Override
  public void onClick(View v) {
    mPrefs.edit().putBoolean(C.firstTimeProcesses, false).apply();
    mLWelcome.animate().setDuration(animDuration).setListener(new AnimatorListenerAdapter() {
      @Override
      public void onAnimationEnd(Animator animation) {
        ((ViewManager) mLWelcome.getParent()).removeView(mLWelcome);
        mLWelcome = null;
      }
    }).setStartDelay(0).alpha(0).translationYBy(-15*sD);
  }
});

代码示例来源:origin: AntonioRedondo/AnotherMonitor

@Override
  public void onClick(View v) {
    mLFeedback.animate().setDuration(animDuration).setListener(new AnimatorListenerAdapter() {
      @Override
      public void onAnimationEnd(Animator animation) {
        ((ViewManager) mLFeedback.getParent()).removeView(mLFeedback);
        mLFeedback = null;
      }
    }).setStartDelay(0).alpha(0).translationYBy(-15*sD);
    mPrefs.edit().putLong(C.welcomeDate, Calendar.getInstance(TimeZone.getTimeZone(C.europeLondon)).getTimeInMillis()).apply();
    Toast.makeText(ActivityMain.this, getString(R.string.w_main_feedback_no_remind), Toast.LENGTH_LONG).show();
  }
});

代码示例来源:origin: GaoGersy/MultiSelecter

private void animateTranslation(View view, float deltaX, float deltaY, Long duration) {
  view.animate().setDuration(duration)
      .setInterpolator(new OvershootInterpolator(1.1f))
      .translationXBy(deltaX)
      .translationYBy(deltaY)
      .start();
}

代码示例来源:origin: easemob/livestream_demo_android

private void dismissSelectLayout() {
  selectLiveIdLayout.animate()
      .translationYBy(selectLiveIdLayout.getHeight())
      .setDuration(500)
      .start();
}

代码示例来源:origin: AntonioRedondo/AnotherMonitor

@Override
  public void onClick(View v) {
    mPrefs.edit().putBoolean(C.feedbackDone, true).apply();
    Toast.makeText(ActivityMain.this, getString(R.string.w_main_feedback_done_thanks), Toast.LENGTH_SHORT).show();
    mLFeedback.animate().setDuration(animDuration).setListener(new AnimatorListenerAdapter() {
      @Override
      public void onAnimationEnd(Animator animation) {
        ((ViewManager) mLFeedback.getParent()).removeView(mLFeedback);
        mLFeedback = null;
      }
    }).setStartDelay(0).alpha(0).translationYBy(-15*sD);
  }
});

代码示例来源:origin: easemob/livestream_demo_android

private void showSelectLayout() {
  selectLiveIdLayout.setVisibility(View.VISIBLE);
  selectLiveIdLayout.setTranslationY(selectLiveIdLayout.getHeight());
  selectLiveIdLayout.animate()
      .translationYBy(-selectLiveIdLayout.getHeight())
      .setDuration(500)
      .start();
}

相关文章