本文整理匯總了Java中android.animation.PropertyValuesHolder.ofInt方法的典型用法代碼示例。如果您正苦於以下問題:Java PropertyValuesHolder.ofInt方法的具體用法?Java PropertyValuesHolder.ofInt怎麽用?Java PropertyValuesHolder.ofInt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.animation.PropertyValuesHolder
的用法示例。
在下文中一共展示了PropertyValuesHolder.ofInt方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getAnimation
import android.animation.PropertyValuesHolder; //導入方法依賴的package包/類
/**
* This method takes some view and the values by which its top and bottom bounds
* should be changed by. Given these params, an animation which will animate
* these bound changes is created and returned.
*/
private Animator getAnimation(final View view, float translateTop, float translateBottom) {
int top = view.getTop();
int bottom = view.getBottom();
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);
}
示例2: createPropertyValuesHolder
import android.animation.PropertyValuesHolder; //導入方法依賴的package包/類
private PropertyValuesHolder createPropertyValuesHolder(String prop, float startValue, float
endValue) {
return PropertyValuesHolder.ofInt(prop, (int) startValue, (int) endValue);
}