Java 类android.support.v4.view.animation.FastOutSlowInInterpolator 实例源码
项目:PeSanKita-android
文件:QuickAttachmentDrawer.java
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();
}
}
项目:Auto.js
文件:ViewPagerFragment.java
@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();
}
}
项目:Slide-RSS
文件:MainActivity.java
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;
}
项目:Slide-RSS
文件:CreateCardView.java
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;
}
项目:Slide-RSS
文件:CreateCardView.java
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;
}
项目:Cable-Android
文件:QuickAttachmentDrawer.java
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();
}
}
项目:ZRAddressSelector
文件:AddressSelector.java
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;
}
项目:material-about-library
文件:MaterialAboutActivity.java
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?
}
}
项目:material-about-library
文件:MaterialAboutFragment.java
@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;
}
项目:JDAddressSelector
文件:AddressSelector.java
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;
}
项目:velociraptor
文件:FloatingView.java
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);
}
项目:talk-android
文件:ChatActivity.java
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;
}
}
项目:SegmentedButton
文件:SegmentedButtonGroup.java
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();
}
}
项目:JDLinkerSelector
文件:AddressSelector.java
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;
}
项目:materialup
文件:PostActivity.java
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();
}
}
项目:FabMenu
文件:RollUpView.java
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();
}
项目:FabMenu
文件:ClockWiseView.java
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();
}
项目:ElasticDragDismissLayout
文件:ElasticDragDismissDelegate.java
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);
}
}
项目:react-native-navigation
文件:LightBox.java
private void animateShow() {
ObjectAnimator yTranslation = ObjectAnimator.ofFloat(content, View.TRANSLATION_Y, 80, 0).setDuration(400);
yTranslation.setInterpolator(new FastOutSlowInInterpolator());
yTranslation.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
content.setAlpha(1);
}
});
ObjectAnimator lightBoxAlpha = ObjectAnimator.ofFloat(lightBox, View.ALPHA, 0, 1).setDuration(70);
AnimatorSet animatorSet = new AnimatorSet();
animatorSet.playTogether(lightBoxAlpha, yTranslation);
animatorSet.start();
}
项目:MaterialTapTargetPrompt
文件:EmptyActivity.java
public void showSideNavigationPrompt(View view)
{
final MaterialTapTargetPrompt.Builder tapTargetPromptBuilder = new MaterialTapTargetPrompt.Builder(this)
.setPrimaryText(R.string.menu_prompt_title)
.setSecondaryText(R.string.menu_prompt_description)
.setAnimationInterpolator(new FastOutSlowInInterpolator())
.setMaxTextWidth(R.dimen.tap_target_menu_max_width)
.setIcon(R.drawable.ic_back);
final Toolbar tb = this.findViewById(android.support.v7.appcompat.R.id.action_bar);
tapTargetPromptBuilder.setTarget(tb.getChildAt(1));
tapTargetPromptBuilder.setPromptStateChangeListener(new MaterialTapTargetPrompt.PromptStateChangeListener()
{
@Override
public void onPromptStateChanged(@NonNull MaterialTapTargetPrompt prompt, int state)
{
if (state == MaterialTapTargetPrompt.STATE_FOCAL_PRESSED)
{
//Do something such as storing a value so that this prompt is never shown again
}
}
});
tapTargetPromptBuilder.show();
}
项目:MaterialTapTargetPrompt
文件:EmptyActivity.java
public void showOverflowPrompt(View view)
{
final MaterialTapTargetPrompt.Builder tapTargetPromptBuilder = new MaterialTapTargetPrompt.Builder(this)
.setPrimaryText(R.string.overflow_prompt_title)
.setSecondaryText(R.string.overflow_prompt_description)
.setAnimationInterpolator(new FastOutSlowInInterpolator())
.setMaxTextWidth(R.dimen.tap_target_menu_max_width)
.setIcon(R.drawable.ic_more_vert);
final Toolbar tb = this.findViewById(android.support.v7.appcompat.R.id.action_bar);
final View child = tb.getChildAt(2);
if (child instanceof ActionMenuView)
{
final ActionMenuView actionMenuView = ((ActionMenuView) child);
tapTargetPromptBuilder.setTarget(actionMenuView.getChildAt(actionMenuView.getChildCount() - 1));
}
else
{
Toast.makeText(this, R.string.overflow_unavailable, Toast.LENGTH_SHORT);
}
tapTargetPromptBuilder.show();
}
项目:MaterialTapTargetPrompt
文件:MainActivity.java
public void showSideNavigationPrompt(View view)
{
final MaterialTapTargetPrompt.Builder tapTargetPromptBuilder = new MaterialTapTargetPrompt.Builder(this)
.setPrimaryText(R.string.menu_prompt_title)
.setSecondaryText(R.string.menu_prompt_description)
.setFocalPadding(R.dimen.dp40)
.setAnimationInterpolator(new FastOutSlowInInterpolator())
.setMaxTextWidth(R.dimen.tap_target_menu_max_width)
.setIcon(R.drawable.ic_menu);
final Toolbar tb = this.findViewById(R.id.toolbar);
tapTargetPromptBuilder.setTarget(tb.getChildAt(1));
tapTargetPromptBuilder.setPromptStateChangeListener(new MaterialTapTargetPrompt.PromptStateChangeListener()
{
@Override
public void onPromptStateChanged(@NonNull MaterialTapTargetPrompt prompt, int state)
{
if (state == MaterialTapTargetPrompt.STATE_FOCAL_PRESSED)
{
//Do something such as storing a value so that this prompt is never shown again
}
}
});
tapTargetPromptBuilder.show();
}
项目:MaterialTapTargetPrompt
文件:MainActivity.java
public void showOverflowPrompt(View view)
{
final MaterialTapTargetPrompt.Builder tapTargetPromptBuilder = new MaterialTapTargetPrompt.Builder(this)
.setPrimaryText(R.string.overflow_prompt_title)
.setSecondaryText(R.string.overflow_prompt_description)
.setAnimationInterpolator(new FastOutSlowInInterpolator())
.setMaxTextWidth(R.dimen.tap_target_menu_max_width)
.setIcon(R.drawable.ic_more_vert);
final Toolbar tb = this.findViewById(R.id.toolbar);
final View child = tb.getChildAt(2);
if (child instanceof ActionMenuView)
{
final ActionMenuView actionMenuView = ((ActionMenuView) child);
tapTargetPromptBuilder.setTarget(actionMenuView.getChildAt(actionMenuView.getChildCount() - 1));
}
else
{
Toast.makeText(this, R.string.overflow_unavailable, Toast.LENGTH_SHORT);
}
tapTargetPromptBuilder.show();
}
项目:MaterialTapTargetPrompt
文件:DialogStyleActivity.java
public void showSideNavigationPrompt(View view)
{
final MaterialTapTargetPrompt.Builder tapTargetPromptBuilder = new MaterialTapTargetPrompt.Builder(this)
.setPrimaryText(R.string.menu_prompt_title)
.setSecondaryText(R.string.menu_prompt_description)
.setAnimationInterpolator(new FastOutSlowInInterpolator())
.setMaxTextWidth(R.dimen.tap_target_menu_max_width)
.setIcon(R.drawable.ic_back)
.setClipToView(findViewById(R.id.dialog_view));
final Toolbar tb = this.findViewById(R.id.toolbar);
tapTargetPromptBuilder.setTarget(tb.getChildAt(1));
tapTargetPromptBuilder.setPromptStateChangeListener(new MaterialTapTargetPrompt.PromptStateChangeListener()
{
@Override
public void onPromptStateChanged(@NonNull MaterialTapTargetPrompt prompt, int state)
{
if (state == MaterialTapTargetPrompt.STATE_FOCAL_PRESSED)
{
//Do something such as storing a value so that this prompt is never shown again
}
}
});
tapTargetPromptBuilder.show();
}
项目:MaterialTapTargetPrompt
文件:DialogStyleActivity.java
public void showOverflowPrompt(View view)
{
final MaterialTapTargetPrompt.Builder tapTargetPromptBuilder = new MaterialTapTargetPrompt.Builder(this)
.setPrimaryText(R.string.overflow_prompt_title)
.setSecondaryText(R.string.overflow_prompt_description)
.setAnimationInterpolator(new FastOutSlowInInterpolator())
.setMaxTextWidth(R.dimen.max_prompt_width)
.setIcon(R.drawable.ic_more_vert)
.setClipToView(findViewById(R.id.dialog_view));
final Toolbar tb = this.findViewById(R.id.toolbar);
final View child = tb.getChildAt(2);
if (child instanceof ActionMenuView)
{
final ActionMenuView actionMenuView = ((ActionMenuView) child);
tapTargetPromptBuilder.setTarget(actionMenuView.getChildAt(actionMenuView.getChildCount() - 1));
}
else
{
Toast.makeText(this, R.string.overflow_unavailable, Toast.LENGTH_SHORT);
}
tapTargetPromptBuilder.show();
}
项目:material-components-android
文件:MotionSpecTest.java
@Test
public void validateSetOfObjectAnimatorTranslationMotionTiming() {
MotionSpec spec =
MotionSpec.createFromResource(
activityTestRule.getActivity(), R.animator.valid_set_of_object_animator_motion_spec);
MotionTiming translation = spec.getTiming("translation");
assertEquals(11, translation.getDelay());
assertEquals(13, translation.getDuration());
if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) {
assertThat(translation.getInterpolator(), instanceOf(PathInterpolator.class));
} else {
assertThat(translation.getInterpolator(), instanceOf(FastOutSlowInInterpolator.class));
}
assertEquals(17, translation.getRepeatCount());
assertEquals(ValueAnimator.REVERSE, translation.getRepeatMode());
}
项目:TransitionAnimator
文件:MessageActivity.java
public void executeTransition() {
postponeEnterTransition();
final View decorView = getWindow().getDecorView();
getWindow().getDecorView().getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
@Override
public boolean onPreDraw() {
decorView.getViewTreeObserver().removeOnPreDrawListener(this);
supportStartPostponedEnterTransition();
return true;
}
});
MyTransition transition = new MyTransition();
transition.setPositionDuration(300);
transition.setSizeDuration(300);
transition.setPositionInterpolator(new FastOutLinearInInterpolator());
transition.setSizeInterpolator(new FastOutSlowInInterpolator());
transition.addTarget("message");
getWindow().setSharedElementEnterTransition(transition);
}
项目:FMTech
文件:ScalingPageIndicator.java
@TargetApi(14)
public final Animator createScaleAnimator(final View paramView, float paramFloat1, float paramFloat2, long paramLong)
{
ValueAnimator localValueAnimator = ValueAnimator.ofFloat(new float[] { paramFloat1, paramFloat2 });
localValueAnimator.setDuration(paramLong);
if (Build.VERSION.SDK_INT >= 21) {
localValueAnimator.setInterpolator(PlayInterpolators.fastOutSlowIn(paramView.getContext()));
}
for (;;)
{
localValueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener()
{
public final void onAnimationUpdate(ValueAnimator paramAnonymousValueAnimator)
{
float f = ((Float)paramAnonymousValueAnimator.getAnimatedValue()).floatValue();
paramView.setScaleX(f);
paramView.setScaleY(f);
}
});
return localValueAnimator;
localValueAnimator.setInterpolator(new FastOutSlowInInterpolator());
}
}
项目:citrus
文件:BottomButton.java
/**
*
* @param parent
* @param bb
* @param snackbar
*/
private void updateFabTranslationForSnackbar(CoordinatorLayout parent, BottomButton bb, View snackbar) {
float translationY = this.getFabTranslationYForSnackbar(parent, bb);
if (translationY != this.mTranslationY) {
ViewCompat.animate(bb).cancel();
if (Math.abs(translationY - this.mTranslationY) == (float) snackbar.getHeight()) {
ViewCompat.animate(bb).translationY(translationY).setInterpolator(new FastOutSlowInInterpolator())
.setListener((ViewPropertyAnimatorListener) null);
} else {
ViewCompat.setTranslationY(bb, translationY);
}
this.mTranslationY = translationY;
}
}
项目:anime-android-go-99
文件:InfoTooltipView.java
public void dismiss(boolean immediate) {
if (immediate) {
dismissNow();
} else {
animatorFor(text, animatorContext)
.withInterpolator(new FastOutSlowInInterpolator())
.fadeOut(INVISIBLE)
.addOnAnimationCompleted(new OnAnimationCompleted() {
@Override
public void onAnimationCompleted(boolean finished) {
dismissNow();
}
})
.start();
}
}
项目:anime-android-go-99
文件:HomeActivity.java
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
this.animatorContext = new AnimatorContext(getClass().getSimpleName());
animatorContext.setTransactionTemplate(new AnimatorTemplate(new FastOutSlowInInterpolator()));
this.viewPager = (ViewPager) findViewById(R.id.activity_home_view_pager);
final ViewPagerAnimatorContextAdapter animatorContextAdapter
= new ViewPagerAnimatorContextAdapter(animatorContext);
viewPager.addOnPageChangeListener(animatorContextAdapter);
viewPager.addOnPageChangeListener(this);
this.adapter = new AmplitudeFragmentsAdapter(getSupportFragmentManager(), NUMBER_FRAGMENTS);
viewPager.setAdapter(adapter);
viewPager.setCurrentItem(NUMBER_FRAGMENTS - 1, false);
if (savedInstanceState != null) {
final boolean enableLongAnimations =
savedInstanceState.getBoolean(SAVED_ENABLE_LONG_ANIMATIONS);
setEnableLongAnimations(enableLongAnimations);
}
}
项目:Phonograph
文件:FlatPlayerPlaybackControlsFragment.java
public void show() {
if (hidden) {
if (musicControllerAnimationSet == null) {
TimeInterpolator interpolator = new FastOutSlowInInterpolator();
final int duration = 300;
LinkedList<Animator> animators = new LinkedList<>();
addAnimation(animators, playPauseButton, interpolator, duration, 0);
addAnimation(animators, nextButton, interpolator, duration, 100);
addAnimation(animators, prevButton, interpolator, duration, 100);
addAnimation(animators, shuffleButton, interpolator, duration, 200);
addAnimation(animators, repeatButton, interpolator, duration, 200);
musicControllerAnimationSet = new AnimatorSet();
musicControllerAnimationSet.playTogether(animators);
} else {
musicControllerAnimationSet.cancel();
}
musicControllerAnimationSet.start();
}
hidden = false;
}
项目:materialize
文件:SearchPanelController.java
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private Animator makeSearchPanelAnimator(boolean reverse) {
int width = container.getWidth();
int centerX = container.getRight()
+ container.getPaddingRight()
- resources.getDimensionPixelOffset(R.dimen.reveal_right) / 4 * 3;
int centerY = container.getHeight() / 2;
Animator animator = ViewAnimationUtils.createCircularReveal(container,
centerX, centerY,
reverse ? width : 0,
reverse ? 0 : width);
animator.setInterpolator(new FastOutSlowInInterpolator());
animator.setDuration(resources.getInteger(android.R.integer.config_mediumAnimTime));
return animator;
}
项目:Slide
文件:MainActivity.java
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;
}
项目:Slide
文件:MediaView.java
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;
}
项目:Slide
文件:CommentAdapterHelper.java
public static void showChildrenObject(final View v) {
v.setVisibility(View.VISIBLE);
ValueAnimator animator = ValueAnimator.ofFloat(0, 1f);
animator.setDuration(250);
animator.setInterpolator(new FastOutSlowInInterpolator());
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float value = ((Float) (animation.getAnimatedValue())).floatValue();
v.setAlpha(value);
v.setScaleX(value);
v.setScaleY(value);
}
});
animator.start();
}
项目:Slide
文件:CommentAdapter.java
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;
}
项目:Slide
文件:SubsamplingScaleImageView.java
/**
* Called by worker task when decoder is ready and image size and EXIF orientation is known.
*/
private synchronized void onTilesInited(ImageRegionDecoder decoder, int sWidth, int sHeight, int sOrientation) {
// If actual dimensions don't match the declared size, reset everything.
if (this.sWidth > 0 && this.sHeight > 0 && (this.sWidth != sWidth || this.sHeight != sHeight)) {
reset(false);
if (bitmap != null) {
if (!bitmapIsCached) {
bitmap.recycle();
}
bitmap = null;
bitmapIsPreview = false;
bitmapIsCached = false;
}
}
this.decoder = decoder;
this.sWidth = sWidth;
this.sHeight = sHeight;
this.sOrientation = sOrientation;
checkReady();
checkImageLoaded();
invalidate();
requestLayout();
animate().setInterpolator(new FastOutSlowInInterpolator()).alpha(1);
}
项目:Slide
文件:SubsamplingScaleImageView.java
/**
* Called by worker task when full size image bitmap is ready (tiling is disabled).
*/
private synchronized void onImageLoaded(Bitmap bitmap, int sOrientation, boolean bitmapIsCached) {
// If actual dimensions don't match the declared size, reset everything.
if (this.sWidth > 0 && this.sHeight > 0 && (this.sWidth != bitmap.getWidth() || this.sHeight != bitmap.getHeight())) {
reset(false);
}
if (this.bitmap != null && !this.bitmapIsCached) {
this.bitmap.recycle();
}
this.bitmapIsPreview = false;
this.bitmapIsCached = bitmapIsCached;
this.bitmap = bitmap;
this.sWidth = bitmap.getWidth();
this.sHeight = bitmap.getHeight();
this.sOrientation = sOrientation;
boolean ready = checkReady();
boolean imageLoaded = checkImageLoaded();
if (ready || imageLoaded) {
invalidate();
requestLayout();
}
animate().setInterpolator(new FastOutSlowInInterpolator()).alpha(1);
}
项目:Slide
文件:CreateCardView.java
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;
}