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


Java ViewAnimationUtils类代码示例

本文整理汇总了Java中io.codetail.animation.ViewAnimationUtils的典型用法代码示例。如果您正苦于以下问题:Java ViewAnimationUtils类的具体用法?Java ViewAnimationUtils怎么用?Java ViewAnimationUtils使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ViewAnimationUtils类属于io.codetail.animation包,在下文中一共展示了ViewAnimationUtils类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: reactionToClickSearchAction

import io.codetail.animation.ViewAnimationUtils; //导入依赖的package包/类
/**
 * 点击搜索
 */
protected void reactionToClickSearchAction() {
    mShowSearchToolbar = true;

    View childView = mRevealFrameLayout.getChildAt(0);
    childView.setVisibility(View.VISIBLE);
    childView.bringToFront();

    int centerX = childView.getRight();
    int centerY = childView.getBottom() / 2;
    Animator circularReveal = ViewAnimationUtils.createCircularReveal(childView, centerX, centerY, 0, childView.getWidth());
    circularReveal.setDuration(300).setInterpolator(new LinearInterpolator());
    circularReveal.start();

    circularReveal.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            super.onAnimationEnd(animation);

            reactionToCover(true);

            mEdSearch.requestFocus();
            KeyboardUtils.showSoftInput(mEdSearch, getContext());
        }
    });
}
 
开发者ID:Sugarya,项目名称:Closet,代码行数:29,代码来源:BasicSearchBarFragment.java

示例2: setUpReveal

import io.codetail.animation.ViewAnimationUtils; //导入依赖的package包/类
private void setUpReveal(){
    int w = panel.getWidth();
    int h = panel.getHeight();
    final int endRadius = (int) Math.hypot(w, h);
    final int cx = (int)(actionButton.getX()+actionButton.getWidth()/2);
    final int cy = (int)(actionButton.getY()+actionButton.getHeight()/2-background.getTop());

    final float deltaX=cx-(playPause.getLeft()+playPause.getWidth()/2);
    final float deltaY=(cy-getResources().getDimension(R.dimen.play_pause_size)/2)-(playPause.getTop());
    playPause.setTranslationX(deltaX);
    playPause.setTranslationY(deltaY);
    revealAnimator = ViewAnimationUtils.createCircularReveal(panel, cx, cy, actionButton.getHeight(), endRadius);
    revealAnimator.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationStart(Animator animation) {
            panel.setVisibility(View.VISIBLE);
            actionButton.setVisibility(View.INVISIBLE);
            fadeInOutViews(0,duration(R.integer.fade_in_duration));
        }
    });
    revealAnimator.setDuration(duration(R.integer.conceal_duration)/2);
    revealAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
}
 
开发者ID:vpaliyX,项目名称:Material-Motion,代码行数:24,代码来源:PlayerFragment.java

示例3: reactionToSearchBack

import io.codetail.animation.ViewAnimationUtils; //导入依赖的package包/类
/**
 * 搜索栏的回退逻辑
 *
 * @return
 */
private boolean reactionToSearchBack() {
    if (mShowSearchToolbar) {
        mShowSearchToolbar = false;
        KeyboardUtils.hideSoftInput(mEdSearch, getContext());

        View childView = mRevealFrameLayout.getChildAt(0);
        childView.bringToFront();

        int centerX = childView.getLeft();
        int centerY = childView.getBottom() / 2;
        Animator circularReveal = ViewAnimationUtils.createCircularReveal(childView, centerX, centerY, 0, childView.getWidth());
        circularReveal.setDuration(300).setInterpolator(new DecelerateInterpolator());

        circularReveal.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                super.onAnimationEnd(animation);
                reactionToCover(false);
            }
        });
        circularReveal.start();

        if (mEdSearch != null) {
            mEdSearch.setText("");
            mSearchWord = "";
            fetchSearchData(mSearchWord);
        }

        return true;
    }
    return false;
}
 
开发者ID:Sugarya,项目名称:Closet,代码行数:38,代码来源:BasicSearchBarFragment.java

示例4: revealOff

import io.codetail.animation.ViewAnimationUtils; //导入依赖的package包/类
@Override
final void revealOff(final View fab, final View transformView, final RevealCallback callback) {
    SupportAnimator animator = ViewAnimationUtils.createCircularReveal(
            transformView,
            getCenterX(fab),
            getCenterY(fab),
            (float) Math.hypot(transformView.getWidth(), transformView.getHeight()) / 2,
            fab.getWidth() / 2);
    animator.setInterpolator(REVEAL_INTERPOLATOR);
    animator.addListener(new SupportAnimator.AnimatorListener() {
        @Override
        public void onAnimationStart() {
            callback.onRevealStart();
        }

        @Override
        public void onAnimationEnd() {
            transformView.setVisibility(View.INVISIBLE);
            callback.onRevealEnd();
        }

        @Override
        public void onAnimationCancel() {
            //
        }

        @Override
        public void onAnimationRepeat() {
            //
        }
    });
    if (transformView.getVisibility() == View.VISIBLE) {
        animator.setDuration((int) getRevealAnimationDuration());
        animator.start();
        transformView.setEnabled(true);
    }
}
 
开发者ID:SimonCherryGZ,项目名称:JewelryUI,代码行数:38,代码来源:FabAnimatorPreL.java

示例5: animateBg

import io.codetail.animation.ViewAnimationUtils; //导入依赖的package包/类
public void animateBg() {
    mImage.setVisibility(INVISIBLE);

    int cx = mImage.getWidth();
    int cy = mImage.getHeight();

    SupportAnimator animator = ViewAnimationUtils.createCircularReveal(mImage, cx, cy, 0, Math.max(cx, cy));
    animator.addListener(new SupportAnimator.SimpleAnimatorListener() {
        @Override
        public void onAnimationStart() {
            super.onAnimationStart();
            mImage.setVisibility(VISIBLE);
        }
    });
    animator.setStartDelay(500);
    animator.start();
}
 
开发者ID:morogoku,项目名称:MTweaks-KernelAdiutorMOD,代码行数:18,代码来源:NavHeaderView.java

示例6: playInitAnimation

import io.codetail.animation.ViewAnimationUtils; //导入依赖的package包/类
private void playInitAnimation() {
	DisplayMetrics dm = getResources().getDisplayMetrics();
	// Get the center for the FAB
	int cx = dm.widthPixels / 2;
	int cy = 0;

	float finalRadius = dm.heightPixels;

	revealTransition = ViewAnimationUtils.createCircularReveal(mainContentLayout, cx, cy, 0, finalRadius);
	revealTransition.setInterpolator(new AccelerateDecelerateInterpolator());
	revealTransition.setDuration(800);
	revealTransition.addListener(new SupportAnimator.AnimatorListener() {
		@Override
		public void onAnimationStart() {
			mainContentLayout.setVisibility(View.VISIBLE);
		}
		public void onAnimationEnd() {}
		public void onAnimationCancel() {}
		public void onAnimationRepeat() {}
	});
	revealTransition.start();
}
 
开发者ID:SebastianRask,项目名称:Pocket-Plays-for-Twitch,代码行数:23,代码来源:DonationActivity.java

示例7: circularDismissView

import io.codetail.animation.ViewAnimationUtils; //导入依赖的package包/类
private void circularDismissView(final View view) {
	final int DURATION = 600;

	// Get the center for the FAB
	int cx = (int) view.getX() + view.getMeasuredHeight() / 2;
	int cy = (int) view.getY() + view.getMeasuredWidth() / 2;

	// get the final radius for the clipping circle
	int dx = Math.max(cx, view.getWidth() - cx);
	int dy = Math.max(cy, view.getHeight() - cy);
	float finalRadius = (float) Math.hypot(dx, dy);

	final SupportAnimator dismissAnimation = ViewAnimationUtils.createCircularReveal(view, cx, cy, 0, finalRadius).reverse();
	dismissAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
	dismissAnimation.setDuration(DURATION);
	dismissAnimation.start();
	new Handler().postDelayed(new Runnable() {
		@Override
		public void run() {
			mSuperContainer.setVisibility(View.GONE);
		}
	}, DURATION);
}
 
开发者ID:SebastianRask,项目名称:Pocket-Plays-for-Twitch,代码行数:24,代码来源:UpdateDialogHandler.java

示例8: setActivityToolbarCircularRevealAnimation

import io.codetail.animation.ViewAnimationUtils; //导入依赖的package包/类
public static void setActivityToolbarCircularRevealAnimation(final Toolbar aDecorativeToolbar) {
	aDecorativeToolbar.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
		@Override
		public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
			v.removeOnLayoutChangeListener(this);

			int CIRCULAR_REVEAL_DURATION = 700;
			int cx = (aDecorativeToolbar.getLeft() + aDecorativeToolbar.getRight()) / 2;
			int cy = 0;

			// get the final radius for the clipping circle
			int finalRadius = Math.max(aDecorativeToolbar.getWidth(), aDecorativeToolbar.getHeight());

			SupportAnimator animator = ViewAnimationUtils.createCircularReveal(aDecorativeToolbar, cx, cy, 0, finalRadius);

			animator.setInterpolator(new AccelerateDecelerateInterpolator());
			animator.setDuration(CIRCULAR_REVEAL_DURATION);
			animator.start();
		}
	});
}
 
开发者ID:SebastianRask,项目名称:Pocket-Plays-for-Twitch,代码行数:22,代码来源:AnimationService.java

示例9: enterReveal

import io.codetail.animation.ViewAnimationUtils; //导入依赖的package包/类
private void enterReveal(View myView) {

        menuShown = true;
        centerButton.animate().rotation(45).setInterpolator(new AccelerateInterpolator()).setDuration(50);

        // get the center for the clipping circle
        int cx = myView.getMeasuredWidth() / 2;
        int cy = myView.getMeasuredHeight();

        // get the final radius for the clipping circle
        int finalRadius = Math.max(myView.getWidth(), myView.getHeight());

        // create the animator for this view (the start radius is zero)
        Animator anim =
                ViewAnimationUtils.createCircularReveal(myView, cx, cy, 0, finalRadius);

        // make the view visible and start the animation
        myView.setVisibility(View.VISIBLE);
        anim.setDuration(Constant.REVEAL_DURATION);
        anim.start();

        removeSelected();
    }
 
开发者ID:PacktPublishing,项目名称:Expert-Android-Programming,代码行数:24,代码来源:HomeBaseActivity.java

示例10: exitReveal

import io.codetail.animation.ViewAnimationUtils; //导入依赖的package包/类
private void exitReveal(final View icon, final View toolbar) {

        // get the center for the clipping circle
        int cx = getRelativeLeft(icon) + icon.getMeasuredWidth() / 2;
        int cy = getRelativeTop(icon);

        // get the initial radius for the clipping circle
        int initialRadius = Math.max(toolbar.getWidth(), toolbar.getHeight());

        // create the animation (the final radius is zero)
        Animator anim =
                ViewAnimationUtils.createCircularReveal(toolbar, cx, cy, initialRadius, 0);

        // make the view invisible when the animation is done
        anim.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                super.onAnimationEnd(animation);
                toolbar.setVisibility(View.INVISIBLE);
            }
        });

        anim.setDuration(Constant.SEARCH_REVEAL_DURATION);
        // start the animation
        anim.start();
    }
 
开发者ID:PacktPublishing,项目名称:Expert-Android-Programming,代码行数:27,代码来源:BrowseNearbyActivity.java

示例11: enterReveal

import io.codetail.animation.ViewAnimationUtils; //导入依赖的package包/类
void enterReveal(String type) {
    fab.setVisibility(View.GONE);
    final View myView = findViewById(R.id.reveal);
    int finalRadius = Math.max(myView.getWidth(), myView.getHeight());
    SupportAnimator anim =
            ViewAnimationUtils.createCircularReveal(myView, cx, cy, 0, finalRadius);
    if (type.equals("Reply")) {
        myView.setVisibility(View.VISIBLE);
        myView.findViewById(R.id.section_reply).setVisibility(View.VISIBLE);
        myView.findViewById(R.id.section_internal_note).setVisibility(View.GONE);
        overlay.setVisibility(View.VISIBLE);
    } else {
        myView.setVisibility(View.VISIBLE);
        myView.findViewById(R.id.section_reply).setVisibility(View.GONE);
        myView.findViewById(R.id.section_internal_note).setVisibility(View.VISIBLE);
        overlay.setVisibility(View.VISIBLE);
    }

    anim.start();
}
 
开发者ID:ladybirdweb,项目名称:faveo-helpdesk-android-app,代码行数:21,代码来源:TicketDetailActivity.java

示例12: onSingleTapUp

import io.codetail.animation.ViewAnimationUtils; //导入依赖的package包/类
@Override public boolean onSingleTapUp(MotionEvent e) {
  View nextView = getNext();
  nextView.bringToFront();
  nextView.setVisibility(View.VISIBLE);

  final float finalRadius =
      (float) Math.hypot(nextView.getWidth() / 2f, nextView.getHeight() / 2f) + hypo(
          nextView, e);

  Animator revealAnimator =
      ViewAnimationUtils.createCircularReveal(nextView, (int) e.getX(), (int) e.getY(), 0,
          finalRadius, View.LAYER_TYPE_HARDWARE);

  revealAnimator.setDuration(MainActivity.SLOW_DURATION);
  revealAnimator.setInterpolator(new FastOutLinearInInterpolator());
  revealAnimator.start();

  return true;
}
 
开发者ID:joelan,项目名称:CircleReveal,代码行数:20,代码来源:RadialTransformationActivity.java

示例13: unrevealView

import io.codetail.animation.ViewAnimationUtils; //导入依赖的package包/类
/**
 * Helps to unreveal a view.
 *
 * @param viewToUnreveal       View to unreveal.
 * @param duration             Duration.
 * @param animationEndCallBack Callback fired on animation end.
 */
static void unrevealView(final View viewToUnreveal, final int duration, final Runnable animationEndCallBack) {
    // - Determine circle location and size.
    int viewCenterX = (viewToUnreveal.getLeft() + viewToUnreveal.getRight()) / 2;
    int viewCenterY = (viewToUnreveal.getTop() + viewToUnreveal.getBottom()) / 2;
    int viewDiameterX = Math.max(viewCenterX, viewToUnreveal.getWidth() - viewCenterX);
    int viewDiameterY = Math.max(viewCenterY, viewToUnreveal.getHeight() - viewCenterY);
    float finalRadius = (float) Math.hypot(viewDiameterX, viewDiameterY);

    // - Prepare animation.
    final Animator circularRevealAnimator =
            ViewAnimationUtils.createCircularReveal(viewToUnreveal, viewCenterX, viewCenterY, finalRadius, 0);
    circularRevealAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
    circularRevealAnimator.setDuration(duration);
    circularRevealAnimator.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            viewToUnreveal.setVisibility(View.INVISIBLE);
            animationEndCallBack.run();
        }
    });

    // Let's reveal !
    circularRevealAnimator.start();
}
 
开发者ID:Jaouan,项目名称:Revealator,代码行数:32,代码来源:RevealatorHelper.java

示例14: revealOn

import io.codetail.animation.ViewAnimationUtils; //导入依赖的package包/类
private void revealOn() {
    if (binding.mapListContainer.getVisibility() == VISIBLE) return;

    View container = binding.mapListContainer;
    Animator animator = ViewAnimationUtils.createCircularReveal(
            container,
            getRevealCenterX(container),
            container.getTop(),
            0,
            (float) Math.hypot(container.getWidth(), container.getHeight()));
    animator.setInterpolator(INTERPOLATOR);
    animator.setDuration(getResources().getInteger(R.integer.view_reveal_mills));
    animator.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationStart(Animator animation) {
            binding.mapListContainer.setVisibility(VISIBLE);
            if (onVisibilityChangeListener != null) {
                onVisibilityChangeListener.onChange();
            }
        }
    });

    animator.start();
}
 
开发者ID:konifar,项目名称:droidkaigi2016,代码行数:25,代码来源:MapSearchView.java

示例15: revealOff

import io.codetail.animation.ViewAnimationUtils; //导入依赖的package包/类
public void revealOff() {
    if (binding.mapListContainer.getVisibility() != VISIBLE) return;

    View container = binding.mapListContainer;
    Animator animator = ViewAnimationUtils.createCircularReveal(
            container,
            getRevealCenterX(container),
            container.getTop(),
            (float) Math.hypot(container.getWidth(), container.getHeight()),
            0);
    animator.setInterpolator(INTERPOLATOR);
    animator.setDuration(getResources().getInteger(R.integer.view_reveal_mills));
    animator.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            binding.mapListContainer.setVisibility(INVISIBLE);
            if (onVisibilityChangeListener != null) {
                onVisibilityChangeListener.onChange();
            }
        }
    });

    animator.start();
}
 
开发者ID:konifar,项目名称:droidkaigi2016,代码行数:25,代码来源:MapSearchView.java


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