本文整理了Java中android.widget.TextView.setPivotX()
方法的一些代码示例,展示了TextView.setPivotX()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TextView.setPivotX()
方法的具体详情如下:
包路径:android.widget.TextView
类名称:TextView
方法名:setPivotX
暂无
代码示例来源:origin: ZieIony/Carbon
@Override
public void setPivotX(float pivotX) {
super.setPivotX(pivotX);
invalidateParentIfNeeded();
fireOnTransformationChangedListener();
}
代码示例来源:origin: derry/delion
void prepareTitleAnim(TextView urlBar, TextView titleBar) {
mTitleBar = titleBar;
mUrlBar = urlBar;
mUrlBar.setPivotX(0f);
mUrlBar.setPivotY(0f);
mShouldRunTitleAnimation = true;
}
代码示例来源:origin: stackoverflow.com
private void addTextViewOnCanvas(Canvas canvas) {
LinearLayout layout = new LinearLayout(_context);
TextView textView = new TextView(_context);
textView.setVisibility(View.VISIBLE);
textView.setText("Hello Multiline text world .............");
textView.setWidth(canvas.getWidth() - 100);
textView.setBackgroundColor(Color.YELLOW);
textView.setPivotX(0);
textView.setPivotY(0);
textView.setRotation(90F);
layout.addView(textView);
layout.measure(canvas.getWidth(), canvas.getHeight());
layout.layout(0, 0, canvas.getWidth(), canvas.getHeight());
// To place the text view somewhere specific:
canvas.translate(_PosX, _PosY);
layout.draw(canvas);
}
代码示例来源:origin: DingMouRen/DingDingMap
@Override
public void setRotateAnchorPoints() {
image.setPivotX(buttonRadius - imageRect.left);
image.setPivotY(buttonRadius - imageRect.top);
text.setPivotX(buttonRadius - textRect.left);
text.setPivotY(buttonRadius - textRect.top);
}
代码示例来源:origin: DingMouRen/DingDingMap
@Override
public void setRotateAnchorPoints() {
image.setPivotX(buttonRadius - imageRect.left);
image.setPivotY(buttonRadius - imageRect.top);
text.setPivotX(trueRadius - textRect.left);
text.setPivotY(trueRadius - textRect.top);
}
代码示例来源:origin: ywwynm/EverythingDone
public void fallLabel() {
if (!raised) {
return;
}
mTextView.setPivotX(1);
mTextView.setPivotY(1);
mTextView.animate().scaleX(1.0f).setDuration(96);
mTextView.animate().scaleY(1.0f).setDuration(96);
mTextView.animate().translationY(0).setDuration(96);
raised = false;
}
代码示例来源:origin: freedom10086/Ruisi
private void setTabSelect(int from, int to) {
if (from != -1) {
ViewGroup tab_item_from = (ViewGroup) this.findViewWithTag(from);
ImageView pre_img = (ImageView) tab_item_from.getChildAt(0);
TextView pre_text = (TextView) tab_item_from.getChildAt(1);
//pre_text.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12);
pre_img.setColorFilter(COLOR_UNSELECT);
pre_text.setTextColor(COLOR_UNSELECT);
pre_text.setPivotX(pre_img.getWidth() / 2);
pre_text.setScaleX(1.0f);
pre_text.setScaleY(1.0f);
}
ViewGroup tab_item_to = (ViewGroup) this.findViewWithTag(to);
ImageView to_img = (ImageView) tab_item_to.getChildAt(0);
TextView to_text = (TextView) tab_item_to.getChildAt(1);
//to_text.setTextSize(TypedValue.COMPLEX_UNIT_SP, 13);
to_img.setImageResource(icons_unselect[to]);
to_img.setColorFilter(COLOR_SELECT);
to_text.setTextColor(COLOR_SELECT);
to_text.setPivotX(to_text.getWidth() / 2);
to_text.setScaleX(1.08f);
to_text.setScaleY(1.08f);
refreshDrawableState();
}
代码示例来源:origin: li2/learning-android-open-source
towardAnimators.add(toward);
card.setPivotX(X_SHIFT_DP);
Animator rotateAway = ObjectAnimator.ofFloat(card, "rotationY",
i == 0 ? 0 : ROTATE_DEGREES);
代码示例来源:origin: qiubiteme/android_api_demos
towardAnimators.add(toward);
card.setPivotX(X_SHIFT_DP);
Animator rotateAway = ObjectAnimator.ofFloat(card, "rotationY",
i == 0 ? 0 : ROTATE_DEGREES);
代码示例来源:origin: rockon999/LeanbackLauncher
private void scaleExpandedInfoAreaView(TextView view) {
view.setPivotX((float) (-view.getLeft()));
view.setPivotY((float) (-(view.getTop() - this.mInfoAreaTop)));
view.setScaleX(1.0f / this.mScaleFactor);
view.setScaleY(1.0f / this.mScaleFactor);
}
代码示例来源:origin: ywwynm/EverythingDone
public void raiseLabel(boolean anim) {
if (raised) {
return;
}
mTextView.setPivotX(1);
mTextView.setPivotY(1);
if (anim) {
mTextView.animate().scaleX(0.75f).setDuration(96);
mTextView.animate().scaleY(0.75f).setDuration(96);
mTextView.animate().translationY(-mScreenDensity * 24).setDuration(96);
} else {
mTextView.setScaleX(0.75f);
mTextView.setScaleY(0.75f);
mTextView.setTranslationY(-mScreenDensity * 24);
}
raised = true;
}
代码示例来源:origin: ywwynm/EverythingDone
private void updateHeader(int scrollY, boolean anim) {
float scale = titleShrinkFactor * scrollY + 1;
mTitle.setPivotX(1);
mTitle.setPivotY(1);
if (anim) {
mRelativeLayout.animate().translationY(-headerTranslationYFactor * scrollY);
/**
* Changing scaleX and scaleY of title is better than changing its textSize.
* pivotX and pivotY should be remained as 1 so that title's location won't
* be changed incorrectly.
*/
mTitle.animate().scaleX(scale).setDuration(160);
mTitle.animate().scaleY(scale).setDuration(160);
mSubtitle.animate().alpha(-1.0f / mScreenDensity / 90 * scrollY + 1).withLayer().setDuration(160);
} else {
mRelativeLayout.setTranslationY((int) (-headerTranslationYFactor * scrollY));
mTitle.setScaleX(scale);
mTitle.setScaleY(scale);
mSubtitle.setAlpha(-1.0f / mScreenDensity / 90 * scrollY + 1);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!