// Path: nibo_library/src/main/java/com/alium/nibo/mvp/contract/NiboPresentable.java
// public interface NiboPresentable<V extends NiboViewable> {
// 
//     /**
//      * Every NiboPresentable must implement onStart state
//      */
//     void onStart();
// 
//     /**
//      * Every NiboPresentable must implement onViewCreated state
//      */
//     void onViewCreated();
// 
//     /**
//      * Every NiboPresentable must implement onResume state
//      */
//     void onResume();
// 
// 
//     /**
//      * Every NiboPresentable must implement onPause state
//      */
//     void onPause();
// 
// 
//     /**
//      * Every NiboPresentable must implement onStop state
//      */
//     void onStop();
// 
// 
//     /**
//      * Every NiboPresentable must attach a NiboViewable
//      *
//      * @param viewable NiboViewable
//      */
//     void attachView(@NonNull V viewable);
// 
// 
//     /**
//      * Every NiboPresentable must detach its NiboViewable
//      */
//     void detachView();
// 
// 
//     /**
//      * Every NiboPresentable must be able to access to its attached View
//      *
//      * @return V NiboViewable
//      */
//     V getView();
// 
// 
//     /**
//      * Every NiboPresentable must know if it's view is attached
//      */
//     boolean isViewAttached();
// 
// 
// 
//     /**
//      * Every NiboPresentable must know if it's view is attached
//      */
//     void checkViewAttached();
// 
// 
//     /**
//      * Every NiboPresentable needs an API key
//      */
//     void setGoogleAPIKey(String apiKey);
// }
// 
// Path: nibo_library/src/main/java/com/alium/nibo/mvp/contract/NiboViewable.java
// public interface NiboViewable<T> {
// 
//     /**
//      * Every NiboViewable must be able to access to its attached Presenter
//      *
//      * @return NiboPresentable
//      */
//     T getPresenter();
// 
//     /**
//      * Every NiboViewable must be able to inject its Presenter
//      *
//      * @param presenter NiboPresentable
//      */
//     void injectPresenter(T presenter);
// 
//     /**
//      * Every NiboViewable must have a error message system
//      */
//     void displayError(String message);
// 
//     /**
//      * Every NiboViewable must have a error message system
//      */
//     void displayError(int messageId);
// 
//     /**
//      * Every NiboViewable must implement one show loading feature
//      */
//     void showLoading();
// 
//     /**
//      * Every NiboViewable must implement one hide loading feature
//      */
//     void hideLoading();
// 
// 
//     void close();
// 
// 
//     void injectDependencies();
// 
//     void attachToPresenter();
// 
//     void detachFromPresenter();
// 
//     void onLandscape();
// 
//     void onPortrait();
// 
//     void displayMessage(String message);
// 
//     void showNoNetwork();
// 
//     Context getContext();
// 
//     void connectGoogleApiClient();
// 
// }


import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import android.support.v4.util.Pair;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.alium.nibo.mvp.contract.NiboPresentable;
import com.alium.nibo.mvp.contract.NiboViewable;
/*******************************************************************************
 * Copyright (c) 2017 Francisco Gonzalez-Armijo Riádigos
 *
 * 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 com.alium.nibo.mvp;



public abstract class BaseNiboFragment<T extends NiboPresentable> extends Fragment implements NiboViewable<T> {

    protected T presenter;

    /**
     * {@inheritDoc}
     */
    @Override
    public void onStart() {
        super.onStart();
        if (getPresenter() != null) {
            getPresenter().onStart();
        }
    }

    public static final String ARGS_INSTANCE = "com.moehandi.instafragment";


    /**
     * {@inheritDoc}
     */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setRetainInstance(true);
    }

    /**
     * {@inheritDoc}
     */
    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(getLayoutId(), container, false);
        //noinspection unchecked
// Path: nibo_library/src/main/java/com/alium/nibo/mvp/contract/NiboPresentable.java
// public interface NiboPresentable<V extends NiboViewable> {
// 
//     /**
//      * Every NiboPresentable must implement onStart state
//      */
//     void onStart();
// 
//     /**
//      * Every NiboPresentable must implement onViewCreated state
//      */
//     void onViewCreated();
// 
//     /**
//      * Every NiboPresentable must implement onResume state
//      */
//     void onResume();
// 
// 
//     /**
//      * Every NiboPresentable must implement onPause state
//      */
//     void onPause();
// 
// 
//     /**
//      * Every NiboPresentable must implement onStop state
//      */
//     void onStop();
// 
// 
//     /**
//      * Every NiboPresentable must attach a NiboViewable
//      *
//      * @param viewable NiboViewable
//      */
//     void attachView(@NonNull V viewable);
// 
// 
//     /**
//      * Every NiboPresentable must detach its NiboViewable
//      */
//     void detachView();
// 
// 
//     /**
//      * Every NiboPresentable must be able to access to its attached View
//      *
//      * @return V NiboViewable
//      */
//     V getView();
// 
// 
//     /**
//      * Every NiboPresentable must know if it's view is attached
//      */
//     boolean isViewAttached();
// 
// 
// 
//     /**
//      * Every NiboPresentable must know if it's view is attached
//      */
//     void checkViewAttached();
// 
// 
//     /**
//      * Every NiboPresentable needs an API key
//      */
//     void setGoogleAPIKey(String apiKey);
// }
// 
// Path: nibo_library/src/main/java/com/alium/nibo/mvp/contract/NiboViewable.java
// public interface NiboViewable<T> {
// 
//     /**
//      * Every NiboViewable must be able to access to its attached Presenter
//      *
//      * @return NiboPresentable
//      */
//     T getPresenter();
// 
//     /**
//      * Every NiboViewable must be able to inject its Presenter
//      *
//      * @param presenter NiboPresentable
//      */
//     void injectPresenter(T presenter);
// 
//     /**
//      * Every NiboViewable must have a error message system
//      */
//     void displayError(String message);
// 
//     /**
//      * Every NiboViewable must have a error message system
//      */
//     void displayError(int messageId);
// 
//     /**
//      * Every NiboViewable must implement one show loading feature
//      */
//     void showLoading();
// 
//     /**
//      * Every NiboViewable must implement one hide loading feature
//      */
//     void hideLoading();
// 
// 
//     void close();
// 
// 
//     void injectDependencies();
// 
//     void attachToPresenter();
// 
//     void detachFromPresenter();
// 
//     void onLandscape();
// 
//     void onPortrait();
// 
//     void displayMessage(String message);
// 
//     void showNoNetwork();
// 
//     Context getContext();
// 
//     void connectGoogleApiClient();
// 
// }


// Path: nibo_library/src/main/java/com/alium/nibo/mvp/BaseNiboFragment.java
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.StringRes;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import android.support.v4.util.Pair;
import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.alium.nibo.mvp.contract.NiboPresentable;
import com.alium.nibo.mvp.contract.NiboViewable;

/*******************************************************************************
 * Copyright (c) 2017 Francisco Gonzalez-Armijo Riádigos
 *
 * 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 com.alium.nibo.mvp;



public abstract class BaseNiboFragment<T extends NiboPresentable> extends Fragment implements NiboViewable<T> {

    protected T presenter;

    /**
     * {@inheritDoc}
     */
    @Override
    public void onStart() {
        super.onStart();
        if (getPresenter() != null) {
            getPresenter().onStart();
        }
    }

    public static final String ARGS_INSTANCE = "com.moehandi.instafragment";


    /**
     * {@inheritDoc}
     */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setRetainInstance(true);
    }

    /**
     * {@inheritDoc}
     */
    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(getLayoutId(), container, false);
        //noinspection unchecked
        injectDependencies();