本文整理了Java中android.widget.TextView.getTranslationX()
方法的一些代码示例,展示了TextView.getTranslationX()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TextView.getTranslationX()
方法的具体详情如下:
包路径:android.widget.TextView
类名称:TextView
方法名:getTranslationX
暂无
代码示例来源:origin: dabutaizha/juzimi
private void startAlternateAnimation() {
Log.d("dabutaizha", "into startAlternateAnimation");
Object obj = mQuestionIcon.getTag();
if (obj == null || "animation_start".equals(obj)) {
float curTranslationX = mQuestionIcon.getTranslationX();
ObjectAnimator iconAnimatorStart = ObjectAnimator.ofFloat(mQuestionIcon, "translationX", curTranslationX, -800f);
iconAnimatorStart.start();
mQuestionIcon.setTag("animation_end");
mTipContent.setVisibility(View.VISIBLE);
ObjectAnimator contentAnimatorStart = ObjectAnimator.ofFloat(mTipContent, "alpha", 0f, 1f);
contentAnimatorStart.start();
}
if ("animation_end".equals(obj)) {
float curTranslationX = mQuestionIcon.getTranslationX();
ObjectAnimator iconAnimatorStart = ObjectAnimator.ofFloat(mQuestionIcon, "translationX", curTranslationX, 0f);
iconAnimatorStart.start();
mQuestionIcon.setTag("animation_start");
ObjectAnimator contentAnimatorStart = ObjectAnimator.ofFloat(mTipContent, "alpha", 1f, 0f);
contentAnimatorStart.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
int[] titleTextViewPoint = new int[2];
mTitleTextView.getLocationOnScreen(titleTextViewPoint);
mTitleTextViewPoint[0] = titleTextViewPoint[0] - mTitleTextView.getTranslationX() -
(mToolbarTextView.getWidth() > newTextWidth ?
(originTextWidth - newTextWidth) / 2f : 0);
内容来源于网络,如有侵权,请联系作者删除!