本文整理匯總了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);
}