title: Fragment animation during transaction - Only Left slide in works and Right Slide in does not
body: <p>I am doing fragment animation during transaction but I am able to do only left slide in. Right slide animation does not affect anything.
  Please help: I have tried everything and searched on google and other stackoverflow questions and did all the things they suggested. Still right slide in animation is not doing anything.</p>
  
  <p>Below is the fragment activity :</p>
  
  <pre><code>public class MainActivity extends FragmentActivity {
      static FragmentManager manager;
  
      String arr1[] = { "One", "Two", "Three", "Four", "Five", "Six", "Seven" };
      String arr2[] = { "One2", "Two2", "Three2", "Four2", "Five2", "Six2",
              "Seven2" };
      String arr3[] = { "One23", "Two23", "Three23", "Four23", "Five23", "Six23",
              "Seven23" };
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          manager = getSupportFragmentManager();
          StartTransaction(arr1);
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.main, menu);
          return true;
      }
  
      public static void StartTransaction(String arr[]) {
          FragmentOne one = new FragmentOne();
          Bundle b = new Bundle();
          b.putStringArray("array", arr);
          one.setArguments(b);
          FragmentTransaction transaction = manager.beginTransaction();
  
          // PROblem is here
  
          transaction.setCustomAnimations(R.anim.slide_right, R.anim.slide_left);// ,R.anim.slide_right,R.anim.slide_left);
          transaction.replace(R.id.container, one);
          // transaction.addToBackStack(null);
          transaction.commit();
      }
  
      private void MoveOneLevelUp() {
          FragmentOne one = new FragmentOne();
          Bundle b = new Bundle();
          b.putInt("moveup", 1);
          one.setArguments(b);
          FragmentTransaction transaction = manager.beginTransaction();
          transaction.setCustomAnimations(R.anim.slide_left, R.anim.slide_right,
                  R.anim.slide_right, R.anim.slide_left);
          transaction.replace(R.id.container, one);
          transaction.addToBackStack(null);
          transaction.commit();
      }
  }
  </code></pre>
  
  <p>Here is the Fragment code :</p>
  
  <pre><code>public class FragmentOne extends Fragment implements OnItemClickListener {
  
      Activity activity;
      ListView list;
      View v;
      String arr1[] = {"One","Two","Three","Four","Five","Six","Seven"};
      String arr2[] = { "One2", "Two2", "Three2", "Four2", "Five2", "Six2",
      "Seven2" };
      String arr3[] = { "One23", "Two23", "Three23", "Four23", "Five23", "Six23",
      "Seven23" };
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
      }
  
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
              Bundle savedInstanceState) {
          activity = getActivity();
  
          String array[] = getArguments().getStringArray("array");
  
          v = LayoutInflater.from(activity).inflate(R.layout.first_view, null);
  
          list = (ListView)v.findViewById(R.id.listview);
          list.setOnItemClickListener(this);
          ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(getActivity(), android.R.layout.simple_list_item_1, array);
          list.setAdapter(adapter);
          return v;
          // return super.onCreateView(inflater, container, savedInstanceState);
      }
  
      @Override
      public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int position, long arg3) {
          if(position ==2) {
              MainActivity.StartTransaction(arr2);
          } else {
              MainActivity.StartTransaction(arr3);
          }
      }
  }
  </code></pre>
  
  <p>Slide left anim xml :</p>
  
  <pre><code>        &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;set xmlns:android="http://schemas.android.com/apk/res/android" &gt;
      &lt;translate
          android:duration="700"
          android:fromXDelta="-100%"
          android:toXDelta="0%" &gt;
      &lt;/translate&gt;
  &lt;/set&gt;
  </code></pre>
  
  <p>Slide right xml :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;`enter code here`
  &lt;set xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;translate
          android:duration="700"
          android:fromXDelta="0%"
          android:toXDelta="100%" &gt;
      &lt;/translate&gt;
  &lt;/set&gt;
  </code></pre>