本文整理汇总了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();
}
}
示例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();
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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?
}
}
示例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;
}
示例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);
}
示例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;
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
示例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();
}
示例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);
}
}