title: Android ObjectAnimator Flicker on Second Animation
body: <p>I have a view (sendSidePanel) which I hide when the view is rendered:</p>
  
  <pre><code>public void setListnerToRootView(){
     final View activityRootView = getWindow().getDecorView().findViewById(android.R.id.content); 
     final RelativeLayout sendSlidePanelFinal = (RelativeLayout)findViewById(R.id.sendSlidePanel);
     final ViewTreeObserver observer = activityRootView.getViewTreeObserver();
     observer.addOnGlobalLayoutListener(new OnGlobalLayoutListener() {
         @Override
         public void onGlobalLayout() {
             ViewHelper.setTranslationY(sendSlidePanel, sendSlidePanelFinal.getHeight());
         }
     });
  }
  </code></pre>
  
  <p>I them use ObjectAnimator to animate the View up and down upon button press:</p>
  
  <pre><code>if(panelDown){
      ObjectAnimator anim = ObjectAnimator.ofFloat(sendSlidePanel, "translationY", 0);
      panelDown=false;
  }
  else{
      ObjectAnimator anim = ObjectAnimator.ofFloat(sendSlidePanel, "translationY", chatPanel.getHeight());
      panelDown=true;
   }
  </code></pre>
  
  <p>Problem is, when i want to animate the panel down (aka panelDown==false), there will be a slight flicker of the view (sendSlidePanel) before it animates down.</p>
  
  <p>I did try, however, not hiding the view at first, and animating it down on button click. The flicker doesn't happen in this case. It appears that only after an initial animation that the flicker happens.</p>
  
  <p>I have even tried, but to no avail:</p>
  
  <pre><code>public void onAnimationEnd(Animator arg0) {
      //Attempt to get rid of flicker
      sendSlidePanel.clearAnimation();
      sendSlidePanel.requestLayout();                 
  }
  </code></pre>
  
  <p>And even this, but to no avail:
  <a href="https://stackoverflow.com/questions/9387711/android-animation-flicker">Android Animation Flicker</a></p>
  
  <p>Please help, thanks!</p>