use of android.view.animation.DecelerateInterpolator in project android-app by eoecn.
the class XListView method initWithContext.
private void initWithContext(Context context) {
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() {
@Override
public void onGlobalLayout() {
mHeaderViewHeight = mHeaderViewContent.getHeight();
getViewTreeObserver().removeGlobalOnLayoutListener(this);
}
});
}
use of android.view.animation.DecelerateInterpolator in project Libraries-for-Android-Developers by eoecn.
the class XListView method initWithContext.
private void initWithContext(Context context) {
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);
}
});
}
use of android.view.animation.DecelerateInterpolator in project android_frameworks_base by ParanoidAndroid.
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++) {
View child = mMenuView.getChildAt(i);
child.setScaleY(0);
ObjectAnimator a = ObjectAnimator.ofFloat(child, "scaleY", 0);
a.setDuration(300);
b.with(a);
}
}
}
return set;
}
use of android.view.animation.DecelerateInterpolator in project android_frameworks_base by ParanoidAndroid.
the class VelocityTest method testDragDeceleration.
@MediumTest
public void testDragDeceleration() {
long t = System.currentTimeMillis();
VelocityTracker vt = VelocityTracker.obtain();
drag(vt, 100, 200, 100, 200, 15, t, 400, new DecelerateInterpolator());
vt.computeCurrentVelocity(1000);
assertLower(250.0f, vt.getXVelocity());
assertLower(250.0f, vt.getYVelocity());
vt.recycle();
}
use of android.view.animation.DecelerateInterpolator in project android_frameworks_base by ParanoidAndroid.
the class HaloProperties method setHaloOverlay.
public void setHaloOverlay(Overlay overlay, float overlayAlpha) {
Drawable d = null;
switch(overlay) {
case BLACK_X:
d = mHaloBlackX;
break;
case BACK_LEFT:
d = mHaloBackL;
break;
case BACK_RIGHT:
d = mHaloBackR;
break;
case DISMISS:
d = mHaloDismiss;
break;
case SILENCE_LEFT:
d = mHaloSilenceL;
break;
case SILENCE_RIGHT:
d = mHaloSilenceR;
break;
case CLEAR_ALL:
d = mHaloClearAll;
break;
case MESSAGE:
d = mHaloMessage;
break;
}
if (d != mHaloCurrentOverlay) {
mHaloOverlay.setImageDrawable(d);
mHaloCurrentOverlay = d;
// Fade out number batch
if (overlay != Overlay.NONE) {
msgNumberAlphaAnimator.animate(ObjectAnimator.ofFloat(mHaloNumberContainer, "alpha", 0f).setDuration(100), new DecelerateInterpolator(), null);
}
}
mHaloOverlay.setAlpha(overlayAlpha);
updateResources(mLastContentStateLeft);
}
Aggregations