public void slideInFab() {
if (mAnimatingFab) {
return;
}
if (isFabExpanded()) {
contractFab();
return;
}
ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) mFab.getLayoutParams();
float dy = mFab.getHeight() + lp.bottomMargin;
if (mFab.getTranslationY() != dy) {
return;
}
mAnimatingFab = true;
mFab.setVisibility(View.VISIBLE);
mFab.animate()
.setStartDelay(0)
.setDuration(200)
.setInterpolator(new FastOutLinearInInterpolator())
.translationY(0f)
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(final Animator animation) {
super.onAnimationEnd(animation);
mAnimatingFab = false;
}
})
.start();
}
java类android.support.v4.view.animation.FastOutLinearInInterpolator的实例源码
BottomSheetLayout.java 文件源码
项目:Android-SleepingForLess
阅读 27
收藏 0
点赞 0
评论 0
BottomSheetLayout.java 文件源码
项目:Android-SleepingForLess
阅读 26
收藏 0
点赞 0
评论 0
public void slideOutFab() {
if (mAnimatingFab) {
return;
}
if (isFabExpanded()) {
contractFab();
return;
}
ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) mFab.getLayoutParams();
if (mFab.getTranslationY() != 0f) {
return;
}
mAnimatingFab = true;
mFab.animate()
.setStartDelay(0)
.setDuration(200)
.setInterpolator(new FastOutLinearInInterpolator())
.translationY(mFab.getHeight() + lp.bottomMargin)
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(final Animator animation) {
super.onAnimationEnd(animation);
mAnimatingFab = false;
mFab.setVisibility(View.INVISIBLE);
}
})
.start();
}
FooterLayout.java 文件源码
项目:Android-SleepingForLess
阅读 30
收藏 0
点赞 0
评论 0
public void slideInFab() {
if (mAnimatingFab) {
return;
}
if (isFabExpanded()) {
contractFab();
return;
}
ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) mFab.getLayoutParams();
float dy = mFab.getHeight() + lp.bottomMargin;
if (mFab.getTranslationY() != dy) {
return;
}
mAnimatingFab = true;
mFab.setVisibility(View.VISIBLE);
mFab.animate()
.setStartDelay(0)
.setDuration(200)
.setInterpolator(new FastOutLinearInInterpolator())
.translationY(0f)
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(final Animator animation) {
super.onAnimationEnd(animation);
mAnimatingFab = false;
}
})
.start();
}
FooterLayout.java 文件源码
项目:Android-SleepingForLess
阅读 20
收藏 0
点赞 0
评论 0
public void slideOutFab() {
if (mAnimatingFab) {
return;
}
if (isFabExpanded()) {
contractFab();
return;
}
ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) mFab.getLayoutParams();
if (mFab.getTranslationY() != 0f) {
return;
}
mAnimatingFab = true;
mFab.animate()
.setStartDelay(0)
.setDuration(200)
.setInterpolator(new FastOutLinearInInterpolator())
.translationY(mFab.getHeight() + lp.bottomMargin)
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(final Animator animation) {
super.onAnimationEnd(animation);
mAnimatingFab = false;
mFab.setVisibility(View.INVISIBLE);
}
})
.start();
}
QuizFragment.java 文件源码
项目:android-topeka
阅读 22
收藏 0
点赞 0
评论 0
@SuppressWarnings("ConstantConditions")
private void setAvatarDrawable(AvatarView avatarView) {
Player player = PreferencesHelper.getPlayer(getActivity());
avatarView.setAvatar(player.getAvatar().getDrawableId());
ViewCompat.animate(avatarView)
.setInterpolator(new FastOutLinearInInterpolator())
.setStartDelay(500)
.scaleX(1)
.scaleY(1)
.start();
}
MainActivity.java 文件源码
项目:CircleReveal
阅读 17
收藏 0
点赞 0
评论 0
private void executeCardsSequentialAnimation() {
final int length = cardsLine.getChildCount();
cardsLine.setVisibility(View.VISIBLE);
final Animator[] animators = new Animator[length];
for (int i = 0; i < length; i++) {
View target = cardsLine.getChildAt(i);
final float x0 = 0;// i == 0 ? 0 : -10 * (1 + i * 0.2f);
final float y0 = 10 * i;
target.setTranslationX(x0);
target.setTranslationY(y0);
AnimatorPath path = new AnimatorPath();
path.moveTo(x0, y0);
path.lineTo(0, 0);
PathPoint[] points = new PathPoint[path.getPoints().size()];
path.getPoints().toArray(points);
AnimatorSet set = new AnimatorSet();
set.play(ObjectAnimator.ofObject(target, PATH_POINT, new PathEvaluator(), points))
.with(ObjectAnimator.ofFloat(target, View.ALPHA, 0.8f, 1f));
animators[i] = set;
animators[i].setStartDelay(15 * i);
}
final AnimatorSet sequential = new AnimatorSet();
sequential.playTogether(animators);
sequential.setInterpolator(new FastOutLinearInInterpolator());
sequential.setDuration(FAST_DURATION);
sequential.start();
}
BodyZoneActivity.java 文件源码
项目:MoleMapperAndroid
阅读 19
收藏 0
点赞 0
评论 0
private void startMoleCreateState()
{
LogExt.i(getClass(), "startMoleCreateState");
addMole.animate()
.scaleX(0)
.scaleY(0)
.setDuration(150)
.setInterpolator(new FastOutLinearInInterpolator())
.withEndAction(() -> {
addMole.setVisibility(View.GONE);
addMoleContainer.animate().setDuration(150).translationY(0);
});
zoneImage.setCurrentState(ZoneView.STATE_MOLE_CREATE);
addMoleTitle.setText(R.string.zone_add_mole_hint_highlight);
addMoleAction.setText(R.string.save);
addMoleAction.setOnClickListener(v -> {
Observable.from(zoneImage.getCreated())
.map(emptyMole -> ((Database) StorageAccess.getInstance()
.getAppDatabase()).createMole(BodyZoneActivity.this, emptyMole, zone))
.compose(ObservableUtils.applyDefault())
.subscribe(mole -> {
LogExt.d(BodyZoneActivity.class, "Saved new mole: " + mole.moleName);
}, error -> {
throw new OnErrorNotImplementedException(error);
}, this :: fetchZone);
startMoleSelectionState();
});
addMoleCancel.setVisibility(View.VISIBLE);
}
RadioRealButtonGroup.java 文件源码
项目:RadioRealButton
阅读 27
收藏 0
点赞 0
评论 0
private void initInterpolations() {
Class[] interpolations = {
FastOutSlowInInterpolator.class,
BounceInterpolator.class,
LinearInterpolator.class,
DecelerateInterpolator.class,
CycleInterpolator.class,
AnticipateInterpolator.class,
AccelerateDecelerateInterpolator.class,
AccelerateInterpolator.class,
AnticipateOvershootInterpolator.class,
FastOutLinearInInterpolator.class,
LinearOutSlowInInterpolator.class,
OvershootInterpolator.class};
try {
interpolatorText = (Interpolator) interpolations[animateTextsEnter].newInstance();
interpolatorDrawablesEnter = (Interpolator) interpolations[animateDrawablesEnter].newInstance();
interpolatorSelector = (Interpolator) interpolations[animateSelector].newInstance();
interpolatorTextExit = (Interpolator) interpolations[animateTextsExit].newInstance();
interpolatorDrawablesExit = (Interpolator) interpolations[animateDrawablesExit].newInstance();
} catch (Exception e) {
e.printStackTrace();
}
}
TopViewHideShowAnimation.java 文件源码
项目:luxunPro
阅读 22
收藏 0
点赞 0
评论 0
public TopViewHideShowAnimation(View view, boolean toVisible, long duration) {
super(false);
this.toVisible = toVisible;
this.animationView = view;
//Creates the Alpha animation for the transition
float startAlpha = toVisible ? 0 : 1;
float endAlpha = toVisible ? 1 : 0;
AlphaAnimation alphaAnimation = new AlphaAnimation(startAlpha, endAlpha);
alphaAnimation.setDuration(duration);
//Creates the Translate animation for the transition
int startY = toVisible ? -view.getHeight() : 0;
int endY = toVisible ? 0 : -view.getHeight();
TranslateAnimation translateAnimation = new TranslateAnimation(0, 0, startY, endY);
translateAnimation.setInterpolator(toVisible ? new LinearOutSlowInInterpolator() : new FastOutLinearInInterpolator());
translateAnimation.setDuration(duration);
//Adds the animations to the set
addAnimation(alphaAnimation);
addAnimation(translateAnimation);
setAnimationListener(new Listener());
}
BottomViewHideShowAnimation.java 文件源码
项目:ExoMedia
阅读 20
收藏 0
点赞 0
评论 0
public BottomViewHideShowAnimation(View view, boolean toVisible, long duration) {
super(false);
this.toVisible = toVisible;
this.animationView = view;
//Creates the Alpha animation for the transition
float startAlpha = toVisible ? 0 : 1;
float endAlpha = toVisible ? 1 : 0;
AlphaAnimation alphaAnimation = new AlphaAnimation(startAlpha, endAlpha);
alphaAnimation.setDuration(duration);
//Creates the Translate animation for the transition
int startY = toVisible ? getHideShowDelta(view) : 0;
int endY = toVisible ? 0 : getHideShowDelta(view);
TranslateAnimation translateAnimation = new TranslateAnimation(0, 0, startY, endY);
translateAnimation.setInterpolator(toVisible ? new LinearOutSlowInInterpolator() : new FastOutLinearInInterpolator());
translateAnimation.setDuration(duration);
//Adds the animations to the set
addAnimation(alphaAnimation);
addAnimation(translateAnimation);
setAnimationListener(new Listener());
}