Code example for TranslateAnimation

Methods: setAnimationListenersetDurationsetFillAfter

                anim = new TranslateAnimation(0, left, 0, 0);
                animParams.init(left, 0, left + w, h);
            } else { 
                // anim = AnimationUtils.loadAnimation(context, R.anim.push_left_in_80); 
                anim = new TranslateAnimation(0, -left, 0, 0);
                animParams.init(0, 0, w, h);
            //Tell the animation to stay as it ended (we are going to set the app.layout first than remove this property) 
            // Only use fillEnabled and fillAfter if we don't call layout ourselves. 
            // We need to do the layout ourselves and not use fillEnabled and fillAfter because when the anim is finished 
            // although the View appears to have moved, it is actually just a drawing effect and the View hasn't moved. 
            // Therefore clicking on the screen where the button appears does not work, but clicking where the View *was* does 
            // work.