當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。