use of android.view.animation.DecelerateInterpolator in project FlyRefresh by race604.
the class SampleItemAnimator method animateAddImpl.
@Override
protected void animateAddImpl(final RecyclerView.ViewHolder holder) {
View target = holder.itemView;
View icon = target.findViewById(R.id.icon);
Animator swing = ObjectAnimator.ofFloat(icon, "rotationX", 45, 0);
swing.setInterpolator(new OvershootInterpolator(5));
View right = holder.itemView.findViewById(R.id.right);
Animator rotateIn = ObjectAnimator.ofFloat(right, "rotationY", 90, 0);
rotateIn.setInterpolator(new DecelerateInterpolator());
AnimatorSet animator = new AnimatorSet();
animator.setDuration(getAddDuration());
animator.playTogether(swing, rotateIn);
animator.start();
}
use of android.view.animation.DecelerateInterpolator in project material by rey5137.
the class TimePicker method applyStyle.
protected void applyStyle(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.TimePicker, defStyleAttr, defStyleRes);
boolean hourDefined = false;
String familyName = null;
int style = -1;
for (int i = 0, count = a.getIndexCount(); i < count; i++) {
int attr = a.getIndex(i);
if (attr == R.styleable.TimePicker_tp_backgroundColor)
mBackgroundColor = a.getColor(attr, 0);
else if (attr == R.styleable.TimePicker_tp_selectionColor)
mSelectionColor = a.getColor(attr, 0);
else if (attr == R.styleable.TimePicker_tp_selectionRadius)
mSelectionRadius = a.getDimensionPixelOffset(attr, 0);
else if (attr == R.styleable.TimePicker_tp_tickSize)
mTickSize = a.getDimensionPixelOffset(attr, 0);
else if (attr == R.styleable.TimePicker_tp_textSize)
mTextSize = a.getDimensionPixelOffset(attr, 0);
else if (attr == R.styleable.TimePicker_tp_textColor)
mTextColor = a.getColor(attr, 0);
else if (attr == R.styleable.TimePicker_tp_textHighlightColor)
mTextHighlightColor = a.getColor(attr, 0);
else if (attr == R.styleable.TimePicker_tp_animDuration)
mAnimDuration = a.getInteger(attr, 0);
else if (attr == R.styleable.TimePicker_tp_inInterpolator)
mInInterpolator = AnimationUtils.loadInterpolator(context, a.getResourceId(attr, 0));
else if (attr == R.styleable.TimePicker_tp_outInterpolator)
mOutInterpolator = AnimationUtils.loadInterpolator(context, a.getResourceId(attr, 0));
else if (attr == R.styleable.TimePicker_tp_mode)
setMode(a.getInteger(attr, 0), false);
else if (attr == R.styleable.TimePicker_tp_24Hour) {
set24Hour(a.getBoolean(attr, false));
hourDefined = true;
} else if (attr == R.styleable.TimePicker_tp_hour)
setHour(a.getInteger(attr, 0));
else if (attr == R.styleable.TimePicker_tp_minute)
setMinute(a.getInteger(attr, 0));
else if (attr == R.styleable.TimePicker_tp_fontFamily)
familyName = a.getString(attr);
else if (attr == R.styleable.TimePicker_tp_textStyle)
style = a.getInteger(attr, 0);
}
a.recycle();
if (mSelectionRadius < 0)
mSecondInnerRadius = ThemeUtil.dpToPx(context, 8);
if (mTickSize < 0)
mTickSize = ThemeUtil.dpToPx(context, 1);
if (mTextSize < 0)
mTextSize = context.getResources().getDimensionPixelOffset(R.dimen.abc_text_size_caption_material);
if (mAnimDuration < 0)
mAnimDuration = context.getResources().getInteger(android.R.integer.config_mediumAnimTime);
if (mInInterpolator == null)
mInInterpolator = new DecelerateInterpolator();
if (mOutInterpolator == null)
mOutInterpolator = new DecelerateInterpolator();
if (!hourDefined)
set24Hour(DateFormat.is24HourFormat(context));
if (familyName != null || style >= 0)
mTypeface = TypefaceUtil.load(context, familyName, style);
}
use of android.view.animation.DecelerateInterpolator in project ToggleDrawable by renaudcerrato.
the class MainActivity method toggle.
private void toggle() {
isFaded = !isFaded;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
AnimatorSet set = new AnimatorSet();
ObjectAnimator backgroundAnim = ObjectAnimator.ofInt(mContainer.getBackground(), "alpha", isFaded ? 128 : 0);
ObjectAnimator drawableAnim = ObjectAnimator.ofInt(mSeekBar, "progress", isFaded ? mSeekBar.getMax() : 0);
set.setDuration(700);
set.setInterpolator(new DecelerateInterpolator(3f));
set.playTogether(backgroundAnim, drawableAnim);
set.start();
} else {
Animation set = new ToggleAnimationSet(isFaded);
set.setDuration(700);
set.setInterpolator(new DecelerateInterpolator(3f));
mContainer.startAnimation(set);
}
}
use of android.view.animation.DecelerateInterpolator in project mobile-android by photo.
the class Workspace method initWorkspace.
/**
* Inits the workspace.
*
* @param context
* the context
* @param attrs
* the attrs
* @param defStyle
* the def style
*/
private void initWorkspace(Context context, AttributeSet attrs, int defStyle) {
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.Workspace, defStyle, 0);
mDefaultScreen = a.getInt(R.styleable.Workspace_defaultScreen, 0);
a.recycle();
setHapticFeedbackEnabled(false);
mScrollInterpolator = new DecelerateInterpolator(1.0f);
mScroller = new Scroller(context, mScrollInterpolator);
// mCurrentScreen = mDefaultScreen;
mPreviousScreen = INVALID_SCREEN;
final ViewConfiguration configuration = ViewConfiguration.get(getContext());
mTouchSlop = configuration.getScaledTouchSlop();
mMaximumVelocity = configuration.getScaledMaximumFlingVelocity();
mPaddingTop = getPaddingTop();
mPaddingBottom = getPaddingBottom();
mPaddingLeft = getPaddingLeft();
mPaddingRight = getPaddingRight();
int overscrollMode = a.getInt(R.styleable.Workspace_overscroll, 0);
setOverScroll(overscrollMode);
}
use of android.view.animation.DecelerateInterpolator in project Libraries-for-Android-Developers by eoecn.
the class ActionBarContextView method makeOutAnimation.
private Animator makeOutAnimation() {
ObjectAnimator buttonAnimator = ObjectAnimator.ofFloat(mClose, "translationX", -mClose.getWidth() - ((MarginLayoutParams) mClose.getLayoutParams()).leftMargin);
buttonAnimator.setDuration(200);
buttonAnimator.addListener(this);
buttonAnimator.setInterpolator(new DecelerateInterpolator());
AnimatorSet set = new AnimatorSet();
AnimatorSet.Builder b = set.play(buttonAnimator);
if (mMenuView != null) {
final int count = mMenuView.getChildCount();
if (count > 0) {
for (int i = 0; i < 0; i++) {
AnimatorProxy child = AnimatorProxy.wrap(mMenuView.getChildAt(i));
child.setScaleY(0);
ObjectAnimator a = ObjectAnimator.ofFloat(child, "scaleY", 0);
a.setDuration(100);
a.setStartDelay(i * 70);
b.with(a);
}
}
}
return set;
}
Aggregations