/*
 * Copyright (C) 2017 grandcentrix GmbH
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package net.grandcentrix.thirtyinch.internal;

import net.grandcentrix.thirtyinch.TiPresenter;

import android.os.Bundle;
import android.support.annotation.NonNull;

public interface TiPresenterProvider<P extends TiPresenter> {

    /**
     * Function returning a new {@link net.grandcentrix.thirtyinch.TiPresenter} instance
     * <p>
     * called only once when the Activity got initiated. Doesn't get called when the Activity gets
     * recreated. The old presenter will be recovered in {@link android.app.Activity#onCreate(Bundle)}.
     */
    @NonNull
    P providePresenter();
}

@@ -709,34 +709,8 @@
 oid.
-os.Bundle;%0Aimport android.
 supp
@@ -733,16 +733,215 @@
 onNull;%0A
+%0A/**%0A * Provides access to a new instance of a %7B@link TiPresenter%7D which will be attached to%0A * %7B@link net.grandcentrix.thirtyinch.TiActivity%7D or%0A * %7B@link net.grandcentrix.thirtyinch.TiFragment%7D%0A */
 %0Apublic 
@@ -1015,26 +1015,19 @@
   * 
-Function
+Must
  return
-ing
  a n
@@ -1085,16 +1085,197 @@
 instance
+ in %7B@link%0A     * net.grandcentrix.thirtyinch.TiPresenter.State#INITIALIZED%7D state. Never return a %7B@link%0A     * TiPresenter%7D which was already instantiated or is already destroyed.
 %0A     * 
@@ -1285,17 +1285,17 @@
 %0A     * 
-c
+C
 alled on
@@ -1306,110 +1306,216 @@
 nce 
-when the Activity got initiated. Doesn't get called when the Activity gets%0A     * recreated
+per Activity when the presenter should be retained. One call per Activity%0A     * instance is expected when the retain is disabled%0A     * %3C/p%3E%0A     * %3Cp%3E%0A     * Can be called multiple times per Fragment
 . The 
-old p
+P
 rese
@@ -1523,75 +1523,256 @@
 ter 
-will be recovered in %7B@link android.app.Activity#onCreate(Bundle)%7D.
+gets destroyed when the Fragment is%0A     * removed from the %7B@link android.support.v4.app.FragmentManager%7D. When the %7B@link%0A     * android.support.v4.app.Fragment%7D gets added again this method is called to create a new%0A     * presenter.%0A     * %3C/p%3E
 %0A   

Improve providePresenter documentation