I want that the fragment enter after the creation of activity instead enter togheter
My code
import android.os.Bundle;
import android.app.Fragment;
import android.app.FragmentTransaction;
public class TranslucentActivity extends Activity {
//....
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.translucent);
}
@Override
protected void onResume() {
// TODO Auto-generated method stub
android.app.Fragment fragment = new ViewDetail();
android.app.FragmentManager fragmentManager = getFragmentManager();
android.app.FragmentTransaction ft = fragmentManager.beginTransaction();
//ft.setCustomAnimations(R.anim.trans_left_in,R.anim.trans_left_out);
ft.setCustomAnimations(R.animator.trans_left_in,R.animator.trans_left_out);// now work but is wrong the animation because enter with the activity
ft.addToBackStack(null);
ft.replace(R.id.container, fragment);
ft.commit();
fragmentManager.executePendingTransactions();
super.onResume();
}
}
trans_left_in.xml
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromXDelta="100%p"
android:toXDelta="0"
android:duration="@android:integer/config_longAnimTime"/>
</set>
trans_left_out.xml
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromXDelta="0"
android:toXDelta="100%p"
android:duration="@android:integer/config_longAnimTime"/>
</set>