当前位置: 首页>>代码示例>>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;未经允许,请勿转载。