本文整理汇总了Java中android.view.ViewPropertyAnimator.rotation方法的典型用法代码示例。如果您正苦于以下问题:Java ViewPropertyAnimator.rotation方法的具体用法?Java ViewPropertyAnimator.rotation怎么用?Java ViewPropertyAnimator.rotation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.ViewPropertyAnimator
的用法示例。
在下文中一共展示了ViewPropertyAnimator.rotation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: rotation
import android.view.ViewPropertyAnimator; //导入方法依赖的package包/类
public ViewPropertyAnimator rotation(float value) {
ViewPropertyAnimator n = (ViewPropertyAnimator) this.mNative.get();
if (n != null) {
n.rotation(value);
}
return this;
}
示例2: doSwipe
import android.view.ViewPropertyAnimator; //导入方法依赖的package包/类
/**
*
* @param isSwipeIn
*/
protected void doSwipe(boolean isSwipeIn){
if(mLayoutView != null && mViewRemoveAnimatorListener != null && !mSwipeOption.getIsViewLocked()) {
if(!mSwipeOption.getIsPutBackActive()) {
blockTouch();
}
if (isSwipeIn) {
if (getSwipeInMsgView() != null) {
getSwipeInMsgView().setVisibility(VISIBLE);
}
} else {
if (getSwipeOutMsgView() != null) {
getSwipeOutMsgView().setVisibility(VISIBLE);
}
}
DisplayMetrics displayMetrics = mLayoutView.getResources().getDisplayMetrics();
ViewPropertyAnimator animator = mLayoutView.animate();
float transX = displayMetrics.widthPixels;
float transY = displayMetrics.heightPixels;
switch (mSwipeType){
case SwipePlaceHolderView.SWIPE_TYPE_DEFAULT:
if(isSwipeIn){
bindSwipeIn(getResolver());
animator.rotation(-mSwipeDecor.getSwipeRotationAngle());
}else{
bindSwipeOut(getResolver());
transX = -mLayoutView.getWidth();
animator.rotation(mSwipeDecor.getSwipeRotationAngle());
}
animator.translationX(transX).translationY(transY);
break;
case SwipePlaceHolderView.SWIPE_TYPE_HORIZONTAL:
if(isSwipeIn){
bindSwipeIn(getResolver());
}else{
bindSwipeOut(getResolver());
transX = -mLayoutView.getWidth();
}
animator.translationX(transX);
break;
case SwipePlaceHolderView.SWIPE_TYPE_VERTICAL:
if(isSwipeIn){
bindSwipeIn(getResolver());
}else{
bindSwipeOut(getResolver());
transY = -mLayoutView.getHeight();
}
animator.translationY(transY);
break;
}
animator.setDuration((long) (mSwipeDecor.getSwipeAnimTime() * 1.25))
.setInterpolator(new AccelerateInterpolator(mSwipeDecor.getSwipeAnimFactor()))
.setListener(mViewRemoveAnimatorListener)
.start();
}
}