當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。