本文整理汇总了Java中com.nineoldandroids.animation.PropertyValuesHolder.ofInt方法的典型用法代码示例。如果您正苦于以下问题:Java PropertyValuesHolder.ofInt方法的具体用法?Java PropertyValuesHolder.ofInt怎么用?Java PropertyValuesHolder.ofInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.nineoldandroids.animation.PropertyValuesHolder
的用法示例。
在下文中一共展示了PropertyValuesHolder.ofInt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: getAnimation
import com.nineoldandroids.animation.PropertyValuesHolder; //导入方法依赖的package包/类
/**
* Translation animator object applied to the view
* @param view view to set the animation
* @param top current view top
* @param bottom curret view bottom
* @param translateTop amount of top translation to the view
* @param translateBottom amount of bottom translation to the view
* @return animator object
*/
private Animator getAnimation(final View view, int top, int bottom, float translateTop, float translateBottom) {
int endTop = (int)(top + translateTop);
int endBottom = (int)(bottom + translateBottom);
PropertyValuesHolder translationTop = PropertyValuesHolder.ofInt("top", top, endTop);
PropertyValuesHolder translationBottom = PropertyValuesHolder.ofInt("bottom", bottom,
endBottom);
return ObjectAnimator.ofPropertyValuesHolder(view, translationTop, translationBottom);
}