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


Java ViewAnimationUtils.createCircularReveal方法代码示例

本文整理汇总了Java中android.view.ViewAnimationUtils.createCircularReveal方法的典型用法代码示例。如果您正苦于以下问题:Java ViewAnimationUtils.createCircularReveal方法的具体用法?Java ViewAnimationUtils.createCircularReveal怎么用?Java ViewAnimationUtils.createCircularReveal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.view.ViewAnimationUtils的用法示例。


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

示例1: doCircularExitAnimation

import android.view.ViewAnimationUtils; //导入方法依赖的package包/类
/**
 * Circular reveal exit animation
 */
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void doCircularExitAnimation() {
    final int revealRadius = (int) Math.hypot(getWidth(), getHeight());
    Animator exitAnimator = ViewAnimationUtils.createCircularReveal(this,
            mCenterX, mCenterY, revealRadius, 0f);
    exitAnimator.setDuration(mAnimationDuration);
    exitAnimator.setInterpolator(AnimationUtils.loadInterpolator(mActivity,
            android.R.interpolator.decelerate_cubic));
    exitAnimator.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            removeView();
            if (mAnimationListener != null) {
                mAnimationListener.onExitAnimationEnd();
            }
        }
    });
    exitAnimator.start();


}
 
开发者ID:faruktoptas,项目名称:FancyShowCaseView,代码行数:25,代码来源:FancyShowCaseView.java

示例2: hideEditText

import android.view.ViewAnimationUtils; //导入方法依赖的package包/类
private void hideEditText(final LinearLayout view) {

    int cx = view.getRight() - 30;
    int cy = view.getBottom() - 60;
    int initialRadius = view.getWidth();
    Animator anim = ViewAnimationUtils.createCircularReveal(view, cx, cy, initialRadius, 0);
    anim.addListener(new AnimatorListenerAdapter() {
      @Override
      public void onAnimationEnd(Animator animation) {
        super.onAnimationEnd(animation);
        view.setVisibility(View.INVISIBLE);
      }
    });
    isEditTextVisible = false;
    anim.start();
  }
 
开发者ID:anwarcse12028,项目名称:Traveler-List,代码行数:17,代码来源:DetailActivity.java

示例3: show

import android.view.ViewAnimationUtils; //导入方法依赖的package包/类
/**
 * 向四周伸张,直到完成显示。
 */
@SuppressLint("NewApi")
public static void show(View myView, float startRadius, long durationMills) {
    if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.LOLLIPOP) {
        myView.setVisibility(View.VISIBLE);
        return;
    }

    int cx = (myView.getLeft() + myView.getRight()) / 2;
    int cy = (myView.getTop() + myView.getBottom()) / 2;

    int w = myView.getWidth();
    int h = myView.getHeight();

    // 勾股定理 & 进一法
    int finalRadius = (int) Math.sqrt(w * w + h * h) + 1;

    Animator anim =
            ViewAnimationUtils.createCircularReveal(myView, cx, cy, startRadius, finalRadius);
    myView.setVisibility(View.VISIBLE);
    anim.setDuration(durationMills);
    anim.start();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:26,代码来源:CircularAnimUtil.java

示例4: performCircularReveal

import android.view.ViewAnimationUtils; //导入方法依赖的package包/类
private void performCircularReveal() {
    show.setBackgroundColor(0xffff0000);
    ViewCompat.setTranslationY(show, 0);
    ViewCompat.setTranslationX(show, 0);
    show.getLayoutParams().height = 500;
    show.getLayoutParams().width = 1920;
    show.requestLayout();
    int centerX = (show.getLeft() + show.getRight()) / 2;
    int centerY = (show.getTop() + show.getBottom()) / 2;
    float finalRadius = (float) Math.hypot((double) centerX, (double) centerY);
    Animator mCircularReveal = ViewAnimationUtils.createCircularReveal(
            show, centerX, centerY, 0, finalRadius);
    mCircularReveal.setInterpolator(new AccelerateDecelerateInterpolator());
    mCircularReveal.setDuration(500);
    mCircularReveal.start();
}
 
开发者ID:teisun,项目名称:SunmiUI,代码行数:17,代码来源:CustomSharedTransitionActivity.java

示例5: reveal

import android.view.ViewAnimationUtils; //导入方法依赖的package包/类
/**
 * Create the reveal effect animation
 * @param view the View to reveal
 * @param cx coordinate X
 * @param cy coordinate Y
 */
@TargetApi(VERSION_CODES.LOLLIPOP)
public static void reveal(final View view, int cx, int cy) {
	if (!hasLollipop()) {
		view.setVisibility(View.VISIBLE);
		return;
	}

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

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

	//Make the view visible and start the animation
	view.setVisibility(View.VISIBLE);
	animator.start();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:25,代码来源:Utils.java

示例6: circularRevealActivity

import android.view.ViewAnimationUtils; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void circularRevealActivity() {

    int cx = (rootLayout.getLeft() + rootLayout.getRight()) - getResources().getDimensionPixelSize(R.dimen.margin_xxxhigh);
    int cy = (rootLayout.getTop() + rootLayout.getBottom()) - getResources().getDimensionPixelSize(R.dimen.margin_xxxhigh);

    int finalRadius = (int) Math.hypot(rootLayout.getRight(), rootLayout.getBottom());
    int initialRadius = getResources().getDimensionPixelSize(R.dimen.margin_xxhigh);
    // create the animator for this view (the start radius is zero)
    Animator circularReveal = ViewAnimationUtils.createCircularReveal(rootLayout, cx, cy, initialRadius, finalRadius);
    circularReveal.setDuration(600);

    // make the view visible and start the animation
    rootLayout.setVisibility(View.VISIBLE);
    circularReveal.start();
}
 
开发者ID:hypertrack,项目名称:hypertrack-live-android,代码行数:17,代码来源:Home.java

示例7: createAnimator

import android.view.ViewAnimationUtils; //导入方法依赖的package包/类
private Animator createAnimator(View targetView, boolean isAppearing) {
    final int[] relativeLocation = getRelativeLocation(targetView);
    final int width = targetView.getWidth();
    final int height = targetView.getHeight();

    final int relX = relativeLocation[0];
    final int relY = relativeLocation[1];
    int dx = Math.max(relX, width - relX);
    int dy = Math.max(relY, height - relY);
    int radius = calcRadius(dx, dy);

    return ViewAnimationUtils.createCircularReveal(
            targetView,
            relX,
            relY,
            isAppearing ? startRadius : radius,
            isAppearing ? radius : startRadius
    );
}
 
开发者ID:roshakorost,项目名称:Phial,代码行数:20,代码来源:AnimatorFactory.java

示例8: hide

import android.view.ViewAnimationUtils; //导入方法依赖的package包/类
/**
 * 由满向中间收缩,直到隐藏。
 */
@SuppressLint("NewApi")
public static void hide(final View myView, float endRadius, long durationMills) {
    if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.LOLLIPOP) {
        myView.setVisibility(View.INVISIBLE);
        return;
    }

    int cx = (myView.getLeft() + myView.getRight()) / 2;
    int cy = (myView.getTop() + myView.getBottom()) / 2;
    int w = myView.getWidth();
    int h = myView.getHeight();

    // 勾股定理 & 进一法
    int initialRadius = (int) Math.sqrt(w * w + h * h) + 1;

    Animator anim =
            ViewAnimationUtils.createCircularReveal(myView, cx, cy, initialRadius, endRadius);
    anim.setDuration(durationMills);
    anim.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            super.onAnimationEnd(animation);
            myView.setVisibility(View.INVISIBLE);
        }
    });

    anim.start();
}
 
开发者ID:InnoFang,项目名称:FamilyBond,代码行数:32,代码来源:CircularAnimUtils.java

示例9: getCircularHideAnimtion

import android.view.ViewAnimationUtils; //导入方法依赖的package包/类
@NonNull
public static Animator getCircularHideAnimtion(@NonNull View view) {
    int cx = view.getWidth() / 2;
    int cy = view.getHeight() / 2;
    int finalRadius = (int) Math.hypot(view.getWidth(), view.getHeight());
    Animator animation = ViewAnimationUtils.createCircularReveal(view, cx, cy, 0, finalRadius);
    animation.setDuration(500);
    return animation;
}
 
开发者ID:RajneeshSingh007,项目名称:MusicX-music-player,代码行数:10,代码来源:Helper.java

示例10: createAnimator

import android.view.ViewAnimationUtils; //导入方法依赖的package包/类
private Animator createAnimator(View view, float startRadius, float endRadius) {
    int centerX = view.getWidth() / 2;
    int centerY = view.getHeight() / 2;

    Animator reveal = ViewAnimationUtils.createCircularReveal(view, centerX, centerY,
            startRadius, endRadius);
    return new NoPauseAnimator(reveal);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:RevealVisibilityTransition.java

示例11: animateWindowInCircular

import android.view.ViewAnimationUtils; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void animateWindowInCircular(@Nullable View anchor, @NonNull View contentView) {
  Pair<Integer, Integer> coordinates = getClickOrigin(anchor, contentView);
  Animator animator = ViewAnimationUtils.createCircularReveal(contentView,
                                                              coordinates.first,
                                                              coordinates.second,
                                                              0,
                                                              Math.max(contentView.getWidth(), contentView.getHeight()));
  animator.setDuration(ANIMATION_DURATION);
  animator.start();
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:12,代码来源:AttachmentTypeSelector.java

示例12: unReveal

import android.view.ViewAnimationUtils; //导入方法依赖的package包/类
/**
 * Create the un-reveal effect animation
 * @param view the View to hide
 * @param cx coordinate X
 * @param cy coordinate Y
 */
@TargetApi(VERSION_CODES.LOLLIPOP)
public static void unReveal(final View view, int cx, int cy) {
	if (!hasLollipop()) {
		view.setVisibility(View.GONE);
		return;
	}

	//Get the initial radius for the clipping circle
	int initialRadius = view.getWidth();

	//Create the animation (the final radius is zero)
	Animator animator =
		ViewAnimationUtils.createCircularReveal(view, cx, cy, initialRadius, 0);

	//Make the view invisible when the animation is done
	animator.addListener(new AnimatorListenerAdapter() {
		@Override
		public void onAnimationEnd(Animator animation) {
			super.onAnimationEnd(animation);
			view.setVisibility(View.GONE);
		}
	});

	//Start the animation
	animator.start();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:33,代码来源:Utils.java

示例13: onAppear

import android.view.ViewAnimationUtils; //导入方法依赖的package包/类
@Override
public Animator onAppear(ViewGroup sceneRoot, View view,
                         TransitionValues startValues,
                         TransitionValues endValues) {
    if (view == null || view.getHeight() == 0 || view.getWidth() == 0) return null;
    ensureCenterPoint(sceneRoot, view);
    return new PauseLessAnimator(ViewAnimationUtils.createCircularReveal(
            view,
            center.x,
            center.y,
            startRadius,
            getFullyRevealedRadius(view)));
}
 
开发者ID:vpaliyX,项目名称:Melophile,代码行数:14,代码来源:CircularReveal.java

示例14: createCircularReveal

import android.view.ViewAnimationUtils; //导入方法依赖的package包/类
private Animator createCircularReveal(View view, float startRadius, float endRadius) {
    int centerX = view.getWidth() / 2;
    int centerY = view.getHeight() / 2;

    Animator reveal = ViewAnimationUtils.createCircularReveal(view, centerX, centerY,
            startRadius, endRadius);
    return new NoPauseAnimator(reveal);
}
 
开发者ID:Vinetos,项目名称:Hello-Music-droid,代码行数:9,代码来源:PlayTransition.java

示例15: onAppear

import android.view.ViewAnimationUtils; //导入方法依赖的package包/类
@Override
public Animator onAppear(ViewGroup sceneRoot, View view, TransitionValues startValues, TransitionValues endValues) {
    Animator animator = ViewAnimationUtils.createCircularReveal(view, mEpicenter.x, mEpicenter.y,
            mSmallRadius, mBigRadius);
    animator.setDuration(mDuration);
    return new PauseableAnimator(animator);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:RevealTransition.java


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