當前位置: 首頁>>代碼示例>>Java>>正文


Java AnimUtils類代碼示例

本文整理匯總了Java中io.plaidapp.util.AnimUtils的典型用法代碼示例。如果您正苦於以下問題:Java AnimUtils類的具體用法?Java AnimUtils怎麽用?Java AnimUtils使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


AnimUtils類屬於io.plaidapp.util包,在下文中一共展示了AnimUtils類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onBackPressed

import io.plaidapp.util.AnimUtils; //導入依賴的package包/類
@Override
public void onBackPressed() {
    if (isShareIntent()) {
        bottomSheetContent.animate()
                .translationY(bottomSheetContent.getHeight())
                .setDuration(160L)
                .setInterpolator(AnimUtils.getFastOutLinearInInterpolator
                        (PostNewDesignerNewsStory.this))
                .setListener(new AnimatorListenerAdapter() {
                    @Override
                    public void onAnimationEnd(Animator animation) {
                        finishAfterTransition();
                    }
                });
    } else {
        super.onBackPressed();
    }
}
 
開發者ID:liulinbo,項目名稱:Amumu,代碼行數:19,代碼來源:PostNewDesignerNewsStory.java

示例2: animateToolbar

import io.plaidapp.util.AnimUtils; //導入依賴的package包/類
private void animateToolbar() {
    // this is gross but toolbar doesn't expose it's children to animate them :(
    View t = toolbar.getChildAt(0);
    if (t != null && t instanceof TextView) {
        TextView title = (TextView) t;

        // fade in and space out the title.  Animating the letterSpacing performs horribly so
        // fake it by setting the desired letterSpacing then animating the scaleX ¯\_(ツ)_/¯
        title.setAlpha(0f);
        title.setScaleX(0.8f);

        title.animate()
                .alpha(1f)
                .scaleX(1f)
                .setStartDelay(300)
                .setDuration(900)
                .setInterpolator(AnimUtils.getFastOutSlowInInterpolator(this));
    }
    View amv = toolbar.getChildAt(1);
    if (amv != null & amv instanceof ActionMenuView) {
        ActionMenuView actions = (ActionMenuView) amv;
        popAnim(actions.getChildAt(0), 500, 200); // filter
        popAnim(actions.getChildAt(1), 700, 200); // overflow
    }
}
 
開發者ID:liulinbo,項目名稱:Amumu,代碼行數:26,代碼來源:HomeActivity.java

示例3: onStopNestedScroll

import io.plaidapp.util.AnimUtils; //導入依賴的package包/類
@Override
public void onStopNestedScroll(View child) {
    if (Math.abs(totalDrag) >= dragDismissDistance) {
        dispatchDismissCallback();
    } else { // settle back to natural position
        animate()
                .translationY(0f)
                .scaleX(1f)
                .scaleY(1f)
                .setDuration(200L)
                .setInterpolator(AnimUtils.getFastOutSlowInInterpolator(getContext()))
                .setListener(null)
                .start();
        totalDrag = 0;
        draggingDown = draggingUp = false;
        dispatchDragCallback(0f, 0f, 0f, 0f);
    }
}
 
開發者ID:liulinbo,項目名稱:Amumu,代碼行數:19,代碼來源:ElasticDragDismissFrameLayout.java

示例4: dismiss

import io.plaidapp.util.AnimUtils; //導入依賴的package包/類
@OnClick(R.id.bottom_sheet)
protected void dismiss() {
    if (!hasSharedElementTransition()) {
        bottomSheetContent.animate()
                .translationY(bottomSheetContent.getHeight())
                .setDuration(160L)
                .setInterpolator(AnimUtils.getFastOutLinearInInterpolator
                        (PostNewDesignerNewsStory.this))
                .setListener(new AnimatorListenerAdapter() {
                    @Override
                    public void onAnimationEnd(Animator animation) {
                        finish();
                    }
                });
    } else {
        finishAfterTransition();
    }
}
 
開發者ID:yongjhih,項目名稱:android-proguards,代碼行數:19,代碼來源:PostNewDesignerNewsStory.java

示例5: revealPostingProgress

import io.plaidapp.util.AnimUtils; //導入依賴的package包/類
void revealPostingProgress() {
    Animator reveal = ViewAnimationUtils.createCircularReveal(fabPosting,
            (int) fabPosting.getPivotX(),
            (int) fabPosting.getPivotY(),
            0f,
            fabPosting.getWidth() / 2)
            .setDuration(600L);
    reveal.setInterpolator(AnimUtils.getFastOutLinearInInterpolator(this));
    reveal.start();
    AnimatedVectorDrawable uploading =
            (AnimatedVectorDrawable) getDrawable(R.drawable.avd_uploading);
    if (uploading != null) {
        fabPosting.setImageDrawable(uploading);
        uploading.start();
    }
}
 
開發者ID:yongjhih,項目名稱:android-proguards,代碼行數:17,代碼來源:HomeActivity.java

示例6: animateToolbar

import io.plaidapp.util.AnimUtils; //導入依賴的package包/類
private void animateToolbar() {
    // this is gross but toolbar doesn't expose it's children to animate them :(
    View t = toolbar.getChildAt(0);
    if (t != null && t instanceof TextView) {
        TextView title = (TextView) t;

        // fade in and space out the title.  Animating the letterSpacing performs horribly so
        // fake it by setting the desired letterSpacing then animating the scaleX ¯\_(ツ)_/¯
        title.setAlpha(0f);
        title.setScaleX(0.8f);

        title.animate()
                .alpha(1f)
                .scaleX(1f)
                .setStartDelay(300)
                .setDuration(900)
                .setInterpolator(AnimUtils.getFastOutSlowInInterpolator(this));
    }
}
 
開發者ID:yongjhih,項目名稱:android-proguards,代碼行數:20,代碼來源:HomeActivity.java

示例7: MaskMorphDrawable

import io.plaidapp.util.AnimUtils; //導入依賴的package包/類
MaskMorphDrawable(Context context, TextPaint textPaint,
                  int baseline, float charWidth, int insetStart) {
    this.insetStart = insetStart;
    this.baseline = baseline;
    this.charWidth = charWidth;
    paint = new TextPaint(textPaint);
    Rect maskBounds = new Rect();
    paint.getTextBounds(PASSWORD_MASK, 0, 1, maskBounds);
    maskDiameter = maskBounds.height();
    maskCenterY = (maskBounds.top + maskBounds.bottom) / 2f;
    showPasswordDuration =
            context.getResources().getInteger(R.integer.show_password_duration);
    hidePasswordDuration =
            context.getResources().getInteger(R.integer.hide_password_duration);
    fastOutSlowIn = AnimUtils.getFastOutSlowInInterpolator(context);
}
 
開發者ID:yongjhih,項目名稱:android-proguards,代碼行數:17,代碼來源:PasswordEntry.java

示例8: getSettleInterpolator

import io.plaidapp.util.AnimUtils; //導入依賴的package包/類
/**
 * Provides the appropriate interpolator for the settle animation depending upon:
 * – If dismissing then exit at full speed i.e. linearly otherwise decelerate
 * – If have initial velocity then respect it (i.e. start linearly) otherwise accelerate into
 *   the animation.
 */
private TimeInterpolator getSettleInterpolator(boolean dismissing, float initialVelocity) {
    if (initialVelocity != 0) {
        if (dismissing) {
            return AnimUtils.getLinearInterpolator();
        } else {
            return AnimUtils.getLinearOutSlowInInterpolator(getContext());
        }
    } else {
        if (dismissing) {
            return AnimUtils.getFastOutLinearInInterpolator(getContext());
        } else {
            return AnimUtils.getFastOutSlowInInterpolator(getContext());
        }
    }
}
 
開發者ID:yongjhih,項目名稱:android-proguards,代碼行數:22,代碼來源:BottomSheet.java

示例9: onAppear

import io.plaidapp.util.AnimUtils; //導入依賴的package包/類
@Override
public Animator onAppear(ViewGroup sceneRoot, View view, TransitionValues startValues,
                         TransitionValues endValues) {
    return new AnimUtils.NoPauseAnimator(ObjectAnimator.ofPropertyValuesHolder(
            endValues.view,
            PropertyValuesHolder.ofFloat(View.ALPHA, 0f, 1f),
            PropertyValuesHolder.ofFloat(View.SCALE_X, 0f, 1f),
            PropertyValuesHolder.ofFloat(View.SCALE_Y, 0f, 1f)));
}
 
開發者ID:liulinbo,項目名稱:Amumu,代碼行數:10,代碼來源:Pop.java

示例10: onDisappear

import io.plaidapp.util.AnimUtils; //導入依賴的package包/類
@Override
public Animator onDisappear(ViewGroup sceneRoot, View view, TransitionValues startValues,
                            TransitionValues endValues) {
    return new AnimUtils.NoPauseAnimator(ObjectAnimator.ofPropertyValuesHolder(
            endValues.view,
            PropertyValuesHolder.ofFloat(View.ALPHA, 1f, 0f),
            PropertyValuesHolder.ofFloat(View.SCALE_X, 1f, 0f),
            PropertyValuesHolder.ofFloat(View.SCALE_Y, 1f, 0f)));
}
 
開發者ID:liulinbo,項目名稱:Amumu,代碼行數:10,代碼來源:Pop.java

示例11: hideSaveConfimation

import io.plaidapp.util.AnimUtils; //導入依賴的package包/類
@OnClick(R.id.results_scrim)
protected void hideSaveConfimation() {
    if (confirmSaveContainer.getVisibility() == View.VISIBLE) {
        // contract the bubble & hide the scrim
        AnimatorSet hideConfirmation = new AnimatorSet();
        hideConfirmation.playTogether(
                ViewAnimationUtils.createCircularReveal(confirmSaveContainer,
                        confirmSaveContainer.getWidth() / 2,
                        confirmSaveContainer.getHeight() / 2,
                        confirmSaveContainer.getWidth() / 2,
                        fab.getWidth() / 2),
                ObjectAnimator.ofArgb(resultsScrim,
                        ViewUtils.BACKGROUND_COLOR,
                        Color.TRANSPARENT));
        hideConfirmation.setDuration(150L);
        hideConfirmation.setInterpolator(AnimUtils.getFastOutSlowInInterpolator
                (SearchActivity.this));
        hideConfirmation.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                confirmSaveContainer.setVisibility(View.GONE);
                resultsScrim.setVisibility(View.GONE);
                fab.setVisibility(results.getVisibility());
            }
        });
        hideConfirmation.start();
    }
}
 
開發者ID:liulinbo,項目名稱:Amumu,代碼行數:29,代碼來源:SearchActivity.java

示例12: revealPostingProgress

import io.plaidapp.util.AnimUtils; //導入依賴的package包/類
private void revealPostingProgress() {
    Animator reveal = ViewAnimationUtils.createCircularReveal(fabPosting,
            (int) fabPosting.getPivotX(),
            (int) fabPosting.getPivotY(),
            0f,
            fabPosting.getWidth() / 2)
            .setDuration(600L);
    reveal.setInterpolator(AnimUtils.getFastOutLinearInInterpolator(this));
    reveal.start();
    AnimatedVectorDrawable uploading =
            (AnimatedVectorDrawable) getDrawable(R.drawable.avd_uploading);
    fabPosting.setImageDrawable(uploading);
    uploading.start();
}
 
開發者ID:liulinbo,項目名稱:Amumu,代碼行數:15,代碼來源:HomeActivity.java

示例13: showFab

import io.plaidapp.util.AnimUtils; //導入依賴的package包/類
private void showFab() {
    fab.setAlpha(0f);
    fab.setScaleX(0f);
    fab.setScaleY(0f);
    fab.setTranslationY(fab.getHeight() / 2);
    fab.animate()
            .alpha(1f)
            .scaleX(1f)
            .scaleY(1f)
            .translationY(0f)
            .setDuration(300L)
            .setInterpolator(AnimUtils.getLinearOutSlowInInterpolator(this))
            .start();
}
 
開發者ID:liulinbo,項目名稱:Amumu,代碼行數:15,代碼來源:HomeActivity.java

示例14: InkPageIndicator

import io.plaidapp.util.AnimUtils; //導入依賴的package包/類
public InkPageIndicator(Context context, AttributeSet attrs, int defStyle) {
    super(context, attrs, defStyle);

    final int density = (int) context.getResources().getDisplayMetrics().density;

    // Load attributes
    final TypedArray a = getContext().obtainStyledAttributes(
            attrs, R.styleable.InkPageIndicator, defStyle, 0);

    dotDiameter = a.getDimensionPixelSize(R.styleable.InkPageIndicator_dotDiameter,
            DEFAULT_DOT_SIZE * density);
    dotRadius = dotDiameter / 2;
    halfDotRadius = dotRadius / 2;
    gap = a.getDimensionPixelSize(R.styleable.InkPageIndicator_dotGap,
            DEFAULT_GAP * density);
    animDuration = (long) a.getInteger(R.styleable.InkPageIndicator_animationDuration,
            DEFAULT_ANIM_DURATION);
    animHalfDuration = animDuration / 2;
    unselectedColour = a.getColor( R.styleable.InkPageIndicator_pageIndicatorColor,
            DEFAULT_UNSELECTED_COLOUR);
    selectedColour = a.getColor( R.styleable.InkPageIndicator_currentPageIndicatorColor,
            DEFAULT_SELECTED_COLOUR);

    a.recycle();

    unselectedPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    unselectedPaint.setColor(unselectedColour);
    selectedPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
    selectedPaint.setColor(selectedColour);
    interpolator = AnimUtils.getFastOutSlowInInterpolator(context);

    // create paths & rect now – reuse & rewind later
    combinedUnselectedPath = new Path();
    unselectedDotPath = new Path();
    unselectedDotLeftPath = new Path();
    unselectedDotRightPath = new Path();
    rectF = new RectF();

    addOnAttachStateChangeListener(this);
}
 
開發者ID:liulinbo,項目名稱:Amumu,代碼行數:41,代碼來源:InkPageIndicator.java

示例15: onAppear

import io.plaidapp.util.AnimUtils; //導入依賴的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 AnimUtils.NoPauseAnimator(ViewAnimationUtils.createCircularReveal(
            view,
            center.x,
            center.y,
            startRadius,
            getFullyRevealedRadius(view)));
}
 
開發者ID:yongjhih,項目名稱:android-proguards,代碼行數:14,代碼來源:CircularReveal.java


注:本文中的io.plaidapp.util.AnimUtils類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。