Note that there are some explanatory texts on larger screens.

plurals
  1. POandroid translate animation clips the part of view not shown on screen
    text
    copied!<p>I have a Relative Layout containing some textviews which floats over a gridview. When I select an item in the grid, the layout moves down to nearly the end of the screen and only about 1/5th of it is visible. This is done using simple Translate Animation. Now when I click another button in the grid, I need to Relative Layout to move back to its original position on top of the gridview. I did this also with Translate Animation and this is happnening, but only the portion of the RelativeLayout which was visible when it was collapsed is translating (moving) and the other portion becomes visible after animation has ended. This looks really ugly.</p> <p>I know that Android doesnt draw the portion of the view that is not visible on the screen. Is there a way to force draw the full portion ?</p> <p>My Animation code is given below:</p> <pre><code> public void smoothExpanderAnimate(final int finalTarget,final RelativeLayout expander,final int animateToY,final boolean setExpanded,final boolean refreshGrid) { final RelativeLayout.LayoutParams head_params = (RelativeLayout.LayoutParams)expander.getLayoutParams(); TranslateAnimation anim = new TranslateAnimation(0f, 0f, 0f, animateToY); anim.setDuration(400); //timeListHeight = list.getHeight(); //anim.setFillAfter(true); anim.setAnimationListener(new AnimationListener() { @Override public void onAnimationStart(Animation animation) { //Should I try something here ? } @Override public void onAnimationRepeat(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { head_params.topMargin = finalTarget; expander.clearAnimation(); expander.setLayoutParams(head_params); isExpanded = setExpanded; isAnimating = false; if(!setExpanded) { setChildHeight(timeListHeight, list); } } }); isAnimating = true; expander.startAnimation(anim); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload