use of android.view.animation.TranslateAnimation in project TourGuide by worker8.
the class ToolTipCustomizationActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mActivity = this;
setContentView(R.layout.activity_customization);
Button button = (Button) findViewById(R.id.button);
Animation animation = new TranslateAnimation(0f, 0f, 200f, 0f);
animation.setDuration(1000);
animation.setFillAfter(true);
animation.setInterpolator(new BounceInterpolator());
ToolTip toolTip = new ToolTip().setTitle("Next Button").setDescription("Click on Next button to proceed...").setTextColor(Color.parseColor("#bdc3c7")).setBackgroundColor(Color.parseColor("#e74c3c")).setShadow(true).setGravity(Gravity.TOP | Gravity.LEFT).setEnterAnimation(animation);
mTutorialHandler = TourGuide.init(this).with(TourGuide.Technique.CLICK).setToolTip(toolTip).setOverlay(new Overlay()).setPointer(new Pointer()).playOn(button);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
mTutorialHandler.cleanUp();
}
});
}
use of android.view.animation.TranslateAnimation in project ZI by yixia.
the class DefaultAnimationsBuilder method buildDefaultSlideOutUpAnimation.
/**
* @return The default Animation for a hiding {@link Crouton}.
*/
public static Animation buildDefaultSlideOutUpAnimation() {
if (null == slideOutUpAnimation) {
slideOutUpAnimation = new TranslateAnimation(SlideOutUpAnimationParameters.FROM_X_DELTA, SlideOutUpAnimationParameters.TO_X_DELTA, SlideOutUpAnimationParameters.FROM_Y_DELTA, SlideOutUpAnimationParameters.TO_Y_DELTA);
slideOutUpAnimation.setDuration(SlideOutUpAnimationParameters.DURATION);
}
return slideOutUpAnimation;
}
use of android.view.animation.TranslateAnimation in project PhotoNoter by yydcdut.
the class PGEditSeekbarLayout method hideWithAnimation.
public void hideWithAnimation(Animation.AnimationListener animationListener) {
if (mSeekBarParentView != null) {
AlphaAnimation showAlphaAnimation = new AlphaAnimation(1f, 0f);
showAlphaAnimation.setDuration(300l);
showAlphaAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
showAlphaAnimation.setAnimationListener(animationListener);
mSeekBarParentView.startAnimation(showAlphaAnimation);
}
float bottomHeight = getContext().getResources().getDimension(R.dimen.pg_sdk_edit_second_bottom_down_height);
TranslateAnimation translateAnimation = new TranslateAnimation(0f, 0f, 0f, bottomHeight);
translateAnimation.setDuration(300l);
translateAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
mBottomView.startAnimation(translateAnimation);
}
use of android.view.animation.TranslateAnimation in project PhotoNoter by yydcdut.
the class PGEditView method hideBottomSecondMenuWithAnimation.
public void hideBottomSecondMenuWithAnimation() {
if (Build.VERSION.SDK_INT >= 11) {
float secondBottomHeight = mActivity.getResources().getDimension(R.dimen.pg_sdk_edit_second_bottom_height);
TranslateAnimation translateAnimation = new TranslateAnimation(0f, 0f, 0f, secondBottomHeight);
translateAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
translateAnimation.setDuration(ANIMATION_TIME);
translateAnimation.setAnimationListener(new AnimationAdapter() {
@Override
public void onAnimationEnd(Animation animation) {
mActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
if (null != mMenuListener) {
mMenuListener.onHideBottomSecondMenuWithAnimationFinish();
}
}
});
}
});
mSecondMenusLayout.startAnimation(translateAnimation);
mFirstHorizontalLayout.setVisibility(View.VISIBLE);
float bottomHeight = mActivity.getResources().getDimension(R.dimen.pg_sdk_edit_bottom_height);
TranslateAnimation firstTranslateAnimation = new TranslateAnimation(0f, 0f, bottomHeight, 0f);
firstTranslateAnimation.setDuration(ANIMATION_TIME);
firstTranslateAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
AlphaAnimation firstAlphaAnimation = new AlphaAnimation(0f, 1f);
firstAlphaAnimation.setDuration(ANIMATION_TIME);
firstAlphaAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
AnimationSet animationSet = new AnimationSet(true);
animationSet.addAnimation(firstTranslateAnimation);
animationSet.addAnimation(firstAlphaAnimation);
mFirstHorizontalLayout.startAnimation(animationSet);
} else {
if (null != mMenuListener) {
mMenuListener.onHideBottomSecondMenuWithAnimationFinish();
}
mFirstHorizontalLayout.setVisibility(View.VISIBLE);
}
}
use of android.view.animation.TranslateAnimation in project WordPress-Android by wordpress-mobile.
the class AniUtils method animateBar.
private static void animateBar(View view, boolean show, boolean isTopBar, Duration duration) {
int newVisibility = (show ? View.VISIBLE : View.GONE);
if (view == null || view.getVisibility() == newVisibility) {
return;
}
float fromY;
float toY;
if (isTopBar) {
fromY = (show ? -1f : 0f);
toY = (show ? 0f : -1f);
} else {
fromY = (show ? 1f : 0f);
toY = (show ? 0f : 1f);
}
Animation animation = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF, fromY, Animation.RELATIVE_TO_SELF, toY);
long durationMillis = duration.toMillis(view.getContext());
animation.setDuration(durationMillis);
if (show) {
animation.setInterpolator(new DecelerateInterpolator());
} else {
animation.setInterpolator(new AccelerateInterpolator());
}
view.clearAnimation();
view.startAnimation(animation);
view.setVisibility(newVisibility);
}
Aggregations