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


Java AccelerateInterpolator類代碼示例

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


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

示例1: initValues

import android.view.animation.AccelerateInterpolator; //導入依賴的package包/類
private void initValues(Context context, boolean editMode) {
  Resources res = context.getResources();
  mInterpolator = new AccelerateInterpolator();
  if (!editMode) {
    mSectionsCount = res.getInteger(R.integer.spb_default_sections_count);
    mSpeed = Float.parseFloat(res.getString(R.string.spb_default_speed));
    mReversed = res.getBoolean(R.bool.spb_default_reversed);
    mProgressiveStartActivated = res.getBoolean(R.bool.spb_default_progressiveStart_activated);
    mColors = new int[]{res.getColor(R.color.spb_default_color)};
    mStrokeSeparatorLength = res.getDimensionPixelSize(R.dimen.spb_default_stroke_separator_length);
    mStrokeWidth = res.getDimensionPixelOffset(R.dimen.spb_default_stroke_width);
  } else {
    mSectionsCount = 4;
    mSpeed = 1f;
    mReversed = false;
    mProgressiveStartActivated = false;
    mColors = new int[]{0xff33b5e5};
    mStrokeSeparatorLength = 4;
    mStrokeWidth = 4;
  }
  mProgressiveStartSpeed = mSpeed;
  mProgressiveStopSpeed = mSpeed;
  mGradients = false;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:25,代碼來源:SmoothProgressDrawable.java

示例2: hideSystemUI

import android.view.animation.AccelerateInterpolator; //導入依賴的package包/類
private void hideSystemUI() {
    runOnUiThread(new Runnable() {
        public void run() {
            toolbar.animate().translationY(-toolbar.getHeight()).setInterpolator(new AccelerateInterpolator())
                    .setDuration(200).start();
            getWindow().getDecorView().setSystemUiVisibility(
                    View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                            | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
                            | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                            | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
                            | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
                            | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
                            | View.SYSTEM_UI_FLAG_IMMERSIVE);

            fullScreenMode = true;
            changeBackGroundColor();
        }
    });
}
 
開發者ID:wuhighway,項目名稱:DailyStudy,代碼行數:20,代碼來源:ScanImageviewActivity.java

示例3: bounceAnimateView

import android.view.animation.AccelerateInterpolator; //導入依賴的package包/類
private void bounceAnimateView(final View view) {
    if (view == null) {
        return;
    }

    ValueAnimator swing = ValueAnimator.ofFloat(0, 60, -40, 0);
    swing.setDuration(400);
    swing.setInterpolator(new AccelerateInterpolator());
    swing.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            view.setRotationX((float)animation.getAnimatedValue());
        }
    });
    swing.start();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:17,代碼來源:FlyRefreshStyleActivity.java

示例4: onTouchDown

import android.view.animation.AccelerateInterpolator; //導入依賴的package包/類
@Override
public void onTouchDown() {
    if (mAnim != null) {
        mAnim.cancel();
    }
    if (mViewtoToggle.getAlpha() == 1f) {
        mIgnoreNextTap = true;
    }

    mAnim = mViewtoToggle.animate();
    mAnim.alpha(0f)
            .setDuration(150)
            .withEndAction(new Runnable() {
                public void run() {
                    mViewtoToggle.setVisibility(View.INVISIBLE);
                }
            });

    mAnim.setInterpolator(new AccelerateInterpolator(0.75f));
    mAnim.start();
}
 
開發者ID:michelelacorte,項目名稱:FlickLauncher,代碼行數:22,代碼來源:ToggleOnTapCallback.java

示例5: toggleToolbar

import android.view.animation.AccelerateInterpolator; //導入依賴的package包/類
public void toggleToolbar(boolean show) {
    if (show==showToolbar || toolbarGroup==null) {
        return;
    }

    showToolbar=show;
    if (showToolbar) {
        startTimeOut();
        showSystemUI();
        toolbarGroup.animate().translationY(0).setInterpolator(new DecelerateInterpolator()).start();
    } else {
        if (timeoutSubscription!=null) {
            timeoutSubscription.unsubscribe();
        }
        toolbarGroup.animate().translationY(-toolbarGroup.getBottom()).setInterpolator(new AccelerateInterpolator()).start();
        hideSystemUI();
    }
}
 
開發者ID:garretyoder,項目名稱:Cluttr,代碼行數:19,代碼來源:ViewActivity.java

示例6: hideInstructionList

import android.view.animation.AccelerateInterpolator; //導入依賴的package包/類
/**
 * Hide the instruction list and show the sound button.
 * <p>
 * This is based on orientation so the different layouts (for portrait vs. landscape)
 * can be animated appropriately.
 */
public void hideInstructionList() {
  int orientation = getContext().getResources().getConfiguration().orientation;
  if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
    ConstraintSet collapsed = new ConstraintSet();
    collapsed.clone(getContext(), R.layout.instruction_layout);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
      TransitionManager.beginDelayedTransition(InstructionView.this);
    }
    collapsed.applyTo(instructionLayout);
    instructionListLayout.setVisibility(INVISIBLE);
  } else {
    Animation slideUp = AnimationUtils.loadAnimation(getContext(), R.anim.slide_up_top);
    slideUp.setInterpolator(new AccelerateInterpolator());
    instructionListLayout.startAnimation(slideUp);
    instructionListLayout.setVisibility(INVISIBLE);
  }
}
 
開發者ID:mapbox,項目名稱:mapbox-navigation-android,代碼行數:24,代碼來源:InstructionView.java

示例7: initView

import android.view.animation.AccelerateInterpolator; //導入依賴的package包/類
private void initView()
{
    mListImgView = new ArrayList<>();
    titleTexts = new ArrayList<>();

    mInflater = LayoutInflater.from(mContext);
    View view = mInflater.inflate(R.layout.view_slider_layout , this);
    mDotLayout = (LinearLayout) view.findViewById(R.id.ll_dot_group);
    mTitleTV = (TextView) view.findViewById(R.id.tv_img_desc);
    mViewPager = (ViewPager) view.findViewById(R.id.viewPager);
    mViewPager.setPageTransformer(true , new DepthPageTransformer());
    mViewPager.setOnPageChangeListener(this);

    try
    {
        Field mField = ViewPager.class.getDeclaredField("mScroller");
        mField.setAccessible(true);
        mScroller = new FixedSpeedScroller(mContext ,new AccelerateInterpolator());
        mField.set(mViewPager , mScroller);
    }
    catch (Exception e)
    {
        e.printStackTrace();
    }
}
 
開發者ID:z13538657403,項目名稱:SliderImageLayout,代碼行數:26,代碼來源:SliderImageLayout.java

示例8: createCollapseValueAnimator

import android.view.animation.AccelerateInterpolator; //導入依賴的package包/類
private ValueAnimator createCollapseValueAnimator() {
    ValueAnimator animator = ValueAnimator.ofFloat(1f, 0f);
    animator.setDuration(DEFAULT_ANIMATION_DURATION_COLLAPSE);
    animator.setInterpolator(new AccelerateInterpolator());
    animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
        @Override
        public void onAnimationUpdate(ValueAnimator valueAnimator) {
            mExpandedScaleFactor[0] = (float) valueAnimator.getAnimatedValue();
            invalidateSelf();
        }
    });
    animator.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            notifyCollapsed();
        }
    });
    return animator;
}
 
開發者ID:dewarder,項目名稱:HoldingButton,代碼行數:20,代碼來源:HoldingDrawable.java

示例9: switchShowRouteLineDetail

import android.view.animation.AccelerateInterpolator; //導入依賴的package包/類
@Override
public void switchShowRouteLineDetail() {
    if (showState == ShowState.showing || showState == ShowState.unshowing)
        return;
    height = mAnslMapBox.getHeight();

    if (showState == ShowState.unshow) {
        if (showState == ShowState.showed)
            return;
        mAnslOutBottomBox.setVisibility(View.GONE);
        mAnslVoiceBt.setVisibility(View.GONE);
        findViewById(R.id.ansl_route_detail_list_box).setVisibility(View.VISIBLE);
        startHeight = mAnslRouteLineBox.getHeight();
        mAnslRouteLineBox.getLayoutParams().height = startHeight;
        RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) mAnslRouteDetailBottomBox.getLayoutParams();
        layoutParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
        layoutParams.height = RelativeLayout.LayoutParams.MATCH_PARENT;
    }

    mAnimateToTargetPosition.reset();
    mAnimateToTargetPosition.setInterpolator(new AccelerateInterpolator());
    mAnimateToTargetPosition.setDuration(300);
    mAnimateToTargetPosition.setAnimationListener(animationListener);
    mAnslRouteDetailBottomBox.startAnimation(mAnimateToTargetPosition);
}
 
開發者ID:LingjuAI,項目名稱:AssistantBySDK,代碼行數:26,代碼來源:NaviSetLineActivity.java

示例10: init

import android.view.animation.AccelerateInterpolator; //導入依賴的package包/類
public void init(Context context) {
	mScroller = new Scroller(context, new AccelerateInterpolator());// 加速 // 動畫插入器

	mInvisibleTextView = new MyTextView(context);
	mInvisibleTextView.setText("0");
	mInvisibleTextView.setGravity(Gravity.CENTER);
	mInvisibleTextView.setIncludeFontPadding(false);
	addView(mInvisibleTextView);

	mVisibleTextView = new MyTextView(context);
	mVisibleTextView.setText("0");
	mVisibleTextView.setGravity(Gravity.CENTER);
	mVisibleTextView.setIncludeFontPadding(false);
	addView(mVisibleTextView);

	mShadePaint.setColor(Color.BLACK);
	mShadePaint.setStyle(Paint.Style.FILL);
	mShinePaint.setColor(Color.WHITE);
	mShinePaint.setStyle(Paint.Style.FILL);
}
 
開發者ID:zjutcmos,項目名稱:TimeTicker,代碼行數:21,代碼來源:FlipClockView.java

示例11: startAnimators

import android.view.animation.AccelerateInterpolator; //導入依賴的package包/類
public static void startAnimators(final View view, int startOffsetX, int startOffsetY, long delay) {
    if (view.getVisibility() == View.VISIBLE && view.getAlpha() != 0f) {
        view.clearAnimation();
        view.animate().cancel();
        final Resources res = view.getResources();
        final float endAlpha = view.getAlpha();
        final float endTranslateX = view.getTranslationX();
        final float endTranslateY = view.getTranslationY();
        view.setAlpha(0);
        final Animator fade = ObjectAnimator.ofFloat(view, View.ALPHA, endAlpha);
        fade.setDuration(res.getInteger(R.integer.material_in_fade_anim_duration));
        fade.setInterpolator(new AccelerateInterpolator());
        fade.setStartDelay(delay);
        fade.start();
        ViewPropertyAnimator slide = view.animate();
        if (startOffsetY != 0) {
            view.setTranslationY(startOffsetY);
            slide.translationY(endTranslateY);
        } else {
            view.setTranslationX(startOffsetX);
            slide.translationX(endTranslateX);
        }
        slide.setInterpolator(new DecelerateInterpolator(2));
        slide.setDuration(res.getInteger(R.integer.material_in_slide_anim_duration));
        slide.setStartDelay(delay);
        slide.setListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationCancel(Animator animation) {
                if (fade.isStarted()) {
                    fade.cancel();
                }
                view.setAlpha(endAlpha);
                view.setTranslationX(endTranslateX);
                view.setTranslationY(endTranslateY);
            }
        });
        slide.start();
    }
}
 
開發者ID:rumaan,項目名稱:file.io-app,代碼行數:40,代碼來源:MaterialIn.java

示例12: startIntroAnimation

import android.view.animation.AccelerateInterpolator; //導入依賴的package包/類
private void startIntroAnimation() {
    ViewCompat.setElevation(getToolbar(), 0);
    contentRoot.setScaleY(0.1f);
    contentRoot.setPivotY(drawingStartLocation);
    llAddComment.setTranslationY(200);

    contentRoot.animate()
            .scaleY(1)
            .setDuration(200)
            .setInterpolator(new AccelerateInterpolator())
            .setListener(new AnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(Animator animation) {
                    ViewCompat.setElevation(getToolbar(), Utils.dpToPx(8));
                    animateContent();
                }
            })
            .start();
}
 
開發者ID:NarendraSickarwar,項目名稱:FirebasePost,代碼行數:20,代碼來源:CommentsActivity.java

示例13: performDismissAnimation

import android.view.animation.AccelerateInterpolator; //導入依賴的package包/類
private void performDismissAnimation() {
    contextMenuView.setPivotX(contextMenuView.getWidth() / 2);
    contextMenuView.setPivotY(contextMenuView.getHeight());
    contextMenuView.animate()
            .scaleX(0.1f).scaleY(0.1f)
            .setDuration(150)
            .setInterpolator(new AccelerateInterpolator())
            .setStartDelay(100)
            .setListener(new AnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(Animator animation) {
                    if (contextMenuView != null) {
                        contextMenuView.dismiss();
                    }
                    isContextMenuDismissing = false;
                }
            });
}
 
開發者ID:lianghao208,項目名稱:InstaFlickr,代碼行數:19,代碼來源:FeedContextMenuManager.java

示例14: startIntroAnimation

import android.view.animation.AccelerateInterpolator; //導入依賴的package包/類
private void startIntroAnimation() {
    contentRoot.setScaleY(0.1f);
    contentRoot.setPivotY(drawingStartLocation);//設置reyclerview的父view展開動畫的起始位置(中心線)為上一activity的點擊位置
    llAddComment.setTranslationY(200);//設置地下發送評論的控件的Y坐標初始位置(隱藏在屏幕底下100dp為起始位置)

    contentRoot.animate()
            .scaleY(1)
            .setDuration(200)
            .setInterpolator(new AccelerateInterpolator())
            .setListener(new AnimatorListenerAdapter() {
                @Override
                public void onAnimationEnd(Animator animation) {
                    animateContent();
                }
            })
            .start();
}
 
開發者ID:lianghao208,項目名稱:InstaFlickr,代碼行數:18,代碼來源:CommentsActivity.java

示例15: apply

import android.view.animation.AccelerateInterpolator; //導入依賴的package包/類
@Override
public SkinAnimator apply(@NonNull final View view, @Nullable final Action action) {
    animator = ObjectAnimator.ofPropertyValuesHolder(view,
            PropertyValuesHolder.ofFloat("alpha", 1, 0),
            PropertyValuesHolder.ofFloat("translationY", 0, view.getHeight()));
    animator.setDuration(3 * PRE_DURATION);
    animator.setInterpolator(new AccelerateInterpolator());
    animator.addListener(new AnimatorListenerAdapter() {
        @Override
        public void onAnimationEnd(Animator animation) {
            super.onAnimationEnd(animation);
            resetView(view);
            if (action != null) {
                action.action();
            }
        }
    });
    return this;
}
 
開發者ID:wutongke,項目名稱:AndroidSkinAnimator,代碼行數:20,代碼來源:TranslationHideAnimator2.java


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