本文整理汇总了Java中android.support.v4.view.animation.PathInterpolatorCompat.create方法的典型用法代码示例。如果您正苦于以下问题:Java PathInterpolatorCompat.create方法的具体用法?Java PathInterpolatorCompat.create怎么用?Java PathInterpolatorCompat.create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v4.view.animation.PathInterpolatorCompat
的用法示例。
在下文中一共展示了PathInterpolatorCompat.create方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: animateStaticImageVisibility
import android.support.v4.view.animation.PathInterpolatorCompat; //导入方法依赖的package包/类
private void animateStaticImageVisibility(boolean visible) {
// If the panel is expanded then #onUpdateFromPeekToExpand() is responsible for setting
// mStaticImageVisibility and the static image appearance should not be animated.
if (visible && mExpandedPercentage > 0.f) return;
if (mStaticImageVisibilityInterpolator == null) {
mStaticImageVisibilityInterpolator =
PathInterpolatorCompat.create(0.4f, 0.f, 0.6f, 1.f);
}
mOverlayPanelAnimation.cancelAnimation(this, AnimationType.STATIC_IMAGE_VISIBILITY);
float endValue = visible ? 1.f : 0.f;
mOverlayPanelAnimation.addToAnimation(this, AnimationType.STATIC_IMAGE_VISIBILITY,
mStaticImageVisibilityPercentage, endValue,
OverlayPanelAnimation.BASE_ANIMATION_DURATION_MS, 0, false,
mStaticImageVisibilityInterpolator);
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:19,代码来源:ContextualSearchImageControl.java
示例2: animateCustomImageVisibility
import android.support.v4.view.animation.PathInterpolatorCompat; //导入方法依赖的package包/类
private void animateCustomImageVisibility(boolean visible) {
// If the panel is expanded then #onUpdateFromPeekToExpand() is responsible for setting
// mCustomImageVisibility and the custom image appearance should not be animated.
if (visible && mExpandedPercentage > 0.f) return;
if (mCustomImageVisibilityInterpolator == null) {
mCustomImageVisibilityInterpolator =
PathInterpolatorCompat.create(0.4f, 0.f, 0.6f, 1.f);
}
mOverlayPanelAnimation.cancelAnimation(this, AnimationType.CUSTOM_IMAGE_VISIBILITY);
float endValue = visible ? 1.f : 0.f;
mOverlayPanelAnimation.addToAnimation(this, AnimationType.CUSTOM_IMAGE_VISIBILITY,
mCustomImageVisibilityPercentage, endValue,
OverlayPanelAnimation.BASE_ANIMATION_DURATION_MS, 0, false,
mCustomImageVisibilityInterpolator);
}
示例3: createTimeInterpolator
import android.support.v4.view.animation.PathInterpolatorCompat; //导入方法依赖的package包/类
private static @Nullable
Interpolator createTimeInterpolator(@NonNull WXAnimationBean animation) {
String interpolator = animation.timingFunction;
if (!TextUtils.isEmpty(interpolator)) {
switch (interpolator) {
case WXAnimationBean.EASE_IN:
return new AccelerateInterpolator();
case WXAnimationBean.EASE_OUT:
return new DecelerateInterpolator();
case WXAnimationBean.EASE_IN_OUT:
return new AccelerateDecelerateInterpolator();
case WXAnimationBean.LINEAR:
return new LinearInterpolator();
default:
//Parse cubic-bezier
try {
SingleFunctionParser<Float> parser = new SingleFunctionParser<>(
animation.timingFunction,
new SingleFunctionParser.FlatMapper<Float>() {
@Override
public Float map(String raw) {
return Float.parseFloat(raw);
}
});
List<Float> params = parser.parse(WXAnimationBean.CUBIC_BEZIER);
if (params != null && params.size() == WXAnimationBean.NUM_CUBIC_PARAM) {
return PathInterpolatorCompat.create(
params.get(0), params.get(1), params.get(2), params.get(3));
}
else {
return null;
}
}catch (RuntimeException e){
return null;
}
}
}
return null;
}
示例4: createTimeInterpolator
import android.support.v4.view.animation.PathInterpolatorCompat; //导入方法依赖的package包/类
private
@Nullable
Interpolator createTimeInterpolator() {
String interpolator = mAnimationBean.timingFunction;
if (!TextUtils.isEmpty(interpolator)) {
switch (interpolator) {
case WXAnimationBean.EASE_IN:
return new AccelerateInterpolator();
case WXAnimationBean.EASE_OUT:
return new DecelerateInterpolator();
case WXAnimationBean.EASE_IN_OUT:
return new AccelerateDecelerateInterpolator();
case WXAnimationBean.LINEAR:
return new LinearInterpolator();
default:
//Parse cubic-bezier
try {
SingleFunctionParser<Float> parser = new SingleFunctionParser<>(
mAnimationBean.timingFunction,
new SingleFunctionParser.FlatMapper<Float>() {
@Override
public Float map(String raw) {
return Float.parseFloat(raw);
}
});
List<Float> params = parser.parse(WXAnimationBean.CUBIC_BEZIER);
if (params != null && params.size() == WXAnimationBean.NUM_CUBIC_PARAM) {
return PathInterpolatorCompat.create(
params.get(0), params.get(1), params.get(2), params.get(3));
} else {
return null;
}
} catch (RuntimeException e) {
return null;
}
}
}
return null;
}
示例5: initAnimatior
import android.support.v4.view.animation.PathInterpolatorCompat; //导入方法依赖的package包/类
private ValueAnimator initAnimatior(final ProgressBean pb) {
Interpolator pathInterpolatorCompat = PathInterpolatorCompat.create(0.7f, 0f, 0.3f, 1f);
ValueAnimator mAnimator = ValueAnimator.ofInt(0, 359);
mAnimator.setDuration(pb.getDuration());
mAnimator.setInterpolator(pathInterpolatorCompat);
mAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
Log.d("dur", animation.getAnimatedValue() + "====" + pb.getmBallRadius());
pb.setmCurrentAngle((int) animation.getAnimatedValue());
invalidate();
}
});
return mAnimator;
}
示例6: onScroll
import android.support.v4.view.animation.PathInterpolatorCompat; //导入方法依赖的package包/类
@Override
public void onScroll(int height, int scrollArea, float scrollPosition) {
final Interpolator interpolator = PathInterpolatorCompat.create(.19f,0f,.2f,1f);
final float interpolation = interpolator.getInterpolation((scrollPosition * .30f));
final int bottomPadding = (int) (-1f * interpolation * scrollArea);
findViewById(R.id.activity_input).setTranslationY(bottomPadding);
findViewById(R.id.activity_recyclerview).setTranslationY(bottomPadding);
}
示例7: onUserTouchMove
import android.support.v4.view.animation.PathInterpolatorCompat; //导入方法依赖的package包/类
@Override
public void onUserTouchMove(MotionEvent motionEvent) {
float distance = Math.max(
Math.abs(motionEvent.getRawX() - originalX),
Math.abs(motionEvent.getRawY() - originalY)
);
unlockOnUp = distance > unlockDistance;
if (unlockOnUp && !hasVibrated) {
SRJHelper.vibrate(20, mContext);
hasVibrated = true;
}
float scale = distance/(mContext.getResources().getDimensionPixelSize(R.dimen.lockscreen_ac_display_unlock_distance_max));
final float MAX_ALPHA = 0.6f;
dimView.animate().alpha(scale/ MAX_ALPHA).setDuration(0).start();
Interpolator customInterpolator = PathInterpolatorCompat.create(0.080f, 1.80f, 0.590f, 1.70f);
scale = customInterpolator.getInterpolation(scale);
scaleAnimator = unlockView.animate().scaleX(scale).scaleY(scale).setDuration(0);
scaleAnimator.start();
float imgLockScale = scale/2;
if (imgLockScale > 0.35f) {
imgLockScale = 0.35f;
}
imgLock.animate().alpha(scale).scaleX(imgLockScale).scaleY(imgLockScale).setDuration(0).start();
}
示例8: initTangentInterpolator
import android.support.v4.view.animation.PathInterpolatorCompat; //导入方法依赖的package包/类
private void initTangentInterpolator() {
if (mCircleRadius > 0 && (mDragHeight >= mCircleRadius * 2)) {
// The run // 270~360~mTangentAngle=>0~90~mTangentAngle
// When drag double radius the angle = MIN_RUN_ANGLE
mTangentInterpolator = PathInterpolatorCompat.create((mCircleRadius * 2) / mDragHeight,
MIN_RUN_ANGLE / (MIN_RUN_ANGLE + mTangentAngle));
}
}
示例9: doScroll
import android.support.v4.view.animation.PathInterpolatorCompat; //导入方法依赖的package包/类
public void doScroll(String direction) {
Interpolator customInterpolator = PathInterpolatorCompat.create(0.445f, 0.050f, 0.550f, 0.950f);
if (direction.equals("up")) {
mRecyclerView.smoothScrollBy(0,(int) (-FullscreenActivity.scrollDistance * mRecyclerView.getHeight()),customInterpolator);
} else {
mRecyclerView.smoothScrollBy(0,(int) (+FullscreenActivity.scrollDistance * mRecyclerView.getHeight()),customInterpolator);
}
}
示例10: create
import android.support.v4.view.animation.PathInterpolatorCompat; //导入方法依赖的package包/类
public static Interpolator create() {
return PathInterpolatorCompat.create(0.25f, 0.1f, 0.25f, 1.f);
}
示例11: newInstance
import android.support.v4.view.animation.PathInterpolatorCompat; //导入方法依赖的package包/类
static <T> Keyframe<T> newInstance(JSONObject json, LottieComposition composition, float scale,
AnimatableValue.Factory<T> valueFactory) {
PointF cp1 = null;
PointF cp2 = null;
float startFrame = 0;
T startValue = null;
T endValue = null;
Interpolator interpolator = null;
if (json.has("t")) {
startFrame = (float) json.optDouble("t", 0);
Object startValueJson = json.opt("s");
if (startValueJson != null) {
startValue = valueFactory.valueFromObject(startValueJson, scale);
}
Object endValueJson = json.opt("e");
if (endValueJson != null) {
endValue = valueFactory.valueFromObject(endValueJson, scale);
}
JSONObject cp1Json = json.optJSONObject("o");
JSONObject cp2Json = json.optJSONObject("i");
if (cp1Json != null && cp2Json != null) {
cp1 = JsonUtils.pointFromJsonObject(cp1Json, scale);
cp2 = JsonUtils.pointFromJsonObject(cp2Json, scale);
}
boolean hold = json.optInt("h", 0) == 1;
if (hold) {
endValue = startValue;
// TODO: create a HoldInterpolator so progress changes don't invalidate.
interpolator = LINEAR_INTERPOLATOR;
} else if (cp1 != null) {
interpolator = PathInterpolatorCompat.create(
cp1.x / scale, cp1.y / scale, cp2.x / scale, cp2.y / scale);
} else {
interpolator = LINEAR_INTERPOLATOR;
}
} else {
startValue = valueFactory.valueFromObject(json, scale);
endValue = startValue;
}
return new Keyframe<>(composition, startValue, endValue, interpolator, startFrame, null);
}
示例12: createInterpolatorFor
import android.support.v4.view.animation.PathInterpolatorCompat; //导入方法依赖的package包/类
@Override
public Interpolator createInterpolatorFor(AnimationBody animationBody) {
return PathInterpolatorCompat.create(0.68f, -0.55f, 0.265f, 1.55f);
}
示例13: createInterpolatorFor
import android.support.v4.view.animation.PathInterpolatorCompat; //导入方法依赖的package包/类
@Override
public Interpolator createInterpolatorFor(AnimationBody animationBody) {
return PathInterpolatorCompat.create(0.19f, 1f, 0.22f, 1f);
}
示例14: createInterpolatorFor
import android.support.v4.view.animation.PathInterpolatorCompat; //导入方法依赖的package包/类
@Override
public Interpolator createInterpolatorFor(AnimationBody animationBody) {
return PathInterpolatorCompat.create(0.6f, -0.28f, 0.735f, 0.045f);
}
示例15: createInterpolatorFor
import android.support.v4.view.animation.PathInterpolatorCompat; //导入方法依赖的package包/类
@Override
public Interpolator createInterpolatorFor(AnimationBody animationBody) {
return PathInterpolatorCompat.create(0.55f, 0.055f, 0.675f, 0.19f);
}