Java 类android.view.animation.DecelerateInterpolator 实例源码
项目:ArcLayout-master
文件:DemoLikeTumblrActivity.java
private Animator createHideItemAnimator(final View item) {
final float dx = centerItem.getX() - item.getX();
final float dy = centerItem.getY() - item.getY();
Animator anim = ObjectAnimator.ofPropertyValuesHolder(
item,
AnimatorUtils.scaleX(1f, 0f),
AnimatorUtils.scaleY(1f, 0f),
AnimatorUtils.translationX(0f, dx),
AnimatorUtils.translationY(0f, dy)
);
anim.setInterpolator(new DecelerateInterpolator());
anim.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
item.setTranslationX(0f);
item.setTranslationY(0f);
}
});
anim.setDuration(50);
return anim;
}
项目:RetroMusicPlayer
文件:HolidayPlaybackControlsFragment.java
public void showBouceAnimation() {
playPauseFab.clearAnimation();
playPauseFab.setScaleX(0.9f);
playPauseFab.setScaleY(0.9f);
playPauseFab.setVisibility(View.VISIBLE);
playPauseFab.setPivotX(playPauseFab.getWidth() / 2);
playPauseFab.setPivotY(playPauseFab.getHeight() / 2);
playPauseFab.animate()
.setDuration(200)
.setInterpolator(new DecelerateInterpolator())
.scaleX(1.1f)
.scaleY(1.1f)
.withEndAction(() -> playPauseFab.animate()
.setDuration(200)
.setInterpolator(new AccelerateInterpolator())
.scaleX(1f)
.scaleY(1f)
.alpha(1f)
.start())
.start();
}
项目:RetroMusicPlayer
文件:SimplePlaybackControlsFragment.java
public void showBouceAnimation() {
playPauseFab.clearAnimation();
playPauseFab.setScaleX(0.9f);
playPauseFab.setScaleY(0.9f);
playPauseFab.setVisibility(View.VISIBLE);
playPauseFab.setPivotX(playPauseFab.getWidth() / 2);
playPauseFab.setPivotY(playPauseFab.getHeight() / 2);
playPauseFab.animate()
.setDuration(200)
.setInterpolator(new DecelerateInterpolator())
.scaleX(1.1f)
.scaleY(1.1f)
.withEndAction(() -> playPauseFab.animate()
.setDuration(200)
.setInterpolator(new AccelerateInterpolator())
.scaleX(1f)
.scaleY(1f)
.alpha(1f)
.start())
.start();
}
项目:RetroMusicPlayer
文件:PlaylistDetailActivity.java
public void showHeartAnimation() {
shuffleButton.clearAnimation();
shuffleButton.setScaleX(0.9f);
shuffleButton.setScaleY(0.9f);
shuffleButton.setVisibility(View.VISIBLE);
shuffleButton.setPivotX(shuffleButton.getWidth() / 2);
shuffleButton.setPivotY(shuffleButton.getHeight() / 2);
shuffleButton.animate()
.setDuration(200)
.setInterpolator(new DecelerateInterpolator())
.scaleX(1.1f)
.scaleY(1.1f)
.withEndAction(() -> shuffleButton.animate()
.setDuration(200)
.setInterpolator(new AccelerateInterpolator())
.scaleX(1f)
.scaleY(1f)
.alpha(1f)
.start())
.start();
}
项目:Cluttr
文件:ViewActivity.java
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();
}
}
项目:LaunchEnr
文件:CellLayout.java
@Thunk void completeAnimationImmediately() {
if (a != null) {
a.cancel();
}
setInitialAnimationValues(true);
a = LauncherAnimUtils.ofPropertyValuesHolder(child,
new PropertyListBuilder()
.scale(initScale)
.translationX(initDeltaX)
.translationY(initDeltaY)
.build())
.setDuration(REORDER_ANIMATION_DURATION);
a.setInterpolator(new android.view.animation.DecelerateInterpolator(1.5f));
a.start();
}
项目:Hello-Music-droid
文件:PlayPauseDrawable.java
private void toggle() {
if (animator != null) {
animator.cancel();
}
animator = ObjectAnimator.ofFloat(this, PROGRESS, isPlay ? 1.0F : 0.0F, isPlay ? 0.0F : 1.0F);
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
isPlay = !isPlay;
}
});
animator.setInterpolator(new DecelerateInterpolator());
animator.setDuration(200);
animator.start();
}
项目:mapbox-navigation-android
文件:InstructionView.java
/**
* Show the instruction list and hide the sound button.
* <p>
* This is based on orientation so the different layouts (for portrait vs. landscape)
* can be animated appropriately.
*/
public void showInstructionList() {
int orientation = getContext().getResources().getConfiguration().orientation;
if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
ConstraintSet expanded = new ConstraintSet();
expanded.clone(getContext(), R.layout.instruction_layout_alt);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
TransitionManager.beginDelayedTransition(InstructionView.this);
}
expanded.applyTo(instructionLayout);
instructionListLayout.setVisibility(VISIBLE);
} else {
Animation slideDown = AnimationUtils.loadAnimation(getContext(), R.anim.slide_down_top);
slideDown.setInterpolator(new DecelerateInterpolator());
instructionListLayout.setVisibility(VISIBLE);
instructionListLayout.startAnimation(slideDown);
}
}
项目:mapbox-navigation-android
文件:InstructionView.java
/**
* Initializes all animations needed to show / hide views.
*/
private void initAnimations() {
Context context = getContext();
rerouteSlideDownTop = AnimationUtils.loadAnimation(context, R.anim.slide_down_top);
rerouteSlideUpTop = AnimationUtils.loadAnimation(context, R.anim.slide_up_top);
Animation fadeIn = new AlphaAnimation(0, 1);
fadeIn.setInterpolator(new DecelerateInterpolator());
fadeIn.setDuration(300);
Animation fadeOut = new AlphaAnimation(1, 0);
fadeOut.setInterpolator(new AccelerateInterpolator());
fadeOut.setStartOffset(1000);
fadeOut.setDuration(1000);
fadeInSlowOut = new AnimationSet(false);
fadeInSlowOut.addAnimation(fadeIn);
fadeInSlowOut.addAnimation(fadeOut);
}
项目:PinchToZoom
文件:ImageMatrixTouchHandler.java
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
if (mode == DRAG) {
if (flingDuration > 0 && !isAnimating()) {
float factor = ((float) flingDuration / 1000f) * flingExaggeration;
float[] values = corrector.getValues();
float dx = (velocityX * factor) * values[Matrix.MSCALE_X];
float dy = (velocityY * factor) * values[Matrix.MSCALE_Y];
PropertyValuesHolder flingX = PropertyValuesHolder.ofFloat(FlingAnimatorHandler.PROPERTY_TRANSLATE_X, values[Matrix.MTRANS_X], values[Matrix.MTRANS_X] + dx);
PropertyValuesHolder flingY = PropertyValuesHolder.ofFloat(FlingAnimatorHandler.PROPERTY_TRANSLATE_Y, values[Matrix.MTRANS_Y], values[Matrix.MTRANS_Y] + dy);
valueAnimator = ValueAnimator.ofPropertyValuesHolder(flingX, flingY);
valueAnimator.setDuration(flingDuration);
valueAnimator.addUpdateListener(new FlingAnimatorHandler(corrector));
valueAnimator.setInterpolator(new DecelerateInterpolator());
valueAnimator.start();
return true;
}
}
return super.onFling(e1, e2, velocityX, velocityY);
}
项目:AssistantBySDK
文件:LingjuSwipeRefreshLayout.java
/**
* Constructor that is called when inflating SwipeRefreshLayout from XML.
*
* @param context
* @param attrs
*/
public LingjuSwipeRefreshLayout(Context context, AttributeSet attrs) {
super(context, attrs);
mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
mMediumAnimationDuration = getResources().getInteger(
android.R.integer.config_mediumAnimTime);
setWillNotDraw(false);
mDecelerateInterpolator = new DecelerateInterpolator(DECELERATE_INTERPOLATION_FACTOR);
final TypedArray a = context.obtainStyledAttributes(attrs, LAYOUT_ATTRS);
setEnabled(a.getBoolean(0, true));
a.recycle();
final DisplayMetrics metrics = getResources().getDisplayMetrics();
mCircleWidth = (int) (CIRCLE_DIAMETER * metrics.density);
mCircleHeight = (int) (CIRCLE_DIAMETER * metrics.density);
createProgressView();
ViewCompat.setChildrenDrawingOrderEnabled(this, true);
// the absolute offset has to take into account that the circle starts at an offset
mSpinnerFinalOffset = DEFAULT_CIRCLE_TARGET * metrics.density;
mTotalDragDistance = mSpinnerFinalOffset;
}
项目:AssistantBySDK
文件:LingjuSwipeUpLoadRefreshLayout.java
/**
* Constructor that is called when inflating SwipeRefreshLayout from XML.
*
* @param context
* @param attrs
*/
public LingjuSwipeUpLoadRefreshLayout(Context context, AttributeSet attrs) {
super(context, attrs);
mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
mMediumAnimationDuration = getResources().getInteger(
android.R.integer.config_mediumAnimTime);
setWillNotDraw(false);
mDecelerateInterpolator = new DecelerateInterpolator(DECELERATE_INTERPOLATION_FACTOR);
final TypedArray a = context.obtainStyledAttributes(attrs, LAYOUT_ATTRS);
setEnabled(a.getBoolean(0, true));
a.recycle();
final DisplayMetrics metrics = getResources().getDisplayMetrics();
mCircleWidth = (int) (CIRCLE_DIAMETER * metrics.density);
mCircleHeight = (int) (CIRCLE_DIAMETER * metrics.density);
createProgressView();
ViewCompat.setChildrenDrawingOrderEnabled(this, true);
// the absolute offset has to take into account that the circle starts at an offset
mSpinnerFinalOffset = DEFAULT_CIRCLE_TARGET * metrics.density;
mTotalDragDistance = mSpinnerFinalOffset;
}
项目:RetroMusicPlayer
文件:PlayerPlaybackControlsFragment.java
public void showBouceAnimation() {
playPauseFab.clearAnimation();
playPauseFab.setScaleX(0.9f);
playPauseFab.setScaleY(0.9f);
playPauseFab.setVisibility(View.VISIBLE);
playPauseFab.setPivotX(playPauseFab.getWidth() / 2);
playPauseFab.setPivotY(playPauseFab.getHeight() / 2);
playPauseFab.animate()
.setDuration(200)
.setInterpolator(new DecelerateInterpolator())
.scaleX(1.1f)
.scaleY(1.1f)
.withEndAction(() -> playPauseFab.animate()
.setDuration(200)
.setInterpolator(new AccelerateInterpolator())
.scaleX(1f)
.scaleY(1f)
.alpha(1f)
.start())
.start();
}
项目:MenuSet
文件:PerseiLayout.java
public void createAnimatorToHeadView(final View v, final float angle)
{
ViewPropertyAnimatorCompat viewPropertyAnimatorCompat = ViewCompat.animate(v);
viewPropertyAnimatorCompat.setDuration(200);
viewPropertyAnimatorCompat.setInterpolator(new DecelerateInterpolator());
viewPropertyAnimatorCompat.rotationX(90);
viewPropertyAnimatorCompat.start();
viewPropertyAnimatorCompat.setUpdateListener(new ViewPropertyAnimatorUpdateListener() {
@Override
public void onAnimationUpdate(View view) {
float height = ViewCompat.getTranslationY(mChildView);
mHeadLayout.setPivotX(mHeadLayout.getWidth() / 2);
mHeadLayout.setPivotY(height);
}
});
}
项目:yphoto
文件:MapFragment.java
/**
* 点击map,隐藏/显示Map上的元素
* @param latLng
*/
@Override
public void onMapClick(LatLng latLng) {
SearchView search_view = (SearchView) ((Activity)mContext).findViewById(R.id.search_view);
MapToolsView map_tool = (MapToolsView) ((Activity)mContext).findViewById(R.id.map_tool);
DisplayMetrics metrics = new DisplayMetrics();
((Activity)mContext).getWindowManager().getDefaultDisplay().getMetrics(metrics);
if (mIsMapElementsShow) {
mIsMapElementsShow = false;
search_view.animate().translationY((search_view.getHeight() + dp2px(mContext, 6)) * (-1)).setInterpolator(new DecelerateInterpolator());
map_tool.animate().translationY(map_tool.getHeight() + dp2px(mContext, 6)).setInterpolator(new DecelerateInterpolator());
} else {
mIsMapElementsShow = true;
search_view.animate().translationY(0).setInterpolator(new DecelerateInterpolator());
map_tool.animate().translationY(0).setInterpolator(new DecelerateInterpolator());
}
}
项目:Rx2Animations
文件:RxAnimations.java
public static Completable enter(final View view, final int xOffset, final int yOffset) {
final float startingX = view.getX();
final float startingY = view.getY();
return animate(view, new DecelerateInterpolator())
.fadeIn()
.translateBy(xOffset, yOffset)
.onAnimationCancel(aView -> set(aView, startingX, startingY, OPAQUE))
.schedule();
}
项目:letv
文件:PullToRefreshBase.java
private final void smoothScrollTo(int newScrollValue, long duration, long delayMillis, OnSmoothScrollFinishedListener listener) {
int oldScrollValue;
if (this.mCurrentSmoothScrollRunnable != null) {
this.mCurrentSmoothScrollRunnable.stop();
}
switch (getPullToRefreshScrollDirection()) {
case HORIZONTAL:
oldScrollValue = getScrollX();
break;
default:
oldScrollValue = getScrollY();
break;
}
if (oldScrollValue != newScrollValue) {
if (this.mScrollAnimationInterpolator == null) {
this.mScrollAnimationInterpolator = new DecelerateInterpolator();
}
this.mCurrentSmoothScrollRunnable = new SmoothScrollRunnable(oldScrollValue, newScrollValue, duration, listener);
if (delayMillis > 0) {
postDelayed(this.mCurrentSmoothScrollRunnable, delayMillis);
} else {
post(this.mCurrentSmoothScrollRunnable);
}
}
}
项目:Dachshund-Tab-Layout
文件:DachshundIndicator.java
public DachshundIndicator(DachshundTabLayout dachshundTabLayout){
this.dachshundTabLayout = dachshundTabLayout;
valueAnimatorLeft = new ValueAnimator();
valueAnimatorLeft.setDuration(DEFAULT_DURATION);
valueAnimatorLeft.addUpdateListener(this);
valueAnimatorRight = new ValueAnimator();
valueAnimatorRight.setDuration(DEFAULT_DURATION);
valueAnimatorRight.addUpdateListener(this);
accelerateInterpolator = new AccelerateInterpolator();
decelerateInterpolator = new DecelerateInterpolator();
rectF = new RectF();
rect = new Rect();
paint = new Paint();
paint.setAntiAlias(true);
paint.setStyle(Paint.Style.FILL);
leftX = (int) dachshundTabLayout.getChildXCenter(dachshundTabLayout.getCurrentPosition());
rightX = leftX;
}
项目:QMUI_Android
文件:QMUIBottomSheet.java
/**
* BottomSheet升起动画
*/
private void animateUp() {
if (mContentView == null) {
return;
}
TranslateAnimation translate = new TranslateAnimation(
Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF, 0f,
Animation.RELATIVE_TO_SELF, 1f, Animation.RELATIVE_TO_SELF, 0f
);
AlphaAnimation alpha = new AlphaAnimation(0, 1);
AnimationSet set = new AnimationSet(true);
set.addAnimation(translate);
set.addAnimation(alpha);
set.setInterpolator(new DecelerateInterpolator());
set.setDuration(mAnimationDuration);
set.setFillAfter(true);
mContentView.startAnimation(set);
}
项目:Shared-Route
文件:MyRank.java
@Override
protected void onPostExecute(Void aVoid) {
super.onPostExecute(aVoid);
if (itemList.size() == 0) Toast.makeText(MyRank.this, "发生未知错误",Toast.LENGTH_SHORT).show();
RecyclerView rankList = findViewById(R.id.rank_list);
ReleaseRankItemAdapter adapter = new ReleaseRankItemAdapter(itemList);
GridLayoutManager layoutManager = new GridLayoutManager(MyRank.this, 1);
rankList.setLayoutManager(layoutManager);
rankList.setAdapter(adapter);
TranslateAnimation animation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 2f, Animation.RELATIVE_TO_SELF,
0f, Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF, 0);
animation.setInterpolator(new DecelerateInterpolator());
animation.setDuration(550);
lac = new LayoutAnimationController(animation, 0.12f);
lac.setInterpolator(new DecelerateInterpolator());
rankList.setLayoutAnimation(lac);
RecyclerView ranklist1 = findViewById(R.id.rank_list1);
ReleaseRankItemAdapter adapter1 = new ReleaseRankItemAdapter(itemListOthers);
GridLayoutManager layoutManager1 = new GridLayoutManager(MyRank.this,1);
ranklist1.setLayoutManager(layoutManager1);
ranklist1.setAdapter(adapter1);
ranklist1.setLayoutAnimation(lac);
}
项目:Closet
文件:BasicSearchBarFragment.java
/**
* 搜索栏的回退逻辑
*
* @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;
}
项目:QMUI_Android
文件:QMUIViewHelper.java
/**
* <p>对 View 做透明度变化的进场动画。</p>
* <p>相关方法 {@link #fadeOut(View, int, Animation.AnimationListener, boolean)}</p>
*
* @param view 做动画的 View
* @param duration 动画时长(毫秒)
* @param listener 动画回调
* @param isNeedAnimation 是否需要动画
*/
public static AlphaAnimation fadeIn(View view, int duration, Animation.AnimationListener listener, boolean isNeedAnimation) {
if (view == null) {
return null;
}
if (isNeedAnimation) {
view.setVisibility(View.VISIBLE);
AlphaAnimation alpha = new AlphaAnimation(0, 1);
alpha.setInterpolator(new DecelerateInterpolator());
alpha.setDuration(duration);
alpha.setFillAfter(true);
if (listener != null) {
alpha.setAnimationListener(listener);
}
view.startAnimation(alpha);
return alpha;
} else {
view.setAlpha(1);
view.setVisibility(View.VISIBLE);
return null;
}
}
项目:qmui
文件:QMUIViewHelper.java
/**
* <p>对 View 做透明度变化的进场动画。</p>
* <p>相关方法 {@link #fadeOut(View, int, Animation.AnimationListener, boolean)}</p>
*
* @param view 做动画的 View
* @param duration 动画时长(毫秒)
* @param listener 动画回调
* @param isNeedAnimation 是否需要动画
*/
public static AlphaAnimation fadeIn(View view, int duration, Animation.AnimationListener listener, boolean isNeedAnimation) {
if (view == null) {
return null;
}
if (isNeedAnimation) {
view.setVisibility(View.VISIBLE);
AlphaAnimation alpha = new AlphaAnimation(0, 1);
alpha.setInterpolator(new DecelerateInterpolator());
alpha.setDuration(duration);
alpha.setFillAfter(true);
if (listener != null) {
alpha.setAnimationListener(listener);
}
view.startAnimation(alpha);
return alpha;
} else {
view.setAlpha(1);
view.setVisibility(View.VISIBLE);
return null;
}
}
项目:NeoTerm
文件:AbstractTabSwitcherLayout.java
@Override
public final void onFling(final float distance, final long duration) {
if (dragHandler != null) {
flingAnimation = new FlingAnimation(distance);
flingAnimation.setFillAfter(true);
flingAnimation.setAnimationListener(createFlingAnimationListener());
flingAnimation.setDuration(duration);
flingAnimation.setInterpolator(new DecelerateInterpolator());
getTabSwitcher().startAnimation(flingAnimation);
logger.logVerbose(getClass(),
"Started fling animation using a distance of " + distance +
" pixels and a duration of " + duration + " milliseconds");
}
}
项目:GitHub
文件:XListView.java
private void initWithContext(Context context) {
setFadingEdgeLength(0); // 消除边界模糊
setOverScrollMode(View.OVER_SCROLL_NEVER); // 消除滚动边框
mScroller = new Scroller(context, new DecelerateInterpolator());
// XListView need the scroll event, and it will dispatch the event to
// user's listener (as a proxy).
super.setOnScrollListener(this);
// init header view
mHeaderView = new XListViewHeader(context);
mHeaderViewContent = (RelativeLayout) mHeaderView
.findViewById(R.id.xlistview_header_content);
mHeaderTimeView = (TextView) mHeaderView.findViewById(R.id.xlistview_header_time);
addHeaderView(mHeaderView);
// init footer view
mFooterView = new XListViewFooter(context);
// init header height
mHeaderView.getViewTreeObserver().addOnGlobalLayoutListener(
new OnGlobalLayoutListener() {
@SuppressWarnings("deprecation")
@Override
public void onGlobalLayout() {
mHeaderViewHeight = mHeaderViewContent.getHeight();
getViewTreeObserver()
.removeGlobalOnLayoutListener(this);
}
});
}
项目:NoticeDog
文件:AppReviewView.java
void enableFeedbackMode() {
this.appReviewContent.animate().alpha(0.0f).setDuration(500).setInterpolator(new AccelerateInterpolator()).withEndAction(new Runnable() {
public void run() {
AppReviewView.this.yesButton.setText(AppReviewView.this.getContext().getResources().getString(R.string.give_feedback_button_text));
AppReviewView.this.noButton.setText(AppReviewView.this.getContext().getResources().getString(R.string.no_give_feedback_button_text));
AppReviewView.this.reviewDescription.setText(AppReviewView.this.getContext().getResources().getString(R.string.give_feedback_description));
AppReviewView.this.appReviewContent.animate().alpha(DefaultRetryPolicy.DEFAULT_BACKOFF_MULT).setInterpolator(new DecelerateInterpolator()).setDuration(500);
}
});
this.isInFeedbackMode = true;
}
项目:boohee_v5.6
文件:MQPhotoPreviewActivity.java
private void showTitlebar() {
ViewCompat.animate(this.mTitleRl).translationY(0.0f).setInterpolator(new
DecelerateInterpolator(2.0f)).setListener(new ViewPropertyAnimatorListenerAdapter
() {
public void onAnimationEnd(View view) {
MQPhotoPreviewActivity.this.mIsHidden = false;
}
}).start();
}
项目:BlogBookApp
文件:Animation.java
/**
*
* @param view
* @param scaleInitial
* @param scaleFinal
* @param factor
* @param duration
* @param <V>
*/
protected static <V extends View>void itemAnimScaleDesc(V view, float scaleInitial, float scaleFinal, float factor, int duration){
view.setScaleX(scaleInitial);
view.setScaleY(scaleInitial);
view.animate()
.scaleX(scaleFinal)
.scaleY(scaleFinal)
.setInterpolator(new DecelerateInterpolator(factor))
.setDuration(duration)
.start();
}
项目:FreeStreams-TVLauncher
文件:FocusedRelativeLayout.java
public FocusedRelativeLayout(Context paramContext) {
super(paramContext);
setChildrenDrawingOrderEnabled(true);
this.mScroller = new HotScroller(paramContext, new DecelerateInterpolator());
this.mScreenWidth = paramContext.getResources().getDisplayMetrics().widthPixels;
this.mPositionManager = new FocusedLayoutPositionManager(paramContext, this);
}
项目:decoy
文件:SuperSwipeRefreshLayout.java
@SuppressWarnings("deprecation")
public SuperSwipeRefreshLayout(Context context, AttributeSet attrs) {
super(context, attrs);
/**
* getScaledTouchSlop是一个距离,表示滑动的时候,手的移动要大于这个距离才开始移动控件。如果小于这个距离就不触发移动控件
*/
mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
mMediumAnimationDuration = getResources().getInteger(
android.R.integer.config_mediumAnimTime);
setWillNotDraw(false);
mDecelerateInterpolator = new DecelerateInterpolator(
DECELERATE_INTERPOLATION_FACTOR);
final TypedArray a = context
.obtainStyledAttributes(attrs, LAYOUT_ATTRS);
setEnabled(a.getBoolean(0, true));
a.recycle();
WindowManager wm = (WindowManager) context
.getSystemService(Context.WINDOW_SERVICE);
Display display = wm.getDefaultDisplay();
final DisplayMetrics metrics = getResources().getDisplayMetrics();
mHeaderViewWidth = (int) display.getWidth();
mFooterViewWidth = (int) display.getWidth();
mHeaderViewHeight = (int) (HEADER_VIEW_HEIGHT * metrics.density);
mFooterViewHeight = (int) (HEADER_VIEW_HEIGHT * metrics.density);
defaultProgressView = new CircleProgressView(getContext());
createHeaderViewContainer();
createFooterViewContainer();
ViewCompat.setChildrenDrawingOrderEnabled(this, true);
mSpinnerFinalOffset = DEFAULT_CIRCLE_TARGET * metrics.density;
density = metrics.density;
mTotalDragDistance = mSpinnerFinalOffset;
}
项目:DroidCalorieCounterView
文件:CalorieCounterView.java
/**
* Set the progress with an animation for the calorie counter
*
* @param progress The progress it should animate to it
*/
public void setProgressWithAnimation(int progress) {
ObjectAnimator objectAnimator = ObjectAnimator.ofInt(this, "progress", progress);
objectAnimator.setDuration(1500);
objectAnimator.setInterpolator(new DecelerateInterpolator());
objectAnimator.start();
}
项目:GitHub
文件:AnimProcessor.java
public void animLayoutByTime(int start, int end, long time, AnimatorUpdateListener listener) {
ValueAnimator va = ValueAnimator.ofInt(start, end);
va.setInterpolator(new DecelerateInterpolator());
va.addUpdateListener(listener);
va.setDuration(time);
va.start();
}
项目:AndroidPdfViewerV2
文件:AnimationManager.java
public void startYAnimation(float yFrom, float yTo) {
stopAll();
animation = ValueAnimator.ofFloat(yFrom, yTo);
YAnimation yAnimation = new YAnimation();
animation.setInterpolator(new DecelerateInterpolator());
animation.addUpdateListener(yAnimation);
animation.addListener(yAnimation);
animation.setDuration(400);
animation.start();
}
项目:AnimationTextView
文件:AnimationTextView.java
/**
* 提供设置数值的方法
* @param Num
*/
public void setMaxNum(int Num) {
ObjectAnimator o = ObjectAnimator.ofInt(this, "num", 0, Num);
o.setDuration(2000);
o.setInterpolator(new DecelerateInterpolator());
o.start();
}
项目:GitHub
文件:WaterDropView.java
/**
* 创建回弹动画
* 上圆半径减速恢复至最大半径
* 下圆半径减速恢复至最大半径
* 圆心距减速从最大值减到0(下圆Y从当前位置移动到上圆Y)。
*/
public Animator createAnimator() {
ValueAnimator valueAnimator = ValueAnimator.ofFloat(1, 0.001f).setDuration(BACK_ANIM_DURATION);
valueAnimator.setInterpolator(new DecelerateInterpolator());
valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator valueAnimator1) {
WaterDropView.this.updateComleteState((float) valueAnimator1.getAnimatedValue());
WaterDropView.this.postInvalidate();
}
});
return valueAnimator;
}
项目:Rotate3d
文件:AnimationHelper.java
public static Animation createRotate3dEnterAnimation() {
final Rotate3dAnimation animation = new Rotate3dAnimation(270, 360, false);
animation.setDuration(600);
animation.setStartOffset(300);
animation.setFillAfter(false);
animation.setInterpolator(new DecelerateInterpolator());
return animation;
}
项目:BatteryProgressView
文件:BatteryProgressView.java
public void setProgress(int progress) {
lastProgress=this.progress;
this.progress = progress;
post(new Runnable() {
@Override
public void run() {
float incr=360/maxProgress;
Log.e("pogress","last:"+lastProgress+",progress:"+BatteryProgressView.this.progress);
if(lastProgress<BatteryProgressView.this.progress) {
Log.e("first",lastProgress+" to "+ (incr * (BatteryProgressView.this.progress))+":"+lastProgress);
animator = ValueAnimator.ofFloat(incr*lastProgress, incr * (BatteryProgressView.this.progress));
animator.setDuration(800);
animator.addUpdateListener(animatorUpdateListener);
animator.setInterpolator(new DecelerateInterpolator());
animator.start();
}else {
Log.e("second",lastProgress+" to "+ (incr * (BatteryProgressView.this.progress))+":"+lastProgress);
animator = ValueAnimator.ofFloat((incr*lastProgress), incr * (BatteryProgressView.this.progress));
animator.setDuration(800);
animator.addUpdateListener(animatorUpdateListener);
animator.setInterpolator(new DecelerateInterpolator());
animator.start();
}
}
});
}
项目:GitHub
文件:ImageAnimationHelper.java
public static void fadeInDisplay(final ImageView imageView, Drawable drawable) {
AlphaAnimation fadeAnimation = new AlphaAnimation(0F, 1F);
fadeAnimation.setDuration(300);
fadeAnimation.setInterpolator(new DecelerateInterpolator());
imageView.setImageDrawable(drawable);
imageView.startAnimation(fadeAnimation);
}
项目:stateLayout
文件:FadeScaleViewAnimProvider.java
@Override
public Animation hideAnimation() {
AnimationSet set = new AnimationSet(true);
Animation alphaAnimation = new AlphaAnimation(1.0f, 0.0f);
Animation scaleAnimation = new ScaleAnimation(1.0f, 0.1f, 1.0f, 0.1f, Animation.RELATIVE_TO_SELF, 0.5f,
Animation.RELATIVE_TO_SELF, 0.5f);
set.setDuration(200);
set.setInterpolator(new DecelerateInterpolator());
set.addAnimation(alphaAnimation);
set.addAnimation(scaleAnimation);
return set;
}
项目:SciChart.Android.Examples
文件:AnimatingLineChartFragment.java
private AnimatingLineRenderableSeries() {
animator = ValueAnimator.ofFloat(START_VALUE, END_VALUE);
animator.setInterpolator(new DecelerateInterpolator());
animator.setDuration(TIME_INTERVAL);
animator.addUpdateListener(this);
animator.addListener(this);
}