當前位置: 首頁>>代碼示例>>Java>>正文


Java TextView.setScaleX方法代碼示例

本文整理匯總了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();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:27,代碼來源:BadgeItem.java

示例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();
                    }
                }
            });
        }
    });
}
 
開發者ID:bunnyblue,項目名稱:NoticeDog,代碼行數:27,代碼來源:YettiTabLayout.java

示例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);
}
 
開發者ID:MLNO,項目名稱:airgram,代碼行數:34,代碼來源:PasscodeView.java

示例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;
}
 
開發者ID:liu-xiao-dong,項目名稱:JD-Test,代碼行數:31,代碼來源:BadgeItem.java


注:本文中的android.widget.TextView.setScaleX方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。