Show and hide a View with a slide up/down animation

With the new animation API that was introduced in Android 3.0 (Honeycomb) it is very simple to create such animations. Sliding a View down by a distance: view.animate().translationY(distance); You can later slide the View back to its original position like this: view.animate().translationY(0); You can also easily combine multiple animations. The following animation will slide a … Read more

Animate change of view background color on Android

You can use new Property Animation Api for color animation: int colorFrom = getResources().getColor(R.color.red); int colorTo = getResources().getColor(R.color.blue); ValueAnimator colorAnimation = ValueAnimator.ofObject(new ArgbEvaluator(), colorFrom, colorTo); colorAnimation.setDuration(250); // milliseconds colorAnimation.addUpdateListener(new AnimatorUpdateListener() { @Override public void onAnimationUpdate(ValueAnimator animator) { textView.setBackgroundColor((int) animator.getAnimatedValue()); } }); colorAnimation.start(); For backward compatibility with Android 2.x use Nine Old Androids library from Jake … Read more

How to have multiple CSS transitions on an element?

Transition properties are comma delimited in all browsers that support transitions: .nav a { transition: color .2s, text-shadow .2s; } ease is the default timing function, so you don’t have to specify it. If you really want linear, you will need to specify it: transition: color .2s linear, text-shadow .2s linear; This starts to get … Read more

Android: Expand/collapse animation

I see that this question became popular so I post my actual solution. The main advantage is that you don’t have to know the expanded height to apply the animation and once the view is expanded, it adapts height if content changes. It works great for me. public static void expand(final View v) { int … Read more

How do I animate constraint changes?

Two important notes: You need to call layoutIfNeeded within the animation block. Apple actually recommends you call it once before the animation block to ensure that all pending layout operations have been completed You need to call it specifically on the parent view (e.g. self.view), not the child view that has the constraints attached to … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)