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


Java Animator.start方法代码示例

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


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

示例1: performCircularReveal

import android.animation.Animator; //导入方法依赖的package包/类
private void performCircularReveal(View show) {
    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,代码来源:ImageSharedTransitionActivity.java

示例2: reveal

import android.animation.Animator; //导入方法依赖的package包/类
public void reveal (float positionFromRight, int animationDuration) {
    View revealingView = circularRevealViewContainer.getChildAt(0);

    // start x-index for circular animation
    int cx = revealingView.getWidth() - (int) (positionFromRight);
    // start y-index for circular animation
    int cy = (revealingView.getTop() + revealingView.getBottom()) / 2;

    // calculate max radius
    int dx = Math.max(cx, revealingView.getWidth() - cx);
    int dy = Math.max(cy, revealingView.getHeight() - cy);
    float finalRadius = (float) Math.hypot(dx, dy);

    // Circular animation declaration begin
    final Animator animator;

    animator = io.codetail.animation.ViewAnimationUtils
            .createCircularReveal(revealingView, cx, cy, 0, finalRadius);
    animator.setInterpolator(new AccelerateDecelerateInterpolator());
    animator.setDuration(animationDuration);
    revealingView.setVisibility(View.VISIBLE);
    animator.start();
}
 
开发者ID:Ibrahim-GHub,项目名称:react-native-android-circular-reveal,代码行数:24,代码来源:CircularRevealLayout.java

示例3: show

import android.animation.Animator; //导入方法依赖的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: animateDragViewToOriginalPosition

import android.animation.Animator; //导入方法依赖的package包/类
private void animateDragViewToOriginalPosition() {
    if (mDragView != null) {
        Animator anim = new LauncherViewPropertyAnimator(mDragView)
                .translationX(0)
                .translationY(0)
                .scaleX(1)
                .scaleY(1)
                .setDuration(REORDERING_DROP_REPOSITION_DURATION);
        anim.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                onPostReorderingAnimationCompleted();
            }
        });
        anim.start();
    }
}
 
开发者ID:michelelacorte,项目名称:FlickLauncher,代码行数:18,代码来源:PagedView.java

示例5: doCircularReveal

import android.animation.Animator; //导入方法依赖的package包/类
private void doCircularReveal() {

        int centerX = (movieBackdrop.getLeft() + movieBackdrop.getRight()) / 2;
        int centerY = movieBackdrop.getTop();
        int startRadius = 0;
        int endRadius = Math.max(movieBackdrop.getWidth(), movieBackdrop.getHeight());

        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
            Animator animator = ViewAnimationUtils
                    .createCircularReveal(movieBackdrop, centerX, centerY, startRadius, endRadius);
            animator.setDuration(500);
            movieBackdrop.setVisibility(View.VISIBLE);
            animator.start();
        } else {
            movieBackdrop.setVisibility(View.VISIBLE);
        }
    }
 
开发者ID:prakh25,项目名称:MovieApp,代码行数:18,代码来源:MovieDetailFragment.java

示例6: exitReveal

import android.animation.Animator; //导入方法依赖的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,代码来源:HomeActivity.java

示例7: addIndicator

import android.animation.Animator; //导入方法依赖的package包/类
private void addIndicator(@DrawableRes int backgroundDrawableId, Animator animator) {
    if (animator.isRunning()) animator.end();

    View Indicator = new View(getContext());
    Indicator.setBackgroundResource(backgroundDrawableId);
    addView(Indicator, mIndicatorWidth, mIndicatorHeight);
    LayoutParams lp = (LayoutParams) Indicator.getLayoutParams();
    lp.leftMargin = mIndicatorMargin;
    lp.rightMargin = mIndicatorMargin;
    Indicator.setLayoutParams(lp);

    animator.setTarget(Indicator);
    animator.start();
}
 
开发者ID:mityung,项目名称:XERUNG,代码行数:15,代码来源:CircleIndicator.java

示例8: animateWindowInCircular

import android.animation.Animator; //导入方法依赖的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

示例9: animateButton

import android.animation.Animator; //导入方法依赖的package包/类
private void animateButton() {
    /* Circular reveal the button */
    int startRadius = 0;
    int finalRadius = Math.max(maskView.getHeight(), maskView.getWidth());
    final Animator anim = ViewAnimationUtils.createCircularReveal(maskView,
            maskView.getRight(),
            maskView.getHeight() / 2
            , startRadius, finalRadius);
    maskView.setVisibility(View.VISIBLE);
    anim.setInterpolator(new FastOutSlowInInterpolator());
    anim.setDuration(800);
    anim.start();

    // set the button text2+
    buttonText.setText(R.string.continue_btn_text);

    /* Animate the check image */
    ObjectAnimator rotationAnimator = ObjectAnimator.ofFloat(checkImage, "rotation", 0f, 360f);
    rotationAnimator.setDuration(400);
    rotationAnimator.setInterpolator(new FastOutSlowInInterpolator());

    int center = maskView.getRight() / 2;
    int right = maskView.getRight();
    int offSet = (right - center) / 2;
    ObjectAnimator translateXInterpolator = ObjectAnimator.ofFloat(checkImage, "x", offSet + 10f);
    translateXInterpolator.setDuration(400);
    translateXInterpolator.setInterpolator(new DecelerateInterpolator());

    AnimatorSet animatorSet = new AnimatorSet();
    animatorSet.playTogether(rotationAnimator, translateXInterpolator);
    animatorSet.start();

    // for second time
    count++;
}
 
开发者ID:rumaan,项目名称:AcademApp,代码行数:36,代码来源:UserDetailsActivity.java

示例10: hideCircularReveal

import android.animation.Animator; //导入方法依赖的package包/类
public static void hideCircularReveal(final Context context,
                                      final View view,
                                      final RevealAnimationSetting revealSettings,
                                      final int startColor,
                                      final int endColor,
                                      final Dismissible.OnDismissedListener listener) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        int cx = revealSettings.getCenterX();
        int cy = revealSettings.getCenterY();
        int width = revealSettings.getWidth();
        int height = revealSettings.getHeight();
        int duration =
                context.getResources().getInteger(android.R.integer.config_mediumAnimTime);

        float initRadius = (float) Math.sqrt(width * width + height * height);
        Animator anim = ViewAnimationUtils.createCircularReveal(view, cx, cy, initRadius, 0);
        anim.setDuration(duration);
        anim.setInterpolator(new FastOutSlowInInterpolator());
        anim.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                view.setVisibility(View.GONE);
                listener.onDismissed();
            }
        });
        anim.start();
        recolorBackground(view, startColor, endColor, duration);
    } else {
        listener.onDismissed();
    }
}
 
开发者ID:interactiveservices,项目名称:utils-android,代码行数:32,代码来源:AnimUtils.java

示例11: animateAppear

import android.animation.Animator; //导入方法依赖的package包/类
private void animateAppear() {
    final Animator appearAnimator = animatorFactory.createAppearAnimator(presentView);
    appearAnimator.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            sharePickerView.setVisibility(GONE);
        }
    });
    appearAnimator.start();
}
 
开发者ID:roshakorost,项目名称:Phial,代码行数:11,代码来源:ShareView.java

示例12: revealActivity

import android.animation.Animator; //导入方法依赖的package包/类
private void revealActivity(View revealView, int startCenterX, int startCenterY) {
    int endCenterX = revealView.getWidth() / 2;
    int endCenterY = revealView.getHeight() / 2;
    float startRadius = 0;
    float finalRadius = Math.max(revealView.getWidth(), revealView.getHeight()) * 1.1f;
    Animator circularReveal = ViewAnimationCompatUtils.createCircularReveal(revealView, startCenterX, startCenterY, startRadius, endCenterX, endCenterY, finalRadius);
    circularReveal.setDuration(500);
    circularReveal.setInterpolator(new AccelerateInterpolator());
    revealView.setVisibility(View.VISIBLE);
    circularReveal.start();
}
 
开发者ID:yangwencan2002,项目名称:CircularRevealCompat,代码行数:12,代码来源:SecondActivity.java

示例13: start

import android.animation.Animator; //导入方法依赖的package包/类
@Override
public void start() {
    Animator a = mAnimator.get();
    if(a != null) {
        a.start();
    }
}
 
开发者ID:aliumujib,项目名称:Nibo,代码行数:8,代码来源:SupportAnimatorPreL.java

示例14: startSelectedViewInAnimation

import android.animation.Animator; //导入方法依赖的package包/类
private void startSelectedViewInAnimation() {
    Animator animator = mSelectionInAnimator;
    animator.setTarget(mSelectorHolder.itemView);
    animator.addListener(new AbstractAnimatorListener() {
        @Override
        public void onAnimationEnd(Animator animation) {
            super.onAnimationEnd(animation);
            updateCategoriesOffsetBySelector();
        }
    });
    animator.start();
}
 
开发者ID:sinhaDroid,项目名称:BlogBookApp,代码行数:13,代码来源:HorizontalLoopBarView.java

示例15: revealEffect

import android.animation.Animator; //导入方法依赖的package包/类
void revealEffect(View v) {
    if(Build.VERSION.SDK_INT > 20) {
        int cx = v.getMeasuredWidth()/2;
        int cy = v.getMeasuredHeight()/2;
        int finalRadius = Math.max(v.getWidth(),v.getHeight());
        Animator a = ViewAnimationUtils.createCircularReveal(v,cx,cy,0,finalRadius);
        a.setDuration(1000);
        v.setVisibility(View.VISIBLE);
        a.start();
    }
}
 
开发者ID:NullPointersInc,项目名称:Bella-Android,代码行数:12,代码来源:StatusActivity.java


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