title: Smoothly animate view hide / show in linear layout android
body: <p>I have a linearlayout that contains 4 nested linear layouts.  I need to hide the first nested layout and show the 2 and 3 and then hide the 2 and 3 and show the 1st.  I would like to animate these transistions with sliding effects.  So have the 1st slide of the screen and then the 2 and 3 slide on.  I have managed to animate 1 sliding off ( although not very smoothly ) but can't figure out how to do the slide on to go from View.GONE to View.VISIBLE.</p>
  
  <p>Without the animation is I just do setVisiblity on the 1st to hide it and then setVisiblity on the 2/3 to shot them then it is very glitchy and the text overlaps.</p>
  
  <p>See below for the problem I am encountering.</p>
  
  <p>The code that I am using to hide / show currently:</p>
  
  <pre><code>        LinearLayout item2= (LinearLayout) rootView.findViewById(R.id.item2);
          LinearLayout item1= (LinearLayout) rootView.findViewById(R.id.item2);
  
              item1.setVisibility(View.GONE);
              item2.setVisibility(View.VISIBLE);
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/hiC1v.png" alt="enter image description here"></p>