本文整理汇总了Java中android.widget.TextView.setScaleX方法的典型用法代码示例。如果您正苦于以下问题:Java TextView.setScaleX方法的具体用法?Java TextView.setScaleX怎么用?Java TextView.setScaleX使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.TextView
的用法示例。
在下文中一共展示了TextView.setScaleX方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: show
import android.widget.TextView; //导入方法依赖的package包/类
/**
* @param animate whether to animate the change
* @return this, to allow builder pattern
*/
public T show(boolean animate) {
mIsHidden = false;
if (isWeakReferenceValid()) {
TextView textView = mTextViewRef.get();
if (animate) {
textView.setScaleX(0);
textView.setScaleY(0);
textView.setVisibility(View.VISIBLE);
ViewPropertyAnimatorCompat animatorCompat = ViewCompat.animate(textView);
animatorCompat.cancel();
animatorCompat.setDuration(mAnimationDuration);
animatorCompat.scaleX(1).scaleY(1);
animatorCompat.setListener(null);
animatorCompat.start();
} else {
textView.setScaleX(1);
textView.setScaleY(1);
textView.setVisibility(View.VISIBLE);
}
}
return getSubInstance();
}
示例2: setUnreadCount
import android.widget.TextView; //导入方法依赖的package包/类
public void setUnreadCount(int unreadCount, final AnimationPNGSequence.IAnimationListener listener) {
final TextView badgeCountText = (TextView) findViewById(R.id.text_badge_count);
badgeCountText.setAlpha(0.0f);
if (unreadCount == 0) {
badgeCountText.setText("0");
getHeadAnimation().playAnimation("IDLE");
return;
}
String nextText = String.format("%d", new Object[]{Integer.valueOf(unreadCount)});
getHeadAnimation().playAnimation("IDLE_BACK");
badgeCountText.setText(nextText);
badgeCountText.setAlpha(DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
badgeCountText.setScaleX(DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
badgeCountText.setScaleY(DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
badgeCountText.animate().scaleY(1.3f).scaleX(1.3f).setDuration(200).withEndAction(new Runnable() {
public void run() {
badgeCountText.animate().scaleY(DefaultRetryPolicy.DEFAULT_BACKOFF_MULT).scaleX(DefaultRetryPolicy.DEFAULT_BACKOFF_MULT).setDuration(200).withEndAction(new Runnable() {
public void run() {
if (listener != null) {
listener.onAnimationFinished();
}
}
});
}
});
}
示例3: onLayout
import android.widget.TextView; //导入方法依赖的package包/类
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
if (dotRunnable != null) {
AndroidUtilities.cancelRunOnUIThread(dotRunnable);
dotRunnable = null;
}
if (currentAnimation != null) {
currentAnimation.cancel();
currentAnimation = null;
}
for (int a = 0; a < 4; a++) {
if (a < stringBuilder.length()) {
TextView textView = characterTextViews.get(a);
textView.setAlpha(0);
textView.setScaleX(1);
textView.setScaleY(1);
textView.setTranslationY(0);
textView.setTranslationX(getXForTextView(a));
textView = dotTextViews.get(a);
textView.setAlpha(1);
textView.setScaleX(1);
textView.setScaleY(1);
textView.setTranslationY(0);
textView.setTranslationX(getXForTextView(a));
} else {
characterTextViews.get(a).setAlpha(0);
dotTextViews.get(a).setAlpha(0);
}
}
super.onLayout(changed, left, top, right, bottom);
}
示例4: show
import android.widget.TextView; //导入方法依赖的package包/类
/**
* @param animate whether to animate the change
* @return this, to allow builder pattern
*/
public BadgeItem show(boolean animate) {
mIsHidden = false;
if (isWeakReferenceValid()) {
TextView textView = mTextViewRef.get();
if (animate) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
textView.setScaleX(0);
textView.setScaleY(0);
}
textView.setVisibility(View.VISIBLE);
ViewPropertyAnimatorCompat animatorCompat = ViewCompat.animate(textView);
animatorCompat.cancel();
animatorCompat.setDuration(mAnimationDuration);
animatorCompat.scaleX(1).scaleY(1);
animatorCompat.setListener(null);
animatorCompat.start();
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
textView.setScaleX(1);
textView.setScaleY(1);
}
textView.setVisibility(View.VISIBLE);
}
}
return this;
}