本文整理汇总了Java中com.nineoldandroids.animation.PropertyValuesHolder.ofFloat方法的典型用法代码示例。如果您正苦于以下问题:Java PropertyValuesHolder.ofFloat方法的具体用法?Java PropertyValuesHolder.ofFloat怎么用?Java PropertyValuesHolder.ofFloat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.nineoldandroids.animation.PropertyValuesHolder
的用法示例。
在下文中一共展示了PropertyValuesHolder.ofFloat方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createReverse
import com.nineoldandroids.animation.PropertyValuesHolder; //导入方法依赖的package包/类
@CheckResult
PropertyValuesHolder createReverse() {
final int max;
if (isFloat) {
float[] newfVals = new float[fVals.length];
max = fVals.length;
for (int i = 0; i < max; i++) {
newfVals[i] = fVals[max - i - 1];
}
return PropertyValuesHolder.ofFloat(property, newfVals);
} else {
int[] newiVals = new int[iVals.length];
max = iVals.length;
for (int i = 0; i < max; i++) {
newiVals[i] = iVals[max - i - 1];
}
return PropertyValuesHolder.ofInt(property, newiVals);
}
}
示例2: viewAnimationScal
import com.nineoldandroids.animation.PropertyValuesHolder; //导入方法依赖的package包/类
/**
* 缩放动画
*
* @param view
*/
public void viewAnimationScal(final View view) {
PropertyValuesHolder pvhX = PropertyValuesHolder.ofFloat("scaleX", 1, 1.5f, 1);
PropertyValuesHolder pvhY = PropertyValuesHolder.ofFloat("scaleY", 1, 1.5f, 1);
ViewHelper.setPivotX(view, view.getWidth() >> 1);
ViewHelper.setPivotY(view, view.getHeight() >> 1);
ObjectAnimator animator2 = ObjectAnimator.ofPropertyValuesHolder(view, pvhX, pvhY).setDuration(300);
animator2.setInterpolator(mInterpolator);
animator2.start();
}
示例3: createAnimation
import com.nineoldandroids.animation.PropertyValuesHolder; //导入方法依赖的package包/类
@Override
public List<Animator> createAnimation() {
List<Animator> animators=new ArrayList<>();
PropertyValuesHolder rotation5=PropertyValuesHolder.ofFloat("rotationX",0,180,180,0,0);
PropertyValuesHolder rotation6=PropertyValuesHolder.ofFloat("rotationY",0,0,180,180,0);
ObjectAnimator animator=ObjectAnimator.ofPropertyValuesHolder(getTarget(), rotation6,rotation5);
animator.setInterpolator(new LinearInterpolator());
animator.setRepeatCount(-1);
animator.setDuration(2500);
animator.start();
animators.add(animator);
return animators;
}
示例4: createAnimation
import com.nineoldandroids.animation.PropertyValuesHolder; //导入方法依赖的package包/类
@Override
public List<Animator> createAnimation() {
List<Animator> animators=new ArrayList<>();
PropertyValuesHolder rotation5=PropertyValuesHolder.ofFloat("rotationX",0,180,180,0,0);
PropertyValuesHolder rotation6=PropertyValuesHolder.ofFloat("rotationY",0,0,180,180,0);
ObjectAnimator animator=ObjectAnimator.ofPropertyValuesHolder(getTarget(), rotation6,rotation5);
animator.setInterpolator(new LinearInterpolator());
animator.setRepeatCount(-1);
animator.setDuration(2500);
animator.start();
animators.add(animator);
return animators;
}
示例5: createAnimation
import com.nineoldandroids.animation.PropertyValuesHolder; //导入方法依赖的package包/类
@Override
public List<Animator> createAnimation() {
PropertyValuesHolder rotation6=PropertyValuesHolder.ofFloat("rotationX",0,360);
ObjectAnimator animator=ObjectAnimator.ofPropertyValuesHolder(getTarget(), rotation6);
animator.setInterpolator(new LinearInterpolator());
animator.setRepeatCount(-1);
animator.setDuration(1500);
animator.start();
List<Animator> animators=new ArrayList<>();
animators.add(animator);
return animators;
}
示例6: viewScaleAnimation
import com.nineoldandroids.animation.PropertyValuesHolder; //导入方法依赖的package包/类
/**
* 缩放动画
* @param view
*/
public static void viewScaleAnimation(View view) {
PropertyValuesHolder pvhX = PropertyValuesHolder.ofFloat("scaleX", 1, 1.3f, 1);
PropertyValuesHolder pvhY = PropertyValuesHolder.ofFloat("scaleY", 1, 1.3f, 1);
ViewHelper.setPivotX(view, view.getWidth() >> 1);
ViewHelper.setPivotY(view, view.getHeight() >> 1);
ObjectAnimator animator2 = ObjectAnimator.ofPropertyValuesHolder(view, pvhX, pvhY).setDuration(150);
animator2.setInterpolator(mInterpolator);
animator2.start();
}
示例7: move
import com.nineoldandroids.animation.PropertyValuesHolder; //导入方法依赖的package包/类
private void move(boolean isFrom, String strX, String strY) {
float currentX = ViewHelper.getX(view);
float currentY = ViewHelper.getY(view);
PropertyValuesHolder x = PropertyValuesHolder.ofFloat(strX, !isFrom ? currentX : floatTargets[0], isFrom ? currentX : floatTargets[0]);
PropertyValuesHolder y = PropertyValuesHolder.ofFloat(strY, !isFrom ? currentY : floatTargets[1], isFrom ? currentY : floatTargets[1]);
setValues(x, y);
addListener(strX, strY);
}
示例8: scale
import com.nineoldandroids.animation.PropertyValuesHolder; //导入方法依赖的package包/类
private void scale(boolean isFrom, String strX, String strY) {
float currentScaleX = ViewHelper.getScaleX(view);
float currentScaleY = ViewHelper.getScaleY(view);
PropertyValuesHolder scaleX = PropertyValuesHolder.ofFloat(strX, !isFrom ? currentScaleX : floatTargets[0], isFrom ? currentScaleX : floatTargets[0]);
PropertyValuesHolder scaleY = PropertyValuesHolder.ofFloat(strY, !isFrom ? currentScaleY : floatTargets[1], isFrom ? currentScaleY : floatTargets[1]);
setValues(scaleX, scaleY);
addListener(strX, strY);
}