// Path: core/src/main/java/com/christianbahl/appkit/core/activity/CBActivityMvpToolbarFragment.java
// public abstract class CBActivityMvpToolbarFragment<CV extends View, M, V extends MvpLceView<M>, P extends MvpPresenter<V>>
//     extends CBActivityMvpToolbar<CV, M, V, P> {
// 
//   @Override protected void onCreate(Bundle savedInstanceState) {
//     super.onCreate(savedInstanceState);
// 
//     if (savedInstanceState == null) {
//       Fragment fragment = createFragmentToDisplay();
// 
//       if (fragment == null) {
//         throw new NullPointerException("Fragment is null. Did you return null in createFragmentToDisplay()?");
//       }
// 
//       getSupportFragmentManager().beginTransaction().replace(getFragmentContainerViewRes(), fragment).commit();
//     }
//   }
// 
//   @Override @NonNull protected Integer getLayoutRes() {
//     return R.layout.cb_activity_mvp_toolbar_fragment;
//   }
// 
//   /**
//    * <p>
//    * Provide the content view res id for the fragment container.
//    * </p>
//    *
//    * <p>
//    * <b>Default: </b> <code>R.id.contentView</code>
//    * </p>
//    */
//   @NonNull protected Integer getFragmentContainerViewRes() {
//     return R.id.contentView;
//   }
// 
//   /**
//    * <p>
//    * Returns the {@link Fragment} which should be displayed by this activity.
//    * </p>
//    *
//    * @return {@link Fragment}
//    */
//   @NonNull protected abstract Fragment createFragmentToDisplay();
// }
// 
// Path: sample-core/src/main/java/com/christianbahl/appkit/samplecore/activity_fragment/FragmentToDisplay.java
// public class FragmentToDisplay extends Fragment {
// 
//   public static FragmentToDisplay newInstance() {
//     return new FragmentToDisplay();
//   }
// 
//   @Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container,
//       Bundle savedInstanceState) {
//     View v = inflater.inflate(R.layout.fragment_to_display, container, false);
// 
//     ((TextView)v.findViewById(R.id.textView)).setText("Fragment");
// 
//     return v;
//   }
// }
// 
// Path: sample-core/src/main/java/com/christianbahl/appkit/samplecore/common/StringPresenter.java
// public class StringPresenter extends MvpBasePresenter<MvpLceView<String>> {
// 
//   public void loadData(boolean contentPresent) {
//     if (isViewAttached()) {
//       getView().showLoading(contentPresent);
//     }
// 
//     if (new Random().nextInt(10) % 3 == 0) {
//       if (isViewAttached()) {
//         getView().showError(new NullPointerException("No Data found!"), contentPresent);
//       }
//     } else {
//       if (isViewAttached()) {
//         getView().setData("Activity Toolbar Mvp data loaded");
//         getView().showContent();
//       }
//     }
//   }
// }


import android.content.Context;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.widget.FrameLayout;
import android.widget.Toast;
import com.christianbahl.appkit.core.activity.CBActivityMvpToolbarFragment;
import com.christianbahl.appkit.samplecore.activity_fragment.FragmentToDisplay;
import com.christianbahl.appkit.samplecore.common.StringPresenter;
import com.hannesdorfmann.mosby3.mvp.lce.MvpLceView;
package com.christianbahl.appkit.samplecore.activity_toolbar_fragment_mvp;


/**
 * @author Christian Bahl
 */
public class ActivityToolbarFragmentMvp
    extends CBActivityMvpToolbarFragment<FrameLayout, String, MvpLceView<String>, StringPresenter> {

  public static Intent getStartIntent(Context context) {
    return new Intent(context, ActivityToolbarFragmentMvp.class);
  }

  @NonNull @Override protected Fragment createFragmentToDisplay() {
// Path: core/src/main/java/com/christianbahl/appkit/core/activity/CBActivityMvpToolbarFragment.java
// public abstract class CBActivityMvpToolbarFragment<CV extends View, M, V extends MvpLceView<M>, P extends MvpPresenter<V>>
//     extends CBActivityMvpToolbar<CV, M, V, P> {
// 
//   @Override protected void onCreate(Bundle savedInstanceState) {
//     super.onCreate(savedInstanceState);
// 
//     if (savedInstanceState == null) {
//       Fragment fragment = createFragmentToDisplay();
// 
//       if (fragment == null) {
//         throw new NullPointerException("Fragment is null. Did you return null in createFragmentToDisplay()?");
//       }
// 
//       getSupportFragmentManager().beginTransaction().replace(getFragmentContainerViewRes(), fragment).commit();
//     }
//   }
// 
//   @Override @NonNull protected Integer getLayoutRes() {
//     return R.layout.cb_activity_mvp_toolbar_fragment;
//   }
// 
//   /**
//    * <p>
//    * Provide the content view res id for the fragment container.
//    * </p>
//    *
//    * <p>
//    * <b>Default: </b> <code>R.id.contentView</code>
//    * </p>
//    */
//   @NonNull protected Integer getFragmentContainerViewRes() {
//     return R.id.contentView;
//   }
// 
//   /**
//    * <p>
//    * Returns the {@link Fragment} which should be displayed by this activity.
//    * </p>
//    *
//    * @return {@link Fragment}
//    */
//   @NonNull protected abstract Fragment createFragmentToDisplay();
// }
// 
// Path: sample-core/src/main/java/com/christianbahl/appkit/samplecore/activity_fragment/FragmentToDisplay.java
// public class FragmentToDisplay extends Fragment {
// 
//   public static FragmentToDisplay newInstance() {
//     return new FragmentToDisplay();
//   }
// 
//   @Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container,
//       Bundle savedInstanceState) {
//     View v = inflater.inflate(R.layout.fragment_to_display, container, false);
// 
//     ((TextView)v.findViewById(R.id.textView)).setText("Fragment");
// 
//     return v;
//   }
// }
// 
// Path: sample-core/src/main/java/com/christianbahl/appkit/samplecore/common/StringPresenter.java
// public class StringPresenter extends MvpBasePresenter<MvpLceView<String>> {
// 
//   public void loadData(boolean contentPresent) {
//     if (isViewAttached()) {
//       getView().showLoading(contentPresent);
//     }
// 
//     if (new Random().nextInt(10) % 3 == 0) {
//       if (isViewAttached()) {
//         getView().showError(new NullPointerException("No Data found!"), contentPresent);
//       }
//     } else {
//       if (isViewAttached()) {
//         getView().setData("Activity Toolbar Mvp data loaded");
//         getView().showContent();
//       }
//     }
//   }
// }


// Path: sample-core/src/main/java/com/christianbahl/appkit/samplecore/activity_toolbar_fragment_mvp/ActivityToolbarFragmentMvp.java
import android.content.Context;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.widget.FrameLayout;
import android.widget.Toast;
import com.christianbahl.appkit.core.activity.CBActivityMvpToolbarFragment;
import com.christianbahl.appkit.samplecore.activity_fragment.FragmentToDisplay;
import com.christianbahl.appkit.samplecore.common.StringPresenter;
import com.hannesdorfmann.mosby3.mvp.lce.MvpLceView;

package com.christianbahl.appkit.samplecore.activity_toolbar_fragment_mvp;


/**
 * @author Christian Bahl
 */
public class ActivityToolbarFragmentMvp
    extends CBActivityMvpToolbarFragment<FrameLayout, String, MvpLceView<String>, StringPresenter> {

  public static Intent getStartIntent(Context context) {
    return new Intent(context, ActivityToolbarFragmentMvp.class);
  }

  @NonNull @Override protected Fragment createFragmentToDisplay() {
    return FragmentToDisplay.newInstance();