// Path: library/src/main/java/eu/inloop/viewmodel/IView.java
// public interface IView {
//     /**
//      * This method is used for Data Binding to bind correct layout and variable automatically
//      * Can return null value in case that Data Binding is not used.
//      *
//      * @return defined ViewModelBinding Config for a specific screen.
//      */
//     @Nullable
//     ViewModelBindingConfig getViewModelBindingConfig();
// 
//     /**
//      * Implement this method to remove the ViewModel associated with the Fragment or Activity.
//      * This is usually implemented by calling {@link ViewModelHelper#removeViewModel(Activity)},
//      * see {@link ViewModelBaseActivity#removeViewModel()} and {@link ViewModelBaseFragment#removeViewModel()}.
//      */
//     void removeViewModel();
// }
// 
// Path: library/src/main/java/eu/inloop/viewmodel/base/ViewModelBaseFragment.java
// public abstract class ViewModelBaseFragment<T extends IView, R extends AbstractViewModel<T>> extends Fragment implements IView {
// 
//     @NonNull
//     private final ViewModelHelper<T, R> mViewModelHelper = new ViewModelHelper<>();
// 
//     @CallSuper
//     @Override
//     public void onCreate(@Nullable final Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
// 
//         Class<? extends AbstractViewModel<T>> viewModelClass = getViewModelClass();
//         // try to extract the ViewModel class from the implementation
//         if (viewModelClass == null) {
//             //noinspection unchecked
//             viewModelClass = (Class<? extends AbstractViewModel<T>>) ProxyViewHelper.getGenericType(getClass(), AbstractViewModel.class);
//         }
//         getViewModelHelper().onCreate(requireActivity(), savedInstanceState, viewModelClass, getArguments());
//     }
// 
//     @CallSuper
//     @Override
//     public void onSaveInstanceState(@NonNull final Bundle outState) {
//         super.onSaveInstanceState(outState);
//         getViewModelHelper().onSaveInstanceState(outState);
//     }
// 
//     @CallSuper
//     @Override
//     public void onStart() {
//         super.onStart();
//         getViewModelHelper().onStart();
//     }
// 
//     @CallSuper
//     @Override
//     public void onStop() {
//         super.onStop();
//         getViewModelHelper().onStop();
//     }
// 
//     @CallSuper
//     @Override
//     public void onDestroyView() {
//         getViewModelHelper().onDestroyView(this);
//         super.onDestroyView();
//     }
// 
//     @CallSuper
//     @Override
//     public void onDestroy() {
//         getViewModelHelper().onDestroy(this);
//         super.onDestroy();
//     }
// 
//     @Nullable
//     public Class<R> getViewModelClass() {
//         return null;
//     }
// 
//     /**
//      * @see ViewModelHelper#getViewModel()
//      */
//     @NonNull
//     @SuppressWarnings("unused")
//     public R getViewModel() {
//         return getViewModelHelper().getViewModel();
//     }
// 
//     @Nullable
//     @Override
//     public ViewModelBindingConfig getViewModelBindingConfig() {
//         return null;
//     }
// 
//     @NonNull
//     public ViewModelHelper<T, R> getViewModelHelper() {
//         return mViewModelHelper;
//     }
// 
//     @Override
//     public void removeViewModel() {
//         mViewModelHelper.removeViewModel(requireActivity());
//     }
// 
//     /**
//      * Call this after your view is ready - usually on the end of {@link
//      * Fragment#onViewCreated(View, Bundle)}
//      *
//      * @param view view
//      */
//     protected void setModelView(@NonNull final T view) {
//         getViewModelHelper().setView(view);
//     }
// }
// 
// Path: sample/src/main/java/eu/inloop/viewmodel/sample/viewmodel/SampleArgumentViewModel.java
// public class SampleArgumentViewModel extends AbstractViewModel<IView> {
// 
//     public static final String ARG_INT_USER_ID = "ARG_INT_USER_ID";
// 
//     @Override
//     public void onCreate(@Nullable Bundle arguments, @Nullable Bundle savedInstanceState) {
//         super.onCreate(arguments, savedInstanceState);
// 
//         Log.d("SampleArgumentViewModel", "ViewModel created with argument - " + arguments.getInt(ARG_INT_USER_ID));
//         if (savedInstanceState != null) {
//             Log.d("SampleArgumentViewModel", "Application killed by system, viewmodel is restored");
//         }
//     }
// }


import android.os.Bundle;
import androidx.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import butterknife.ButterKnife;
import eu.inloop.viewmodel.IView;
import eu.inloop.viewmodel.base.ViewModelBaseFragment;
import eu.inloop.viewmodel.sample.R;
import eu.inloop.viewmodel.sample.viewmodel.SampleArgumentViewModel;
package eu.inloop.viewmodel.sample.fragment;




public class SampleBundleFragment extends ViewModelBaseFragment<IView, SampleArgumentViewModel> {

    public static SampleBundleFragment newInstance(int userId) {
        final Bundle bundle = new Bundle();
        bundle.putInt(SampleArgumentViewModel.ARG_INT_USER_ID, userId);

        final SampleBundleFragment fragment = new SampleBundleFragment();
        fragment.setArguments(bundle);
        return fragment;
    }

    @Override
// Path: library/src/main/java/eu/inloop/viewmodel/IView.java
// public interface IView {
//     /**
//      * This method is used for Data Binding to bind correct layout and variable automatically
//      * Can return null value in case that Data Binding is not used.
//      *
//      * @return defined ViewModelBinding Config for a specific screen.
//      */
//     @Nullable
//     ViewModelBindingConfig getViewModelBindingConfig();
// 
//     /**
//      * Implement this method to remove the ViewModel associated with the Fragment or Activity.
//      * This is usually implemented by calling {@link ViewModelHelper#removeViewModel(Activity)},
//      * see {@link ViewModelBaseActivity#removeViewModel()} and {@link ViewModelBaseFragment#removeViewModel()}.
//      */
//     void removeViewModel();
// }
// 
// Path: library/src/main/java/eu/inloop/viewmodel/base/ViewModelBaseFragment.java
// public abstract class ViewModelBaseFragment<T extends IView, R extends AbstractViewModel<T>> extends Fragment implements IView {
// 
//     @NonNull
//     private final ViewModelHelper<T, R> mViewModelHelper = new ViewModelHelper<>();
// 
//     @CallSuper
//     @Override
//     public void onCreate(@Nullable final Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
// 
//         Class<? extends AbstractViewModel<T>> viewModelClass = getViewModelClass();
//         // try to extract the ViewModel class from the implementation
//         if (viewModelClass == null) {
//             //noinspection unchecked
//             viewModelClass = (Class<? extends AbstractViewModel<T>>) ProxyViewHelper.getGenericType(getClass(), AbstractViewModel.class);
//         }
//         getViewModelHelper().onCreate(requireActivity(), savedInstanceState, viewModelClass, getArguments());
//     }
// 
//     @CallSuper
//     @Override
//     public void onSaveInstanceState(@NonNull final Bundle outState) {
//         super.onSaveInstanceState(outState);
//         getViewModelHelper().onSaveInstanceState(outState);
//     }
// 
//     @CallSuper
//     @Override
//     public void onStart() {
//         super.onStart();
//         getViewModelHelper().onStart();
//     }
// 
//     @CallSuper
//     @Override
//     public void onStop() {
//         super.onStop();
//         getViewModelHelper().onStop();
//     }
// 
//     @CallSuper
//     @Override
//     public void onDestroyView() {
//         getViewModelHelper().onDestroyView(this);
//         super.onDestroyView();
//     }
// 
//     @CallSuper
//     @Override
//     public void onDestroy() {
//         getViewModelHelper().onDestroy(this);
//         super.onDestroy();
//     }
// 
//     @Nullable
//     public Class<R> getViewModelClass() {
//         return null;
//     }
// 
//     /**
//      * @see ViewModelHelper#getViewModel()
//      */
//     @NonNull
//     @SuppressWarnings("unused")
//     public R getViewModel() {
//         return getViewModelHelper().getViewModel();
//     }
// 
//     @Nullable
//     @Override
//     public ViewModelBindingConfig getViewModelBindingConfig() {
//         return null;
//     }
// 
//     @NonNull
//     public ViewModelHelper<T, R> getViewModelHelper() {
//         return mViewModelHelper;
//     }
// 
//     @Override
//     public void removeViewModel() {
//         mViewModelHelper.removeViewModel(requireActivity());
//     }
// 
//     /**
//      * Call this after your view is ready - usually on the end of {@link
//      * Fragment#onViewCreated(View, Bundle)}
//      *
//      * @param view view
//      */
//     protected void setModelView(@NonNull final T view) {
//         getViewModelHelper().setView(view);
//     }
// }
// 
// Path: sample/src/main/java/eu/inloop/viewmodel/sample/viewmodel/SampleArgumentViewModel.java
// public class SampleArgumentViewModel extends AbstractViewModel<IView> {
// 
//     public static final String ARG_INT_USER_ID = "ARG_INT_USER_ID";
// 
//     @Override
//     public void onCreate(@Nullable Bundle arguments, @Nullable Bundle savedInstanceState) {
//         super.onCreate(arguments, savedInstanceState);
// 
//         Log.d("SampleArgumentViewModel", "ViewModel created with argument - " + arguments.getInt(ARG_INT_USER_ID));
//         if (savedInstanceState != null) {
//             Log.d("SampleArgumentViewModel", "Application killed by system, viewmodel is restored");
//         }
//     }
// }


// Path: sample/src/main/java/eu/inloop/viewmodel/sample/fragment/SampleBundleFragment.java
import android.os.Bundle;
import androidx.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import butterknife.ButterKnife;
import eu.inloop.viewmodel.IView;
import eu.inloop.viewmodel.base.ViewModelBaseFragment;
import eu.inloop.viewmodel.sample.R;
import eu.inloop.viewmodel.sample.viewmodel.SampleArgumentViewModel;

package eu.inloop.viewmodel.sample.fragment;




public class SampleBundleFragment extends ViewModelBaseFragment<IView, SampleArgumentViewModel> {

    public static SampleBundleFragment newInstance(int userId) {
        final Bundle bundle = new Bundle();
        bundle.putInt(SampleArgumentViewModel.ARG_INT_USER_ID, userId);

        final SampleBundleFragment fragment = new SampleBundleFragment();
        fragment.setArguments(bundle);
        return fragment;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {