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