package fi.bitrite.android.ws.ui;

import android.os.Bundle;
import android.support.v4.app.Fragment;

import javax.inject.Inject;

import fi.bitrite.android.ws.di.Injectable;
import fi.bitrite.android.ws.ui.util.ActionBarTitleHelper;
import fi.bitrite.android.ws.ui.util.NavigationController;
import io.reactivex.disposables.CompositeDisposable;

public abstract class BaseFragment extends Fragment implements Injectable {

    @Inject ActionBarTitleHelper mActionBarTitleHelper;

    private CompositeDisposable mCreateDestroyDisposable = new CompositeDisposable();
    private CompositeDisposable mResumePauseDisposable = new CompositeDisposable();

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mCreateDestroyDisposable = new CompositeDisposable();
    }
    @Override
    public void onResume() {
        super.onResume();

        mResumePauseDisposable = new CompositeDisposable();
        setTitle(getTitle());
    }
    @Override
    public void onPause() {
        mResumePauseDisposable.dispose();
        super.onPause();
    }
    @Override
    public void onDestroy() {
        mCreateDestroyDisposable.dispose();
        super.onDestroy();
    }

    protected abstract CharSequence getTitle();
    protected void setTitle(CharSequence title) {
        mActionBarTitleHelper.set(title);
    }

    NavigationController getNavigationController() {
        return ((MainActivity)getActivity()).getNavigationController();
    }

    CompositeDisposable getCreateDestroyDisposable() {
        return mCreateDestroyDisposable;
    }
    CompositeDisposable getResumePauseDisposable() {
        return mResumePauseDisposable;
    }
}

@@ -81,23 +81,203 @@
 ort.
-v4.app.Fragment
+annotation.NonNull;%0Aimport android.support.annotation.Nullable;%0Aimport android.support.v4.app.Fragment;%0Aimport android.view.LayoutInflater;%0Aimport android.view.View;%0Aimport android.view.ViewGroup
 ;%0A%0Ai
@@ -736,24 +736,196 @@
 sposable();%0A
+    private CompositeDisposable mCreateDestroyViewDisposable = new CompositeDisposable();%0A    private CompositeDisposable mStartStopDisposable = new CompositeDisposable();%0A
     private 
@@ -1169,32 +1169,46 @@
 osable();%0A    %7D%0A
+    @Nullable%0A
     @Override%0A  
@@ -1220,40 +1220,468 @@
 lic 
-void onResume() %7B%0A        super.
+View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,%0A                             @Nullable Bundle savedInstanceState) %7B%0A        mCreateDestroyViewDisposable = new CompositeDisposable();%0A        return super.onCreateView(inflater, container, savedInstanceState);%0A    %7D%0A    @Override%0A    public void onStart() %7B%0A        mStartStopDisposable = new CompositeDisposable();%0A        super.onStart();%0A    %7D%0A    @Override%0A    public void 
 onRe
@@ -1686,18 +1686,18 @@
 Resume()
-;%0A
+ %7B
 %0A       
@@ -1741,32 +1741,58 @@
 teDisposable();%0A
+        super.onResume();%0A
         setTitle
@@ -1932,32 +1932,276 @@
 %7D%0A    @Override%0A
+    public void onStop() %7B%0A        mStartStopDisposable.dispose();%0A        super.onStop();%0A    %7D%0A    @Override%0A    public void onDestroyView() %7B%0A        mCreateDestroyViewDisposable.dispose();%0A        super.onDestroyView();%0A    %7D%0A    @Override%0A
     public void 
@@ -2669,24 +2669,228 @@
 able;%0A    %7D%0A
+    CompositeDisposable getCreateDestroyViewDisposable() %7B%0A        return mCreateDestroyViewDisposable;%0A    %7D%0A    CompositeDisposable getStartStopDisposable() %7B%0A        return mStartStopDisposable;%0A    %7D%0A
     Composit

Add more lifecycle disposables to BaseFragment