use of acr.browser.lightning.interpolator.BezierDecelerateInterpolator in project Lightning-Browser by anthonycr.
the class BrowserActivity method hideActionBar.
/**
* Hide the ActionBar using an animation if we are in full-screen
* mode. This method also re-parents the ActionBar if its parent is
* incorrect so that the animation can happen correctly.
*/
@Override
public void hideActionBar() {
if (mFullScreen) {
if (mToolbarLayout == null || mBrowserFrame == null)
return;
final int height = mToolbarLayout.getHeight();
if (mToolbarLayout.getTranslationY() > -0.01f) {
Animation show = new Animation() {
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
float trans = interpolatedTime * height;
mToolbarLayout.setTranslationY(-trans);
setWebViewTranslation(height - trans);
}
};
show.setDuration(250);
show.setInterpolator(new BezierDecelerateInterpolator());
mBrowserFrame.startAnimation(show);
}
}
}
use of acr.browser.lightning.interpolator.BezierDecelerateInterpolator in project Lightning-Browser by anthonycr.
the class HorizontalItemAnimator method animateAddImpl.
private void animateAddImpl(final ViewHolder holder) {
final View view = holder.itemView;
final ViewPropertyAnimatorCompat animation = ViewCompat.animate(view);
mAddAnimations.add(holder);
animation.alpha(1).translationY(0).setInterpolator(new BezierDecelerateInterpolator()).setDuration(getAddDuration()).setListener(new VpaListenerAdapter() {
@Override
public void onAnimationStart(View view) {
dispatchAddStarting(holder);
}
@Override
public void onAnimationCancel(View view) {
ViewCompat.setTranslationY(view, 0);
ViewCompat.setAlpha(view, 1);
}
@Override
public void onAnimationEnd(View view) {
animation.setListener(null);
dispatchAddFinished(holder);
mAddAnimations.remove(holder);
dispatchFinishedWhenDone();
}
}).start();
}
use of acr.browser.lightning.interpolator.BezierDecelerateInterpolator in project Lightning-Browser by anthonycr.
the class VerticalItemAnimator method animateAddImpl.
private void animateAddImpl(final ViewHolder holder) {
final View view = holder.itemView;
final ViewPropertyAnimatorCompat animation = ViewCompat.animate(view);
mAddAnimations.add(holder);
animation.alpha(1).translationX(0).setDuration(getAddDuration()).setInterpolator(new BezierDecelerateInterpolator()).setListener(new VpaListenerAdapter() {
@Override
public void onAnimationStart(View view) {
dispatchAddStarting(holder);
}
@Override
public void onAnimationCancel(View view) {
ViewCompat.setAlpha(view, 1);
ViewCompat.setTranslationX(view, 0);
}
@Override
public void onAnimationEnd(View view) {
animation.setListener(null);
dispatchAddFinished(holder);
mAddAnimations.remove(holder);
dispatchFinishedWhenDone();
}
}).start();
}
use of acr.browser.lightning.interpolator.BezierDecelerateInterpolator in project Lightning-Browser by anthonycr.
the class BrowserActivity method showActionBar.
/**
* Display the ActionBar using an animation if we are in full-screen
* mode. This method also re-parents the ActionBar if its parent is
* incorrect so that the animation can happen correctly.
*/
@Override
public void showActionBar() {
if (mFullScreen) {
Log.d(TAG, "showActionBar");
if (mToolbarLayout == null)
return;
int height = mToolbarLayout.getHeight();
if (height == 0) {
mToolbarLayout.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);
height = mToolbarLayout.getMeasuredHeight();
}
final int totalHeight = height;
if (mToolbarLayout.getTranslationY() < -(height - 0.01f)) {
Animation show = new Animation() {
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
float trans = interpolatedTime * totalHeight;
mToolbarLayout.setTranslationY(trans - totalHeight);
setWebViewTranslation(trans);
}
};
show.setDuration(250);
show.setInterpolator(new BezierDecelerateInterpolator());
mBrowserFrame.startAnimation(show);
}
}
}
Aggregations