本文整理汇总了Java中com.github.clans.fab.FloatingActionMenu.setIconToggleAnimatorSet方法的典型用法代码示例。如果您正苦于以下问题:Java FloatingActionMenu.setIconToggleAnimatorSet方法的具体用法?Java FloatingActionMenu.setIconToggleAnimatorSet怎么用?Java FloatingActionMenu.setIconToggleAnimatorSet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.github.clans.fab.FloatingActionMenu
的用法示例。
在下文中一共展示了FloatingActionMenu.setIconToggleAnimatorSet方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: changeMenuIconAnimation
import com.github.clans.fab.FloatingActionMenu; //导入方法依赖的package包/类
private void changeMenuIconAnimation(final FloatingActionMenu menu) {
AnimatorSet set=new AnimatorSet();
final ImageView v=menu.getMenuIconView();
ObjectAnimator scaleOutX=ObjectAnimator.ofFloat(v, "scaleX", 1.0f, 0.2f);
ObjectAnimator scaleOutY=ObjectAnimator.ofFloat(v, "scaleY", 1.0f, 0.2f);
ObjectAnimator scaleInX=ObjectAnimator.ofFloat(v, "scaleX", 0.2f, 1.0f);
ObjectAnimator scaleInY=ObjectAnimator.ofFloat(v, "scaleY", 0.2f, 1.0f);
scaleOutX.setDuration(50);
scaleOutY.setDuration(50);
scaleInX.setDuration(150);
scaleInY.setDuration(150);
scaleInX.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
v.setImageResource(menu.isOpened()
? R.drawable.cwac_cam2_ic_action_settings
: R.drawable.cwac_cam2_ic_close);
// yes, that seems backwards, but it works
// presumably, opened state not yet toggled
}
});
set.play(scaleOutX).with(scaleOutY);
set.play(scaleInX).with(scaleInY).after(scaleOutX);
set.setInterpolator(new OvershootInterpolator(2));
menu.setIconToggleAnimatorSet(set);
}
示例2: createCustomAnimation
import com.github.clans.fab.FloatingActionMenu; //导入方法依赖的package包/类
private void createCustomAnimation() {
final FloatingActionMenu menu4 = (FloatingActionMenu) findViewById(R.id.menu4);
AnimatorSet set = new AnimatorSet();
ObjectAnimator scaleOutX = ObjectAnimator.ofFloat(menu4.getMenuIconView(), "scaleX", 1.0f, 0.2f);
ObjectAnimator scaleOutY = ObjectAnimator.ofFloat(menu4.getMenuIconView(), "scaleY", 1.0f, 0.2f);
ObjectAnimator scaleInX = ObjectAnimator.ofFloat(menu4.getMenuIconView(), "scaleX", 0.2f, 1.0f);
ObjectAnimator scaleInY = ObjectAnimator.ofFloat(menu4.getMenuIconView(), "scaleY", 0.2f, 1.0f);
scaleOutX.setDuration(50);
scaleOutY.setDuration(50);
scaleInX.setDuration(150);
scaleInY.setDuration(150);
scaleInX.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
menu4.getMenuIconView().setImageResource(menu4.isOpened()
? R.drawable.ic_close : R.drawable.ic_star);
}
});
set.play(scaleOutX).with(scaleOutY);
set.play(scaleInX).with(scaleInY).after(scaleOutX);
set.setInterpolator(new OvershootInterpolator(2));
menu4.setIconToggleAnimatorSet(set);
}
示例3: changeMenuIconAnimation
import com.github.clans.fab.FloatingActionMenu; //导入方法依赖的package包/类
private void changeMenuIconAnimation(
final FloatingActionMenu menu) {
AnimatorSet set=new AnimatorSet();
final ImageView v=menu.getMenuIconView();
ObjectAnimator scaleOutX=
ObjectAnimator.ofFloat(v, "scaleX", 1.0f, 0.2f);
ObjectAnimator scaleOutY=
ObjectAnimator.ofFloat(v, "scaleY", 1.0f, 0.2f);
ObjectAnimator scaleInX=
ObjectAnimator.ofFloat(v, "scaleX", 0.2f, 1.0f);
ObjectAnimator scaleInY=
ObjectAnimator.ofFloat(v, "scaleY", 0.2f, 1.0f);
scaleOutX.setDuration(50);
scaleOutY.setDuration(50);
scaleInX.setDuration(150);
scaleInY.setDuration(150);
scaleInX.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
v.setImageResource(menu.isOpened()
? R.drawable.cwac_cam2_ic_action_settings
: R.drawable.cwac_cam2_ic_close);
// yes, that seems backwards, but it works
// presumably, opened state not yet toggled
}
});
set.play(scaleOutX).with(scaleOutY);
set.play(scaleInX).with(scaleInY).after(scaleOutX);
set.setInterpolator(new OvershootInterpolator(2));
menu.setIconToggleAnimatorSet(set);
}