// Path: library/src/main/java/eu/inloop/viewmodel/base/ViewModelBaseEmptyActivity.java
// public abstract class ViewModelBaseEmptyActivity extends AppCompatActivity implements IViewModelProvider {
// 
//     @Nullable
//     private ViewModelProvider mViewModelProvider;
// 
//     @CallSuper
//     @Override
//     protected void onCreate(@Nullable final Bundle savedInstanceState) {
//         //This code must be execute prior to super.onCreate()
//         mViewModelProvider = ViewModelProvider.newInstance(this);
//         super.onCreate(savedInstanceState);
//     }
// 
//     @Override
//     @Nullable
//     public Object onRetainCustomNonConfigurationInstance() {
//         return mViewModelProvider;
//     }
// 
//     @CallSuper
//     @Override
//     public void onStop() {
//         super.onStop();
//         if (isFinishing()) {
//             if (null == mViewModelProvider) {
//                 throw new IllegalStateException("ViewModelProvider for activity " + this + " was null."); //NON-NLS
//             }
//             mViewModelProvider.removeAllViewModels();
//         }
//     }
// 
//     @Nullable
//     @Override
//     public ViewModelProvider getViewModelProvider() {
//         return mViewModelProvider;
//     }
// }
// 
// Path: sample/src/main/java/eu/inloop/viewmodel/sample/fragment/UserListFragment.java
// public class UserListFragment extends ViewModelBaseFragment<IUserListView, UserListViewModel> implements IUserListView {
// 
//     @BindView(android.R.id.progress)
//     View mProgressView;
//     @BindView(R.id.progress_text)
//     TextView mProgressText;
//     @BindView(android.R.id.list)
//     ListView mListview;
//     @BindView(R.id.open_binding_fragment)
//     Button mOpenBindingFragment;
// 
//     private ArrayAdapter<String> mAdapter;
// 
//     @Override
//     public void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         mAdapter = new ArrayAdapter<>(requireActivity(), android.R.layout.simple_list_item_1, android.R.id.text1, new ArrayList<String>());
//     }
// 
//     @Override
//     public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
//         final View view = inflater.inflate(R.layout.fragment_userlist, container, false);
//         ButterKnife.bind(this, view);
// 
//         final View headerView = inflater.inflate(R.layout.view_header_info, null, false);
//         headerView.findViewById(R.id.button1).setOnClickListener(new View.OnClickListener() {
//             @Override
//             public void onClick(View view) {
//                 requireFragmentManager().beginTransaction().replace(R.id.root_content, SampleBundleFragment.newInstance(1234), "empty-fragment").addToBackStack(null).commit();
//             }
//         });
//         headerView.findViewById(R.id.button2).setOnClickListener(new View.OnClickListener() {
//             @Override
//             public void onClick(View view) {
//                 requireActivity().finish();
//                 requireActivity().startActivity(requireActivity().getIntent());
//             }
//         });
//         headerView.findViewById(R.id.button3).setOnClickListener(new View.OnClickListener() {
//             @Override
//             public void onClick(View view) {
//                 startActivity(new Intent(requireContext(), ViewPagerActivity.class));
//             }
//         });
//         mListview.addHeaderView(headerView, null, false);
//         mOpenBindingFragment.setOnClickListener(new View.OnClickListener() {
//             @Override
//             public void onClick(View v) {
//                 startActivity(SampleBindingActivity.newIntent(requireActivity()));
//             }
//         });
//         return view;
//     }
// 
//     @Override
//     public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
//         super.onViewCreated(view, savedInstanceState);
//         mListview.setAdapter(mAdapter);
//         mListview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
//             @Override
//             public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
//                 getViewModel().deleteUser(i - mListview.getHeaderViewsCount());
//             }
//         });
//         setModelView(this);
//     }
// 
//     @Override
//     public void showUsers(List<String> users) {
//         mAdapter.setNotifyOnChange(false);
//         mAdapter.clear();
//         mAdapter.addAll(users);
//         mAdapter.setNotifyOnChange(true);
//         mAdapter.notifyDataSetChanged();
//     }
// 
//     @Override
//     public void showLoading(float progress) {
//         mProgressView.setVisibility(View.VISIBLE);
//         mProgressText.setText((int) (progress * 100) + "%");
//     }
// 
//     @Override
//     public void hideProgress() {
//         mProgressView.setVisibility(View.GONE);
//     }
// 
//     @Override
//     public void onDestroy() {
//         super.onDestroy();
// 
//         // watch for memory leaks
//         RefWatcher refWatcher = SampleApplication.getRefWatcher(requireActivity());
//         refWatcher.watch(this);
//     }
// }


import android.os.Bundle;
import butterknife.ButterKnife;
import eu.inloop.viewmodel.base.ViewModelBaseEmptyActivity;
import eu.inloop.viewmodel.sample.R;
import eu.inloop.viewmodel.sample.fragment.UserListFragment;
package eu.inloop.viewmodel.sample.activity;




public class MainActivity extends ViewModelBaseEmptyActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ButterKnife.bind(this);

        if (savedInstanceState == null) {
// Path: library/src/main/java/eu/inloop/viewmodel/base/ViewModelBaseEmptyActivity.java
// public abstract class ViewModelBaseEmptyActivity extends AppCompatActivity implements IViewModelProvider {
// 
//     @Nullable
//     private ViewModelProvider mViewModelProvider;
// 
//     @CallSuper
//     @Override
//     protected void onCreate(@Nullable final Bundle savedInstanceState) {
//         //This code must be execute prior to super.onCreate()
//         mViewModelProvider = ViewModelProvider.newInstance(this);
//         super.onCreate(savedInstanceState);
//     }
// 
//     @Override
//     @Nullable
//     public Object onRetainCustomNonConfigurationInstance() {
//         return mViewModelProvider;
//     }
// 
//     @CallSuper
//     @Override
//     public void onStop() {
//         super.onStop();
//         if (isFinishing()) {
//             if (null == mViewModelProvider) {
//                 throw new IllegalStateException("ViewModelProvider for activity " + this + " was null."); //NON-NLS
//             }
//             mViewModelProvider.removeAllViewModels();
//         }
//     }
// 
//     @Nullable
//     @Override
//     public ViewModelProvider getViewModelProvider() {
//         return mViewModelProvider;
//     }
// }
// 
// Path: sample/src/main/java/eu/inloop/viewmodel/sample/fragment/UserListFragment.java
// public class UserListFragment extends ViewModelBaseFragment<IUserListView, UserListViewModel> implements IUserListView {
// 
//     @BindView(android.R.id.progress)
//     View mProgressView;
//     @BindView(R.id.progress_text)
//     TextView mProgressText;
//     @BindView(android.R.id.list)
//     ListView mListview;
//     @BindView(R.id.open_binding_fragment)
//     Button mOpenBindingFragment;
// 
//     private ArrayAdapter<String> mAdapter;
// 
//     @Override
//     public void onCreate(Bundle savedInstanceState) {
//         super.onCreate(savedInstanceState);
//         mAdapter = new ArrayAdapter<>(requireActivity(), android.R.layout.simple_list_item_1, android.R.id.text1, new ArrayList<String>());
//     }
// 
//     @Override
//     public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
//         final View view = inflater.inflate(R.layout.fragment_userlist, container, false);
//         ButterKnife.bind(this, view);
// 
//         final View headerView = inflater.inflate(R.layout.view_header_info, null, false);
//         headerView.findViewById(R.id.button1).setOnClickListener(new View.OnClickListener() {
//             @Override
//             public void onClick(View view) {
//                 requireFragmentManager().beginTransaction().replace(R.id.root_content, SampleBundleFragment.newInstance(1234), "empty-fragment").addToBackStack(null).commit();
//             }
//         });
//         headerView.findViewById(R.id.button2).setOnClickListener(new View.OnClickListener() {
//             @Override
//             public void onClick(View view) {
//                 requireActivity().finish();
//                 requireActivity().startActivity(requireActivity().getIntent());
//             }
//         });
//         headerView.findViewById(R.id.button3).setOnClickListener(new View.OnClickListener() {
//             @Override
//             public void onClick(View view) {
//                 startActivity(new Intent(requireContext(), ViewPagerActivity.class));
//             }
//         });
//         mListview.addHeaderView(headerView, null, false);
//         mOpenBindingFragment.setOnClickListener(new View.OnClickListener() {
//             @Override
//             public void onClick(View v) {
//                 startActivity(SampleBindingActivity.newIntent(requireActivity()));
//             }
//         });
//         return view;
//     }
// 
//     @Override
//     public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
//         super.onViewCreated(view, savedInstanceState);
//         mListview.setAdapter(mAdapter);
//         mListview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
//             @Override
//             public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
//                 getViewModel().deleteUser(i - mListview.getHeaderViewsCount());
//             }
//         });
//         setModelView(this);
//     }
// 
//     @Override
//     public void showUsers(List<String> users) {
//         mAdapter.setNotifyOnChange(false);
//         mAdapter.clear();
//         mAdapter.addAll(users);
//         mAdapter.setNotifyOnChange(true);
//         mAdapter.notifyDataSetChanged();
//     }
// 
//     @Override
//     public void showLoading(float progress) {
//         mProgressView.setVisibility(View.VISIBLE);
//         mProgressText.setText((int) (progress * 100) + "%");
//     }
// 
//     @Override
//     public void hideProgress() {
//         mProgressView.setVisibility(View.GONE);
//     }
// 
//     @Override
//     public void onDestroy() {
//         super.onDestroy();
// 
//         // watch for memory leaks
//         RefWatcher refWatcher = SampleApplication.getRefWatcher(requireActivity());
//         refWatcher.watch(this);
//     }
// }


// Path: sample/src/main/java/eu/inloop/viewmodel/sample/activity/MainActivity.java
import android.os.Bundle;
import butterknife.ButterKnife;
import eu.inloop.viewmodel.base.ViewModelBaseEmptyActivity;
import eu.inloop.viewmodel.sample.R;
import eu.inloop.viewmodel.sample.fragment.UserListFragment;

package eu.inloop.viewmodel.sample.activity;




public class MainActivity extends ViewModelBaseEmptyActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ButterKnife.bind(this);

        if (savedInstanceState == null) {
            getSupportFragmentManager().beginTransaction().replace(R.id.root_content, new UserListFragment(), "user-list-fragment").commit();