/**
* アクションする削除アイコンの設定を更新します。
*
* @param width 対象となるViewの幅
* @param height 対象となるViewの高さ
* @param shape 対象となるViewの形状
*/
void updateActionTrashIcon(float width, float height, float shape) {
// アクションする削除アイコンが設定されていない場合は何もしない
if (!hasActionTrashIcon()) {
return;
}
// 拡大率の設定
mAnimationHandler.mTargetWidth = width;
mAnimationHandler.mTargetHeight = height;
final float newWidthScale = width / mActionTrashIconBaseWidth * shape;
final float newHeightScale = height / mActionTrashIconBaseHeight * shape;
mActionTrashIconMaxScale = Math.max(newWidthScale, newHeightScale);
// ENTERアニメーション作成
mEnterScaleAnimator = ObjectAnimator.ofPropertyValuesHolder(mActionTrashIconView, PropertyValuesHolder.ofFloat(ImageView.SCALE_X, mActionTrashIconMaxScale), PropertyValuesHolder.ofFloat(ImageView.SCALE_Y, mActionTrashIconMaxScale));
mEnterScaleAnimator.setInterpolator(new OvershootInterpolator());
mEnterScaleAnimator.setDuration(TRASH_ICON_SCALE_DURATION_MILLIS);
// Exitアニメーション作成
mExitScaleAnimator = ObjectAnimator.ofPropertyValuesHolder(mActionTrashIconView, PropertyValuesHolder.ofFloat(ImageView.SCALE_X, 1.0f), PropertyValuesHolder.ofFloat(ImageView.SCALE_Y, 1.0f));
mExitScaleAnimator.setInterpolator(new OvershootInterpolator());
mExitScaleAnimator.setDuration(TRASH_ICON_SCALE_DURATION_MILLIS);
}
TrashView.java 文件源码
java
阅读 32
收藏 0
点赞 0
评论 0
项目:FLFloatingButton
作者:
评论列表
文章目录