当前位置: 首页>>代码示例>>Java>>正文


Java AnimUtils.getFastOutSlowInInterpolator方法代码示例

本文整理汇总了Java中io.plaidapp.util.AnimUtils.getFastOutSlowInInterpolator方法的典型用法代码示例。如果您正苦于以下问题:Java AnimUtils.getFastOutSlowInInterpolator方法的具体用法?Java AnimUtils.getFastOutSlowInInterpolator怎么用?Java AnimUtils.getFastOutSlowInInterpolator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.plaidapp.util.AnimUtils的用法示例。


在下文中一共展示了AnimUtils.getFastOutSlowInInterpolator方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: MaskMorphDrawable

import io.plaidapp.util.AnimUtils; //导入方法依赖的package包/类
MaskMorphDrawable(Context context, TextPaint textPaint,
                  int baseline, float charWidth, int insetStart) {
    this.insetStart = insetStart;
    this.baseline = baseline;
    this.charWidth = charWidth;
    paint = new TextPaint(textPaint);
    Rect maskBounds = new Rect();
    paint.getTextBounds(PASSWORD_MASK, 0, 1, maskBounds);
    maskDiameter = maskBounds.height();
    maskCenterY = (maskBounds.top + maskBounds.bottom) / 2f;
    showPasswordDuration =
            context.getResources().getInteger(R.integer.show_password_duration);
    hidePasswordDuration =
            context.getResources().getInteger(R.integer.hide_password_duration);
    fastOutSlowIn = AnimUtils.getFastOutSlowInInterpolator(context);
}
 
开发者ID:yongjhih,项目名称:android-proguards,代码行数:17,代码来源:PasswordEntry.java

示例2: getSettleInterpolator

import io.plaidapp.util.AnimUtils; //导入方法依赖的package包/类
/**
 * Provides the appropriate interpolator for the settle animation depending upon:
 * – If dismissing then exit at full speed i.e. linearly otherwise decelerate
 * – If have initial velocity then respect it (i.e. start linearly) otherwise accelerate into
 *   the animation.
 */
private TimeInterpolator getSettleInterpolator(boolean dismissing, float initialVelocity) {
    if (initialVelocity != 0) {
        if (dismissing) {
            return AnimUtils.getLinearInterpolator();
        } else {
            return AnimUtils.getLinearOutSlowInInterpolator(getContext());
        }
    } else {
        if (dismissing) {
            return AnimUtils.getFastOutLinearInInterpolator(getContext());
        } else {
            return AnimUtils.getFastOutSlowInInterpolator(getContext());
        }
    }
}
 
开发者ID:yongjhih,项目名称:android-proguards,代码行数:22,代码来源:BottomSheet.java

示例3: InkPageIndicator

import io.plaidapp.util.AnimUtils; //导入方法依赖的package包/类
public InkPageIndicator(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);

    final int density = (int) context.getResources().getDisplayMetrics().density;

    // Load attributes
    final TypedArray a = getContext().obtainStyledAttributes(
            attrs, R.styleable.InkPageIndicator, defStyle, 0);

    dotDiameter = a.getDimensionPixelSize(R.styleable.InkPageIndicator_dotDiameter,
            DEFAULT_DOT_SIZE * density);
    dotRadius = dotDiameter / 2;
    halfDotRadius = dotRadius / 2;
    gap = a.getDimensionPixelSize(R.styleable.InkPageIndicator_dotGap,
            DEFAULT_GAP * density);
    animDuration = (long) a.getInteger(R.styleable.InkPageIndicator_animationDuration,
            DEFAULT_ANIM_DURATION);
    animHalfDuration = animDuration / 2;
    unselectedColour = a.getColor( R.styleable.InkPageIndicator_pageIndicatorColor,
            DEFAULT_UNSELECTED_COLOUR);
    selectedColour = a.getColor( R.styleable.InkPageIndicator_currentPageIndicatorColor,
            DEFAULT_SELECTED_COLOUR);

    a.recycle();

    unselectedPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    unselectedPaint.setColor(unselectedColour);
    selectedPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    selectedPaint.setColor(selectedColour);
    interpolator = AnimUtils.getFastOutSlowInInterpolator(context);

    // create paths & rect now – reuse & rewind later
    combinedUnselectedPath = new Path();
    unselectedDotPath = new Path();
    unselectedDotLeftPath = new Path();
    unselectedDotRightPath = new Path();
    rectF = new RectF();

    addOnAttachStateChangeListener(this);
}
 
开发者ID:liulinbo,项目名称:Amumu,代码行数:41,代码来源:InkPageIndicator.java

示例4: createAnimator

import io.plaidapp.util.AnimUtils; //导入方法依赖的package包/类
@Override
public Animator createAnimator(final ViewGroup sceneRoot,
                               final TransitionValues startValues,
                               final TransitionValues endValues) {
    final Animator changeBounds = super.createAnimator(sceneRoot, startValues, endValues);
    if (changeBounds == null) return null;

    TimeInterpolator interpolator = getInterpolator();
    if (interpolator == null) {
        interpolator = AnimUtils.getFastOutSlowInInterpolator(sceneRoot.getContext());
    }

    final MorphDrawable background = new MorphDrawable(startColor, startCornerRadius);
    endValues.view.setBackground(background);

    final Animator color = ObjectAnimator.ofArgb(background, MorphDrawable.COLOR, endColor);
    final Animator corners =
            ObjectAnimator.ofFloat(background, MorphDrawable.CORNER_RADIUS, endCornerRadius);

    // ease in the dialog's child views (fade in & staggered slide up)
    if (endValues.view instanceof ViewGroup) {
        final ViewGroup vg = (ViewGroup) endValues.view;
        final long duration = getDuration() / 2;
        float offset = vg.getHeight() / 3;
        for (int i = 0; i < vg.getChildCount(); i++) {
            View v = vg.getChildAt(i);
            v.setTranslationY(offset);
            v.setAlpha(0f);
            v.animate()
                    .alpha(1f)
                    .translationY(0f)
                    .setDuration(duration)
                    .setStartDelay(duration)
                    .setInterpolator(interpolator);
            offset *= 1.8f;
        }
    }

    final AnimatorSet transition = new AnimatorSet();
    transition.playTogether(changeBounds, corners, color);
    transition.setDuration(getDuration());
    transition.setInterpolator(interpolator);
    return transition;
}
 
开发者ID:liulinbo,项目名称:Amumu,代码行数:45,代码来源:MorphTransform.java


注:本文中的io.plaidapp.util.AnimUtils.getFastOutSlowInInterpolator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。