本文整理汇总了Java中android.view.animation.AccelerateInterpolator类的典型用法代码示例。如果您正苦于以下问题:Java AccelerateInterpolator类的具体用法?Java AccelerateInterpolator怎么用?Java AccelerateInterpolator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AccelerateInterpolator类属于android.view.animation包,在下文中一共展示了AccelerateInterpolator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initValues
import android.view.animation.AccelerateInterpolator; //导入依赖的package包/类
private void initValues(Context context, boolean editMode) {
Resources res = context.getResources();
mInterpolator = new AccelerateInterpolator();
if (!editMode) {
mSectionsCount = res.getInteger(R.integer.spb_default_sections_count);
mSpeed = Float.parseFloat(res.getString(R.string.spb_default_speed));
mReversed = res.getBoolean(R.bool.spb_default_reversed);
mProgressiveStartActivated = res.getBoolean(R.bool.spb_default_progressiveStart_activated);
mColors = new int[]{res.getColor(R.color.spb_default_color)};
mStrokeSeparatorLength = res.getDimensionPixelSize(R.dimen.spb_default_stroke_separator_length);
mStrokeWidth = res.getDimensionPixelOffset(R.dimen.spb_default_stroke_width);
} else {
mSectionsCount = 4;
mSpeed = 1f;
mReversed = false;
mProgressiveStartActivated = false;
mColors = new int[]{0xff33b5e5};
mStrokeSeparatorLength = 4;
mStrokeWidth = 4;
}
mProgressiveStartSpeed = mSpeed;
mProgressiveStopSpeed = mSpeed;
mGradients = false;
}
示例2: hideSystemUI
import android.view.animation.AccelerateInterpolator; //导入依赖的package包/类
private void hideSystemUI() {
runOnUiThread(new Runnable() {
public void run() {
toolbar.animate().translationY(-toolbar.getHeight()).setInterpolator(new AccelerateInterpolator())
.setDuration(200).start();
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
| View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
| View.SYSTEM_UI_FLAG_IMMERSIVE);
fullScreenMode = true;
changeBackGroundColor();
}
});
}
示例3: bounceAnimateView
import android.view.animation.AccelerateInterpolator; //导入依赖的package包/类
private void bounceAnimateView(final View view) {
if (view == null) {
return;
}
ValueAnimator swing = ValueAnimator.ofFloat(0, 60, -40, 0);
swing.setDuration(400);
swing.setInterpolator(new AccelerateInterpolator());
swing.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
view.setRotationX((float)animation.getAnimatedValue());
}
});
swing.start();
}
示例4: onTouchDown
import android.view.animation.AccelerateInterpolator; //导入依赖的package包/类
@Override
public void onTouchDown() {
if (mAnim != null) {
mAnim.cancel();
}
if (mViewtoToggle.getAlpha() == 1f) {
mIgnoreNextTap = true;
}
mAnim = mViewtoToggle.animate();
mAnim.alpha(0f)
.setDuration(150)
.withEndAction(new Runnable() {
public void run() {
mViewtoToggle.setVisibility(View.INVISIBLE);
}
});
mAnim.setInterpolator(new AccelerateInterpolator(0.75f));
mAnim.start();
}
示例5: toggleToolbar
import android.view.animation.AccelerateInterpolator; //导入依赖的package包/类
public void toggleToolbar(boolean show) {
if (show==showToolbar || toolbarGroup==null) {
return;
}
showToolbar=show;
if (showToolbar) {
startTimeOut();
showSystemUI();
toolbarGroup.animate().translationY(0).setInterpolator(new DecelerateInterpolator()).start();
} else {
if (timeoutSubscription!=null) {
timeoutSubscription.unsubscribe();
}
toolbarGroup.animate().translationY(-toolbarGroup.getBottom()).setInterpolator(new AccelerateInterpolator()).start();
hideSystemUI();
}
}
示例6: hideInstructionList
import android.view.animation.AccelerateInterpolator; //导入依赖的package包/类
/**
* Hide the instruction list and show the sound button.
* <p>
* This is based on orientation so the different layouts (for portrait vs. landscape)
* can be animated appropriately.
*/
public void hideInstructionList() {
int orientation = getContext().getResources().getConfiguration().orientation;
if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
ConstraintSet collapsed = new ConstraintSet();
collapsed.clone(getContext(), R.layout.instruction_layout);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
TransitionManager.beginDelayedTransition(InstructionView.this);
}
collapsed.applyTo(instructionLayout);
instructionListLayout.setVisibility(INVISIBLE);
} else {
Animation slideUp = AnimationUtils.loadAnimation(getContext(), R.anim.slide_up_top);
slideUp.setInterpolator(new AccelerateInterpolator());
instructionListLayout.startAnimation(slideUp);
instructionListLayout.setVisibility(INVISIBLE);
}
}
示例7: initView
import android.view.animation.AccelerateInterpolator; //导入依赖的package包/类
private void initView()
{
mListImgView = new ArrayList<>();
titleTexts = new ArrayList<>();
mInflater = LayoutInflater.from(mContext);
View view = mInflater.inflate(R.layout.view_slider_layout , this);
mDotLayout = (LinearLayout) view.findViewById(R.id.ll_dot_group);
mTitleTV = (TextView) view.findViewById(R.id.tv_img_desc);
mViewPager = (ViewPager) view.findViewById(R.id.viewPager);
mViewPager.setPageTransformer(true , new DepthPageTransformer());
mViewPager.setOnPageChangeListener(this);
try
{
Field mField = ViewPager.class.getDeclaredField("mScroller");
mField.setAccessible(true);
mScroller = new FixedSpeedScroller(mContext ,new AccelerateInterpolator());
mField.set(mViewPager , mScroller);
}
catch (Exception e)
{
e.printStackTrace();
}
}
示例8: createCollapseValueAnimator
import android.view.animation.AccelerateInterpolator; //导入依赖的package包/类
private ValueAnimator createCollapseValueAnimator() {
ValueAnimator animator = ValueAnimator.ofFloat(1f, 0f);
animator.setDuration(DEFAULT_ANIMATION_DURATION_COLLAPSE);
animator.setInterpolator(new AccelerateInterpolator());
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator) {
mExpandedScaleFactor[0] = (float) valueAnimator.getAnimatedValue();
invalidateSelf();
}
});
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
notifyCollapsed();
}
});
return animator;
}
示例9: switchShowRouteLineDetail
import android.view.animation.AccelerateInterpolator; //导入依赖的package包/类
@Override
public void switchShowRouteLineDetail() {
if (showState == ShowState.showing || showState == ShowState.unshowing)
return;
height = mAnslMapBox.getHeight();
if (showState == ShowState.unshow) {
if (showState == ShowState.showed)
return;
mAnslOutBottomBox.setVisibility(View.GONE);
mAnslVoiceBt.setVisibility(View.GONE);
findViewById(R.id.ansl_route_detail_list_box).setVisibility(View.VISIBLE);
startHeight = mAnslRouteLineBox.getHeight();
mAnslRouteLineBox.getLayoutParams().height = startHeight;
RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) mAnslRouteDetailBottomBox.getLayoutParams();
layoutParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
layoutParams.height = RelativeLayout.LayoutParams.MATCH_PARENT;
}
mAnimateToTargetPosition.reset();
mAnimateToTargetPosition.setInterpolator(new AccelerateInterpolator());
mAnimateToTargetPosition.setDuration(300);
mAnimateToTargetPosition.setAnimationListener(animationListener);
mAnslRouteDetailBottomBox.startAnimation(mAnimateToTargetPosition);
}
示例10: init
import android.view.animation.AccelerateInterpolator; //导入依赖的package包/类
public void init(Context context) {
mScroller = new Scroller(context, new AccelerateInterpolator());// 加速 // 动画插入器
mInvisibleTextView = new MyTextView(context);
mInvisibleTextView.setText("0");
mInvisibleTextView.setGravity(Gravity.CENTER);
mInvisibleTextView.setIncludeFontPadding(false);
addView(mInvisibleTextView);
mVisibleTextView = new MyTextView(context);
mVisibleTextView.setText("0");
mVisibleTextView.setGravity(Gravity.CENTER);
mVisibleTextView.setIncludeFontPadding(false);
addView(mVisibleTextView);
mShadePaint.setColor(Color.BLACK);
mShadePaint.setStyle(Paint.Style.FILL);
mShinePaint.setColor(Color.WHITE);
mShinePaint.setStyle(Paint.Style.FILL);
}
示例11: startAnimators
import android.view.animation.AccelerateInterpolator; //导入依赖的package包/类
public static void startAnimators(final View view, int startOffsetX, int startOffsetY, long delay) {
if (view.getVisibility() == View.VISIBLE && view.getAlpha() != 0f) {
view.clearAnimation();
view.animate().cancel();
final Resources res = view.getResources();
final float endAlpha = view.getAlpha();
final float endTranslateX = view.getTranslationX();
final float endTranslateY = view.getTranslationY();
view.setAlpha(0);
final Animator fade = ObjectAnimator.ofFloat(view, View.ALPHA, endAlpha);
fade.setDuration(res.getInteger(R.integer.material_in_fade_anim_duration));
fade.setInterpolator(new AccelerateInterpolator());
fade.setStartDelay(delay);
fade.start();
ViewPropertyAnimator slide = view.animate();
if (startOffsetY != 0) {
view.setTranslationY(startOffsetY);
slide.translationY(endTranslateY);
} else {
view.setTranslationX(startOffsetX);
slide.translationX(endTranslateX);
}
slide.setInterpolator(new DecelerateInterpolator(2));
slide.setDuration(res.getInteger(R.integer.material_in_slide_anim_duration));
slide.setStartDelay(delay);
slide.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationCancel(Animator animation) {
if (fade.isStarted()) {
fade.cancel();
}
view.setAlpha(endAlpha);
view.setTranslationX(endTranslateX);
view.setTranslationY(endTranslateY);
}
});
slide.start();
}
}
示例12: startIntroAnimation
import android.view.animation.AccelerateInterpolator; //导入依赖的package包/类
private void startIntroAnimation() {
ViewCompat.setElevation(getToolbar(), 0);
contentRoot.setScaleY(0.1f);
contentRoot.setPivotY(drawingStartLocation);
llAddComment.setTranslationY(200);
contentRoot.animate()
.scaleY(1)
.setDuration(200)
.setInterpolator(new AccelerateInterpolator())
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
ViewCompat.setElevation(getToolbar(), Utils.dpToPx(8));
animateContent();
}
})
.start();
}
示例13: performDismissAnimation
import android.view.animation.AccelerateInterpolator; //导入依赖的package包/类
private void performDismissAnimation() {
contextMenuView.setPivotX(contextMenuView.getWidth() / 2);
contextMenuView.setPivotY(contextMenuView.getHeight());
contextMenuView.animate()
.scaleX(0.1f).scaleY(0.1f)
.setDuration(150)
.setInterpolator(new AccelerateInterpolator())
.setStartDelay(100)
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
if (contextMenuView != null) {
contextMenuView.dismiss();
}
isContextMenuDismissing = false;
}
});
}
示例14: startIntroAnimation
import android.view.animation.AccelerateInterpolator; //导入依赖的package包/类
private void startIntroAnimation() {
contentRoot.setScaleY(0.1f);
contentRoot.setPivotY(drawingStartLocation);//设置reyclerview的父view展开动画的起始位置(中心线)为上一activity的点击位置
llAddComment.setTranslationY(200);//设置地下发送评论的控件的Y坐标初始位置(隐藏在屏幕底下100dp为起始位置)
contentRoot.animate()
.scaleY(1)
.setDuration(200)
.setInterpolator(new AccelerateInterpolator())
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
animateContent();
}
})
.start();
}
示例15: apply
import android.view.animation.AccelerateInterpolator; //导入依赖的package包/类
@Override
public SkinAnimator apply(@NonNull final View view, @Nullable final Action action) {
animator = ObjectAnimator.ofPropertyValuesHolder(view,
PropertyValuesHolder.ofFloat("alpha", 1, 0),
PropertyValuesHolder.ofFloat("translationY", 0, view.getHeight()));
animator.setDuration(3 * PRE_DURATION);
animator.setInterpolator(new AccelerateInterpolator());
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
resetView(view);
if (action != null) {
action.action();
}
}
});
return this;
}