package com.churches.by.ui;

import android.os.Bundle;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.AppCompatActivity;

import com.churches.by.R;
import com.churches.by.data.model.Church;
import com.churches.by.ui.churcheslist.ChurchListFragment;
import com.churches.by.ui.details.DetailsFragment;

public class MainActivity extends AppCompatActivity
        implements OnChurchInteractionListener,
        DetailsFragment.Listener {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        final ChurchListFragment fragment = ChurchListFragment.newInstance();
        FragmentManager fragmentManager = getSupportFragmentManager();
        fragmentManager.beginTransaction()
                .replace(R.id.container, fragment)
                .commit();
    }

    @Override
    public void onChurchClicked(Church church) {
        final DetailsFragment fragment = DetailsFragment.newInstance(church);
        FragmentManager fragmentManager = getSupportFragmentManager();
        fragmentManager.beginTransaction()
                .replace(R.id.container, fragment)
                .addToBackStack("")
                .commit();
    }

    @Override
    public void onSettingsClicked() {
        new AboutDialog().show(getSupportFragmentManager(), "about");
    }

}

@@ -95,16 +95,67 @@
 anager;%0A
+import android.support.v4.app.FragmentTransaction;%0A
 import a
@@ -1250,32 +1250,106 @@
 iner, fragment)%0A
+                .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)%0A
                 

add transition when change fragments