// Path: app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/common/view/BaseViewFragment.java
// public abstract class BaseViewFragment<T extends Presenter> extends BaseFragment
//         implements MVPView {
// 
//     @Inject
//     protected T presenter;
// 
//     @Override
//     public void onViewStateRestored(Bundle savedInstanceState) {
//         super.onViewStateRestored(savedInstanceState);
//         /*
//          * The Presenter.onStart method is called in onViewStateRestored so that the Fragment’s
//          * views are bound before the presentation begins. This ensures that no NullPointerException
//          * occurs if the Presenter calls an MVPView method that uses a bound view.
//          *
//          * Furthermore, Fragments that do not return a non-null View in onCreateView will result in
//          * onViewStateRestored not being called. This results in Presenter.onStart not being
//          * invoked. Therefore, no-UI Fragments do not support Presenter-View pairs. We could modify
//          * our code to support Presenter-View pairs in no-UI Fragments if needed. However, I will
//          * keep things as is since I do not consider it appropriate to have a Presenter-View pair
//          * in a no-UI Fragment. Do feel free to disagree and refactor.
//          */
//         presenter.onStart(savedInstanceState);
//     }
// 
//     @Override
//     public void onResume() {
//         super.onResume();
//         presenter.onResume();
//     }
// 
//     @Override
//     public void onPause() {
//         super.onPause();
//         presenter.onPause();
//     }
// 
//     @CallSuper
//     @Override
//     public void onSaveInstanceState(Bundle outState) {
//         super.onSaveInstanceState(outState);
//         presenter.onSaveInstanceState(outState);
//     }
// 
//     @Override
//     public void onDestroyView() {
//         presenter.onEnd();
//         super.onDestroyView();
//     }
// }
// 
// Path: app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/example_3/child_fragment/presenter/Example3ChildPresenter.java
// public interface Example3ChildPresenter extends Presenter {
// 
//     void onDoSomething();
// }


import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.vestrel00.daggerbutterknifemvp.R;
import com.vestrel00.daggerbutterknifemvp.ui.common.view.BaseViewFragment;
import com.vestrel00.daggerbutterknifemvp.ui.example_3.child_fragment.presenter.Example3ChildPresenter;
import butterknife.BindView;
import butterknife.OnClick;
/*
 * Copyright 2018 Vandolf Estrellado
 *
 * 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.vestrel00.daggerbutterknifemvp.ui.example_3.child_fragment.view;




/**
 * A fragment implementation of {@link Example3ChildView}.
 */
public final class Example3ChildFragment extends BaseViewFragment<Example3ChildPresenter>
        implements Example3ChildView {

    @BindView(R.id.some_text)
    TextView someText;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        return inflater.inflate(R.layout.example_3_child_fragment, container, false);
    }

    @Override
    public void showSomething(String something) {
        someText.setText(something);
    }

// Path: app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/common/view/BaseViewFragment.java
// public abstract class BaseViewFragment<T extends Presenter> extends BaseFragment
//         implements MVPView {
// 
//     @Inject
//     protected T presenter;
// 
//     @Override
//     public void onViewStateRestored(Bundle savedInstanceState) {
//         super.onViewStateRestored(savedInstanceState);
//         /*
//          * The Presenter.onStart method is called in onViewStateRestored so that the Fragment’s
//          * views are bound before the presentation begins. This ensures that no NullPointerException
//          * occurs if the Presenter calls an MVPView method that uses a bound view.
//          *
//          * Furthermore, Fragments that do not return a non-null View in onCreateView will result in
//          * onViewStateRestored not being called. This results in Presenter.onStart not being
//          * invoked. Therefore, no-UI Fragments do not support Presenter-View pairs. We could modify
//          * our code to support Presenter-View pairs in no-UI Fragments if needed. However, I will
//          * keep things as is since I do not consider it appropriate to have a Presenter-View pair
//          * in a no-UI Fragment. Do feel free to disagree and refactor.
//          */
//         presenter.onStart(savedInstanceState);
//     }
// 
//     @Override
//     public void onResume() {
//         super.onResume();
//         presenter.onResume();
//     }
// 
//     @Override
//     public void onPause() {
//         super.onPause();
//         presenter.onPause();
//     }
// 
//     @CallSuper
//     @Override
//     public void onSaveInstanceState(Bundle outState) {
//         super.onSaveInstanceState(outState);
//         presenter.onSaveInstanceState(outState);
//     }
// 
//     @Override
//     public void onDestroyView() {
//         presenter.onEnd();
//         super.onDestroyView();
//     }
// }
// 
// Path: app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/example_3/child_fragment/presenter/Example3ChildPresenter.java
// public interface Example3ChildPresenter extends Presenter {
// 
//     void onDoSomething();
// }


// Path: app/src/main/java/com/vestrel00/daggerbutterknifemvp/ui/example_3/child_fragment/view/Example3ChildFragment.java
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.vestrel00.daggerbutterknifemvp.R;
import com.vestrel00.daggerbutterknifemvp.ui.common.view.BaseViewFragment;
import com.vestrel00.daggerbutterknifemvp.ui.example_3.child_fragment.presenter.Example3ChildPresenter;
import butterknife.BindView;
import butterknife.OnClick;

/*
 * Copyright 2018 Vandolf Estrellado
 *
 * 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.vestrel00.daggerbutterknifemvp.ui.example_3.child_fragment.view;




/**
 * A fragment implementation of {@link Example3ChildView}.
 */
public final class Example3ChildFragment extends BaseViewFragment<Example3ChildPresenter>
        implements Example3ChildView {

    @BindView(R.id.some_text)
    TextView someText;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        return inflater.inflate(R.layout.example_3_child_fragment, container, false);
    }

    @Override
    public void showSomething(String something) {
        someText.setText(something);
    }

    @OnClick(R.id.do_something)