本文整理匯總了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;
}