本文整理了Java中android.view.ViewPropertyAnimator.scaleX()
方法的一些代码示例,展示了ViewPropertyAnimator.scaleX()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ViewPropertyAnimator.scaleX()
方法的具体详情如下:
包路径:android.view.ViewPropertyAnimator
类名称:ViewPropertyAnimator
方法名:scaleX
暂无
代码示例来源:origin: commonsguy/cw-omnibus
@Override
public ViewPropertyAnimator scaleX(float value) {
android.view.ViewPropertyAnimator n = mNative.get();
if (n != null) {
n.scaleX(value);
}
return this;
}
代码示例来源:origin: scwang90/SmartRefreshLayout
@Override
public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
int scrollRange = appBarLayout.getTotalScrollRange();
float fraction = 1f * (scrollRange + verticalOffset) / scrollRange;
if (fraction < 0.1 && misAppbarExpand) {
misAppbarExpand = false;
fab.animate().scaleX(0).scaleY(0);
}
if (fraction > 0.8 && !misAppbarExpand) {
misAppbarExpand = true;
fab.animate().scaleX(1).scaleY(1);
}
}
});
代码示例来源:origin: scwang90/SmartRefreshLayout
@Override
public int onFinish(@NonNull RefreshLayout layout, boolean success) {
final View circleView = mCircleView;
mProgress.stop();
circleView.animate().scaleX(0).scaleY(0);
mFinished = true;
return 0;
}
代码示例来源:origin: scwang90/SmartRefreshLayout
@Override
public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
int scrollRange = appBarLayout.getTotalScrollRange();
float fraction = 1f * (scrollRange + verticalOffset) / scrollRange;
if (fraction < 0.1 && misAppbarExpand) {
misAppbarExpand = false;
fab.animate().scaleX(0).scaleY(0);
}
if (fraction > 0.8 && !misAppbarExpand) {
misAppbarExpand = true;
fab.animate().scaleX(1).scaleY(1);
}
}
});
代码示例来源:origin: scwang90/SmartRefreshLayout
@Override
public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
int scrollRange = appBarLayout.getTotalScrollRange();
float fraction = 1f * (scrollRange + verticalOffset) / scrollRange;
if (fraction < 0.1 && misAppbarExpand) {
misAppbarExpand = false;
fab.animate().scaleX(0).scaleY(0);
}
if (fraction > 0.8 && !misAppbarExpand) {
misAppbarExpand = true;
fab.animate().scaleX(1).scaleY(1);
}
}
});
代码示例来源:origin: scwang90/SmartRefreshLayout
@Override
public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
int scrollRange = appBarLayout.getTotalScrollRange();
float fraction = 1f * (scrollRange + verticalOffset) / scrollRange;
if (fraction < 0.1 && misAppbarExpand) {
misAppbarExpand = false;
fab.animate().scaleX(0).scaleY(0);
}
if (fraction > 0.8 && !misAppbarExpand) {
misAppbarExpand = true;
fab.animate().scaleX(1).scaleY(1);
}
}
});
代码示例来源:origin: janishar/PlaceHolderView
protected static <V extends View>void itemAnimScaleDesc(V view, float scaleInitial, float scaleFinal, float factor, int duration){
view.setScaleX(scaleInitial);
view.setScaleY(scaleInitial);
view.animate()
.scaleX(scaleFinal)
.scaleY(scaleFinal)
.setInterpolator(new DecelerateInterpolator(factor))
.setDuration(duration)
.start();
}
代码示例来源:origin: janishar/PlaceHolderView
protected static <V extends View>void itemAnimScaleAsc(V view, float scaleInitial, float scaleFinal, float factor, int duration){
view.setScaleX(scaleInitial);
view.setScaleY(scaleInitial);
view.animate()
.scaleX(scaleFinal)
.scaleY(scaleFinal)
.setInterpolator(new AccelerateInterpolator(factor))
.setDuration(duration)
.start();
}
代码示例来源:origin: seven332/EhViewer
private void hideActionFab() {
if (null != mFabLayout && STATE_NORMAL == mState && mShowActionFab) {
mShowActionFab = false;
View fab = mFabLayout.getPrimaryFab();
fab.animate().scaleX(0.0f).scaleY(0.0f).setListener(mActionFabAnimatorListener)
.setDuration(ANIMATE_TIME).setStartDelay(0L)
.setInterpolator(AnimationUtils.SLOW_FAST_INTERPOLATOR).start();
}
}
代码示例来源:origin: Aspsine/SwipeToLoadLayout
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR1)
@Override
public void onComplete() {
progressView.animate().scaleX(0).scaleY(0).setDuration(300);
}
代码示例来源:origin: HotBitmapGG/bilibili-android-client
private void hideFAB() {
mFAB.animate().scaleX(0f).scaleY(0f)
.setInterpolator(new AccelerateInterpolator())
.start();
mFAB.setClickable(false);
}
代码示例来源:origin: frogermcs/InstaMaterial
@Override
public void onSuccess() {
ivPhoto.animate()
.scaleX(1.f).scaleY(1.f)
.setInterpolator(new OvershootInterpolator())
.setDuration(400)
.setStartDelay(200)
.start();
}
代码示例来源:origin: seven332/EhViewer
private void showActionFab() {
if (null != mFabLayout && STATE_NORMAL == mState && !mShowActionFab) {
mShowActionFab = true;
View fab = mFabLayout.getPrimaryFab();
fab.setVisibility(View.VISIBLE);
fab.setRotation(-45.0f);
fab.animate().scaleX(1.0f).scaleY(1.0f).rotation(0.0f).setListener(null)
.setDuration(ANIMATE_TIME).setStartDelay(0L)
.setInterpolator(AnimationUtils.FAST_SLOW_INTERPOLATOR).start();
}
}
代码示例来源:origin: frogermcs/InstaMaterial
@Override
public void onLoadingFinished() {
vSendingProgress.animate().scaleY(0).scaleX(0).setDuration(200).setStartDelay(100);
vProgressBg.animate().alpha(0.f).setDuration(200).setStartDelay(100)
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
vSendingProgress.setScaleX(1);
vSendingProgress.setScaleY(1);
vProgressBg.setAlpha(1);
if (onLoadingFinishedListener != null) {
onLoadingFinishedListener.onLoadingFinished();
onLoadingFinishedListener = null;
}
}
}).start();
}
});
代码示例来源:origin: HotBitmapGG/bilibili-android-client
private void showFAB() {
mFAB.animate().scaleX(1f).scaleY(1f)
.setInterpolator(new OvershootInterpolator())
.start();
mFAB.setClickable(true);
}
代码示例来源:origin: nickbutcher/plaid
private void animateToolbar() {
// this is gross but toolbar doesn't expose it's children to animate them :(
View t = toolbar.getChildAt(0);
if (t != null && t instanceof TextView) {
TextView title = (TextView) t;
// fade in and space out the title. Animating the letterSpacing performs horribly so
// fake it by setting the desired letterSpacing then animating the scaleX ¯\_(ツ)_/¯
title.setAlpha(0f);
title.setScaleX(0.8f);
title.animate()
.alpha(1f)
.scaleX(1f)
.setStartDelay(300)
.setDuration(900)
.setInterpolator(AnimUtils.getFastOutSlowInInterpolator(this));
}
}
代码示例来源:origin: nickbutcher/plaid
private void showFab() {
fab.setAlpha(0f);
fab.setScaleX(0f);
fab.setScaleY(0f);
fab.setTranslationY(fab.getHeight() / 2);
fab.animate()
.alpha(1f)
.scaleX(1f)
.scaleY(1f)
.translationY(0f)
.setDuration(300L)
.setInterpolator(AnimUtils.getLinearOutSlowInInterpolator(this))
.start();
}
代码示例来源:origin: nickbutcher/plaid
@Override
public void onStopNestedScroll(View child) {
if (Math.abs(totalDrag) >= dragDismissDistance) {
dispatchDismissCallback();
} else { // settle back to natural position
if (mLastActionEvent == MotionEvent.ACTION_DOWN) {
// this is a 'defensive cleanup for new gestures',
// don't animate here
// see also https://github.com/nickbutcher/plaid/issues/185
setTranslationY(0f);
setScaleX(1f);
setScaleY(1f);
} else {
animate()
.translationY(0f)
.scaleX(1f)
.scaleY(1f)
.setDuration(200L)
.setInterpolator(AnimUtils.getFastOutSlowInInterpolator(getContext()))
.setListener(null)
.start();
}
totalDrag = 0;
draggingDown = draggingUp = false;
dispatchDragCallback(0f, 0f, 0f, 0f);
}
}
代码示例来源:origin: frogermcs/InstaMaterial
private void animatePhoto(PhotoViewHolder viewHolder) {
if (!lockedAnimations) {
if (lastAnimatedItem == viewHolder.getPosition()) {
setLockedAnimations(true);
}
long animationDelay = PHOTO_ANIMATION_DELAY + viewHolder.getPosition() * 30;
viewHolder.flRoot.setScaleY(0);
viewHolder.flRoot.setScaleX(0);
viewHolder.flRoot.animate()
.scaleY(1)
.scaleX(1)
.setDuration(200)
.setInterpolator(INTERPOLATOR)
.setStartDelay(animationDelay)
.start();
}
}
代码示例来源:origin: frogermcs/InstaMaterial
private void performShowAnimation() {
contextMenuView.setPivotX(contextMenuView.getWidth() / 2);
contextMenuView.setPivotY(contextMenuView.getHeight());
contextMenuView.setScaleX(0.1f);
contextMenuView.setScaleY(0.1f);
contextMenuView.animate()
.scaleX(1f).scaleY(1f)
.setDuration(150)
.setInterpolator(new OvershootInterpolator())
.setListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
isContextMenuShowing = false;
}
});
}
内容来源于网络,如有侵权,请联系作者删除!