package com.example.jourdanrodrigues.controk;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

public abstract class BaseFragment extends Fragment {
    private OnFragmentInteractionListener mListener;

    public abstract int getFragment();

    public abstract int getTitle();

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(getFragment(), container, false);
        setTitle();
        return view;
    }

    private void setTitle() {
        ActionBar actionBar = ((AppCompatActivity) getActivity()).getSupportActionBar();
        if (actionBar != null) {
            actionBar.setTitle(getTitle());
        }
    }

    @Override
    public void onStart() {
        super.onStart();
        try {
            mListener = (OnFragmentInteractionListener) getActivity();
        } catch (ClassCastException e) {
            throw new ClassCastException(getActivity().toString() + " must implement OnFragmentInteractionListener");
        }
    }

    @Override
    public void onDetach() {
        super.onDetach();
        mListener = null;
    }

    interface OnFragmentInteractionListener {
        void onFragmentInteraction(String string);
    }
}

@@ -288,16 +288,103 @@
 ewGroup;
+%0Aimport android.view.animation.Animation;%0Aimport android.view.animation.AnimationUtils;
 %0A%0Apublic
@@ -795,24 +795,1150 @@
 iew;%0A    %7D%0A%0A
+    @Override%0A    public Animation onCreateAnimation(int transit, boolean enter, int nextAnim) %7B%0A        Animation animation = super.onCreateAnimation(transit, enter, nextAnim);%0A%0A        // Smoothing fragment animations: http://blog.danlew.net/2013/09/03/smoothing_performance_on_fragment_transitions/%0A        if (animation == null && nextAnim != 0) %7B%0A            animation = AnimationUtils.loadAnimation(getActivity(), nextAnim);%0A        %7D else if (animation != null) %7B%0A            final View view = getView();%0A            assert view != null;%0A%0A            view.setLayerType(View.LAYER_TYPE_HARDWARE, null);%0A            animation.setAnimationListener(new Animation.AnimationListener() %7B%0A                public void onAnimationEnd(Animation animation) %7B%0A                    view.setLayerType(View.LAYER_TYPE_NONE, null);%0A                %7D%0A%0A                @Override%0A                public void onAnimationStart(Animation animation) %7B%0A                %7D%0A%0A                @Override%0A                public void onAnimationRepeat(Animation animation) %7B%0A                %7D%0A            %7D);%0A        %7D%0A%0A        return animation;%0A    %7D%0A%0A
     private 

Improve fragment animations.