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


Java FastOutSlowInInterpolator类代码示例

本文整理汇总了Java中android.support.v4.view.animation.FastOutSlowInInterpolator的典型用法代码示例。如果您正苦于以下问题:Java FastOutSlowInInterpolator类的具体用法?Java FastOutSlowInInterpolator怎么用?Java FastOutSlowInInterpolator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


FastOutSlowInInterpolator类属于android.support.v4.view.animation包,在下文中一共展示了FastOutSlowInInterpolator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: slideTo

import android.support.v4.view.animation.FastOutSlowInInterpolator; //导入依赖的package包/类
private void slideTo(int slideOffset, boolean forceInstant) {
  if (animator != null) {
    animator.cancel();
    animator = null;
  }

  if (!forceInstant) {
    animator = ObjectAnimator.ofInt(this, "slideOffset", this.slideOffset, slideOffset);
    animator.setInterpolator(new FastOutSlowInInterpolator());
    animator.setDuration(400);
    animator.start();
    ViewCompat.postInvalidateOnAnimation(this);
  } else {
    this.slideOffset = slideOffset;
    requestLayout();
    invalidate();
  }
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:19,代码来源:QuickAttachmentDrawer.java

示例2: onPageShow

import android.support.v4.view.animation.FastOutSlowInInterpolator; //导入依赖的package包/类
@CallSuper
public void onPageShow() {
    mShown = true;
    if (mFabRotation == ROTATION_GONE) {
        if (mFab.getVisibility() == View.VISIBLE) {
            mFab.hide();
        }
        mFab.setOnClickListener(null);
        return;
    }
    mFab.setOnClickListener(mOnFabClickListener);
    if (mFab.getVisibility() != View.VISIBLE) {
        mFab.setRotation(mFabRotation);
        mFab.show();
    } else if (Math.abs(mFab.getRotation() - mFabRotation) > 0.1f) {
        mFab.animate()
                .rotation(mFabRotation)
                .setDuration(300)
                .setInterpolator(new FastOutSlowInInterpolator())
                .start();
    }
}
 
开发者ID:hyb1996,项目名称:Auto.js,代码行数:23,代码来源:ViewPagerFragment.java

示例3: slideAnimator

import android.support.v4.view.animation.FastOutSlowInInterpolator; //导入依赖的package包/类
private ValueAnimator slideAnimator(int start, int end, final View v) {

        ValueAnimator animator = ValueAnimator.ofInt(start, end);

        animator.setInterpolator(new FastOutSlowInInterpolator());

        animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator valueAnimator) {
                //Update Height
                int value = (Integer) valueAnimator.getAnimatedValue();
                ViewGroup.LayoutParams layoutParams = v.getLayoutParams();
                layoutParams.height = value;
                v.setLayoutParams(layoutParams);
            }
        });
        return animator;
    }
 
开发者ID:ccrama,项目名称:Slide-RSS,代码行数:19,代码来源:MainActivity.java

示例4: slideAnimator

import android.support.v4.view.animation.FastOutSlowInInterpolator; //导入依赖的package包/类
private static ValueAnimator slideAnimator(int start, int end, final View v) {
    ValueAnimator animator = ValueAnimator.ofInt(start, end);
    animator.setInterpolator(new FastOutSlowInInterpolator());

    animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator valueAnimator) {
            //Update Height
            int value = (Integer) valueAnimator.getAnimatedValue();
            ViewGroup.LayoutParams layoutParams = v.getLayoutParams();
            layoutParams.height = value;
            v.setLayoutParams(layoutParams);
        }
    });
    return animator;
}
 
开发者ID:ccrama,项目名称:Slide-RSS,代码行数:17,代码来源:CreateCardView.java

示例5: flipAnimator

import android.support.v4.view.animation.FastOutSlowInInterpolator; //导入依赖的package包/类
private static ValueAnimator flipAnimator(boolean isFlipped, final View v) {
    if (v != null) {
        ValueAnimator animator = ValueAnimator.ofFloat(isFlipped ? -1f : 1f, isFlipped ? 1f : -1f);
        animator.setInterpolator(new FastOutSlowInInterpolator());

        animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator valueAnimator) {
                //Update Height
                v.setScaleY((Float) valueAnimator.getAnimatedValue());
            }
        });
        return animator;
    }
    return null;
}
 
开发者ID:ccrama,项目名称:Slide-RSS,代码行数:17,代码来源:CreateCardView.java

示例6: buildIndicatorAnimatorTowards

import android.support.v4.view.animation.FastOutSlowInInterpolator; //导入依赖的package包/类
private AnimatorSet buildIndicatorAnimatorTowards(TextView tab) {
    ObjectAnimator xAnimator = ObjectAnimator.ofFloat(indicator, "X", indicator.getX(), tab.getX());

    final ViewGroup.LayoutParams params = indicator.getLayoutParams();
    ValueAnimator widthAnimator = ValueAnimator.ofInt(params.width, tab.getMeasuredWidth());
    widthAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            params.width = (int) animation.getAnimatedValue();
            indicator.setLayoutParams(params);
        }
    });

    AnimatorSet set = new AnimatorSet();
    set.setInterpolator(new FastOutSlowInInterpolator());
    set.playTogether(xAnimator, widthAnimator);

    return set;
}
 
开发者ID:yushiwo,项目名称:ZRAddressSelector,代码行数:20,代码来源:AddressSelector.java

示例7: onTaskFinished

import android.support.v4.view.animation.FastOutSlowInInterpolator; //导入依赖的package包/类
private void onTaskFinished(@Nullable MaterialAboutList materialAboutList) {
    if (materialAboutList != null) {
        list = materialAboutList;
        adapter.swapData(list);

        if (shouldAnimate()) {
            recyclerView.animate()
                    .alpha(1f)
                    .translationY(0f)
                    .setDuration(400)
                    .setInterpolator(new FastOutSlowInInterpolator()).start();
        } else {
            recyclerView.setAlpha(1f);
            recyclerView.setTranslationY(0f);
        }
    } else {
        finish();//?? why we remain here anyway?
    }
}
 
开发者ID:daniel-stoneuk,项目名称:material-about-library,代码行数:20,代码来源:MaterialAboutActivity.java

示例8: onPostExecute

import android.support.v4.view.animation.FastOutSlowInInterpolator; //导入依赖的package包/类
@Override
protected void onPostExecute(String s) {
    adapter.swapData(list);

    if (shouldAnimate()) {
        recyclerView.animate()
                .alpha(1f)
                .translationY(0f)
                .setDuration(400)
                .setInterpolator(new FastOutSlowInInterpolator())
                .start();
    } else {
        recyclerView.setAlpha(1f);
        recyclerView.setTranslationY(0f);
    }

    super.onPostExecute(s);
    fragmentContext = null;
}
 
开发者ID:daniel-stoneuk,项目名称:material-about-library,代码行数:20,代码来源:MaterialAboutFragment.java

示例9: FloatingOnTouchListener

import android.support.v4.view.animation.FastOutSlowInInterpolator; //导入依赖的package包/类
public FloatingOnTouchListener() {
    final WindowManager.LayoutParams params = (WindowManager.LayoutParams) mFloatingView.getLayoutParams();
    fadeOut = ValueAnimator.ofFloat(params.alpha, 0.1F);
    fadeOut.setInterpolator(new FastOutSlowInInterpolator());
    fadeOut.setDuration(100);
    fadeOut.addUpdateListener(valueAnimator -> {
        params.alpha = (float) valueAnimator.getAnimatedValue();
        try {
            mWindowManager.updateViewLayout(mFloatingView, params);
        } catch (IllegalArgumentException ignore) {
        }
    });
    fadeIn = fadeOut.clone();
    fadeIn.setFloatValues(0.1F, params.alpha);
    fadeIn.setStartDelay(5000);
}
 
开发者ID:plusCubed,项目名称:velociraptor,代码行数:17,代码来源:FloatingView.java

示例10: resetStory

import android.support.v4.view.animation.FastOutSlowInInterpolator; //导入依赖的package包/类
public void resetStory() {
    getSupportActionBar().setTitle(story.getTitle());
    overlay.setClickable(false);
    overlay.animate()
            .alpha(0.0F)
            .setDuration(200L)
            .setInterpolator(new FastOutSlowInInterpolator())
            .start();
    switch (StoryDataProcess.Category.getEnum(story.getCategory())) {
        case FILE:
            getSupportFragmentManager().beginTransaction()
                    .replace(R.id.container, FileStoryFragment.getInstance(story, false))
                    .commit();
            break;
        case TOPIC:
            getSupportFragmentManager().beginTransaction()
                    .replace(R.id.container, TopicStoryFragment.getInstance(story, false))
                    .commit();
            break;
        case LINK:
            getSupportFragmentManager().beginTransaction()
                    .replace(R.id.container, LinkStoryFragment.getInstance(story, false))
                    .commit();
            break;
    }
}
 
开发者ID:jianliaoim,项目名称:talk-android,代码行数:27,代码来源:ChatActivity.java

示例11: initInterpolations

import android.support.v4.view.animation.FastOutSlowInInterpolator; //导入依赖的package包/类
private void initInterpolations() {
    ArrayList<Class> interpolatorList = new ArrayList<Class>() {{
        add(FastOutSlowInInterpolator.class);
        add(BounceInterpolator.class);
        add(LinearInterpolator.class);
        add(DecelerateInterpolator.class);
        add(CycleInterpolator.class);
        add(AnticipateInterpolator.class);
        add(AccelerateDecelerateInterpolator.class);
        add(AccelerateInterpolator.class);
        add(AnticipateOvershootInterpolator.class);
        add(FastOutLinearInInterpolator.class);
        add(LinearOutSlowInInterpolator.class);
        add(OvershootInterpolator.class);
    }};

    try {
        interpolatorSelector = (Interpolator) interpolatorList.get(animateSelector).newInstance();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:ceryle,项目名称:SegmentedButton,代码行数:23,代码来源:SegmentedButtonGroup.java

示例12: handleVote

import android.support.v4.view.animation.FastOutSlowInInterpolator; //导入依赖的package包/类
private void handleVote(Upvote vote) {
    shot.setVoted(fab.isChecked());
    int count = vote.count;
    if (!fab.isChecked() && count > 0) {
        count -= 1;
    }

    if (count != shot.getVotes()) {
        shot.setVotes(count);
        updateVoteCount();
        AnimatorSet s = new AnimatorSet();
        s.setDuration(300).setInterpolator(new FastOutSlowInInterpolator());
        s.playTogether(
                ObjectAnimator.ofFloat(voteCount, "alpha", 0, 1, 1, 1),
                ObjectAnimator.ofFloat(voteCount, "scaleX", 0.3f, 1.05f, 0.9f, 1),
                ObjectAnimator.ofFloat(voteCount, "scaleY", 0.3f, 1.05f, 0.9f, 1));
        s.start();
    }
}
 
开发者ID:goodev,项目名称:materialup,代码行数:20,代码来源:PostActivity.java

示例13: toggleFab

import android.support.v4.view.animation.FastOutSlowInInterpolator; //导入依赖的package包/类
private void toggleFab(View view, int delay, float scale, final boolean last) {

        ViewCompat.animate(view)
                .setStartDelay(delay)
                .scaleX(scale)
                .scaleY(scale)
                .setInterpolator(new FastOutSlowInInterpolator())
                .withEndAction(new Runnable() {
                    @Override
                    public void run() {
                        if (last) {
                            uiLinearLayout.setVisibility(View.GONE);
                        }
                    }
                })
                .start();
    }
 
开发者ID:mkchx,项目名称:FabMenu,代码行数:18,代码来源:RollUpView.java

示例14: toggleFab

import android.support.v4.view.animation.FastOutSlowInInterpolator; //导入依赖的package包/类
private void toggleFab(View view, int delay, float scale, final boolean last) {

        ViewCompat.animate(view)
                .setStartDelay(delay)
                .scaleX(scale)
                .scaleY(scale)
                .setInterpolator(new FastOutSlowInInterpolator())
                .withEndAction(new Runnable() {
                    @Override
                    public void run() {
                        if (last) {
                            mUiLayout.setVisibility(View.GONE);
                        }
                    }
                })
                .start();
    }
 
开发者ID:mkchx,项目名称:FabMenu,代码行数:18,代码来源:ClockWiseView.java

示例15: onStopNestedScroll

import android.support.v4.view.animation.FastOutSlowInInterpolator; //导入依赖的package包/类
public void onStopNestedScroll(View child) {
    if (Math.abs(totalDrag) >= dragDismissDistance) {
        dispatchDismissCallback();
    } else { // settle back to natural position
        ViewPropertyAnimator animator = mViewGroup.animate()
                .translationY(0f)
                .scaleY(1f)
                .setDuration(200L)
                .setInterpolator(new FastOutSlowInInterpolator())
                .setListener(null);
        if (enableScaleX) {
            animator.scaleX(1f);
        }

        animator.start();

        totalDrag = 0;
        draggingDown = draggingUp = false;
        dispatchDragCallback(0f, 0f, 0f, 0f);
    }
}
 
开发者ID:Commit451,项目名称:ElasticDragDismissLayout,代码行数:22,代码来源:ElasticDragDismissDelegate.java


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