android.widget.TextView.getTranslationY()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(130)

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

TextView.getTranslationY介绍

暂无

代码示例

代码示例来源:origin: Hitomis/FunGameRefresh

public void postEnd() {
  isStart = false;
  funGameView.postStatus(FunGameView.STATUS_GAME_PREPAR);
  topMaskView.setTranslationY(topMaskView.getTranslationY() + halfHitBlockHeight);
  bottomMaskView.setTranslationY(bottomMaskView.getTranslationY() - halfHitBlockHeight);
  maskReLayout.setAlpha(1.f);
  topMaskView.setVisibility(View.VISIBLE);
  bottomMaskView.setVisibility(View.VISIBLE);
  maskReLayout.setVisibility(View.VISIBLE);
}

代码示例来源:origin: Hitomis/FunGameRefresh

private void doStart(long delay) {
  ObjectAnimator topMaskAnimator = ObjectAnimator.ofFloat(topMaskView, "translationY", topMaskView.getTranslationY(), -halfHitBlockHeight);
  ObjectAnimator bottomMaskAnimator = ObjectAnimator.ofFloat(bottomMaskView, "translationY", bottomMaskView.getTranslationY(), halfHitBlockHeight);
  ObjectAnimator maskShadowAnimator = ObjectAnimator.ofFloat(maskReLayout, "alpha", maskReLayout.getAlpha(), 0);
  AnimatorSet animatorSet = new AnimatorSet();
  animatorSet.play(topMaskAnimator).with(bottomMaskAnimator).with(maskShadowAnimator);
  animatorSet.setDuration(800);
  animatorSet.setStartDelay(delay);
  animatorSet.start();
  animatorSet.addListener(new AnimatorListenerAdapter() {
    @Override
    public void onAnimationEnd(Animator animation) {
      topMaskView.setVisibility(View.GONE);
      bottomMaskView.setVisibility(View.GONE);
      maskReLayout.setVisibility(View.GONE);
      funGameView.postStatus(FunGameView.STATUS_GAME_PLAY);
    }
  });
}

代码示例来源:origin: stackoverflow.com

public class OptionBindingAdapter {
  private boolean mOptionsShowing;

  @BindingAdapter("android:text")
  public void setOption(TextView button, String text) {
    if (text == null) {
      return;
    }

    if (button.getTranslationY() > 0) {
      button.setText(text);
      button.setVisibility(View.VISIBLE);
      button.animate()
          .translationY(0)
          .start();
    } else {
      button.animate()
          .translationY(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 200, button.getResources().getDisplayMetrics()))
          .start();
    }
  }
}

代码示例来源:origin: stackoverflow.com

final TextView tv = (TextView) findViewById(R.id.textView);
   tv.setTranslationX(tv.getTranslationX() + 10);
   tv.setTranslationY(tv.getTranslationY() + 10);
   tv.invalidate();

代码示例来源:origin: hearsilent/AmazingAvatar

(mToolbarTextView.getWidth() > newTextWidth ?
        (originTextWidth - newTextWidth) / 2f : 0);
mTitleTextViewPoint[1] = titleTextViewPoint[1] - mTitleTextView.getTranslationY();

相关文章

微信公众号

最新文章

更多

TextView类方法