当前位置: 首页>>代码示例>>Java>>正文


Java FloatingActionMenu.setIconToggleAnimatorSet方法代码示例

本文整理汇总了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);
}
 
开发者ID:code-mc,项目名称:FacerecognitionFlowpilots,代码行数:30,代码来源:CameraFragment.java

示例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);
}
 
开发者ID:huy510cnt,项目名称:NQH_FloatingActionButton,代码行数:32,代码来源:FloatingMenusActivity.java

示例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);
}
 
开发者ID:commonsguy,项目名称:cwac-cam2,代码行数:35,代码来源:CameraFragment.java


注:本文中的com.github.clans.fab.FloatingActionMenu.setIconToggleAnimatorSet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。