// Path: example-arch-viewmodel/src/main/java/com/mlykotom/example_arch_viewmodel/form/FormValidationFragment.java
// public class FormValidationFragment extends Fragment implements FormValidationView {
// 	private FragmentExampleFormBinding mBinding;
// 	private FormValidationViewModel mViewModel;
// 
// 	public static FormValidationFragment newInstance() {
// 		Bundle args = new Bundle();
// 		FormValidationFragment fragment = new FormValidationFragment();
// 		fragment.setArguments(args);
// 		return fragment;
// 	}
// 
// 	@Override
// 	public void onCreate(@Nullable Bundle savedInstanceState) {
// 		super.onCreate(savedInstanceState);
// 		mViewModel = ViewModelProviders.of(this).get(FormValidationViewModel.class);
// 	}
// 
// 	@Nullable
// 	@Override
// 	public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
// 		mBinding = FragmentExampleFormBinding.inflate(inflater);
// 		mBinding.setView(this);
// 		mBinding.setViewModel(mViewModel);
// 		return mBinding.getRoot();
// 	}
// 
// 	@Override
// 	public void onSubmitClicked() {
// 		Toast.makeText(getContext(), "Submit clicked and form is valid!", Toast.LENGTH_LONG).show();
// 	}
// 
// 	@Override
// 	public void onResetClicked() {
// 		mViewModel.email.reset();
// 	}
// }
// 
// Path: example-arch-viewmodel/src/main/java/com/mlykotom/example_arch_viewmodel/manual/ManualValidationFragment.java
// public class ManualValidationFragment extends Fragment implements ManualValidationView {
// 	private FragmentExampleManualBinding mBinding;
// 	private ManualValidationViewModel mViewModel;
// 
// 	public static ManualValidationFragment newInstance() {
// 
// 		Bundle args = new Bundle();
// 
// 		ManualValidationFragment fragment = new ManualValidationFragment();
// 		fragment.setArguments(args);
// 		return fragment;
// 	}
// 
// 	@Override
// 	public void onCreate(@Nullable Bundle savedInstanceState) {
// 		super.onCreate(savedInstanceState);
// 		mViewModel = ViewModelProviders.of(this).get(ManualValidationViewModel.class);
// 	}
// 
// 	@Nullable
// 	@Override
// 	public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
// 		mBinding = FragmentExampleManualBinding.inflate(inflater);
// 		mBinding.setView(this);
// 		mBinding.setViewModel(mViewModel);
// 		return mBinding.getRoot();
// 	}
// 
// 	@Override
// 	public void onManualSubmitClicked() {
// 		if (mViewModel.onManualSubmit()) {
// 			Toast.makeText(getContext(), "Form is valid!", Toast.LENGTH_LONG).show();
// 		}
// 	}
// }
// 
// Path: example-arch-viewmodel/src/main/java/com/mlykotom/example_arch_viewmodel/single/SingleValidationFragment.java
// public class SingleValidationFragment extends Fragment implements SingleValidationView {
// 	private FragmentExampleSingleBinding mBinding;
// 	private SingleValidationViewModel mViewModel;
// 
// 	public static SingleValidationFragment newInstance() {
// 
// 		Bundle args = new Bundle();
// 
// 		SingleValidationFragment fragment = new SingleValidationFragment();
// 		fragment.setArguments(args);
// 		return fragment;
// 	}
// 
// 	@Override
// 	public void onCreate(@Nullable Bundle savedInstanceState) {
// 		super.onCreate(savedInstanceState);
// 		mViewModel = ViewModelProviders.of(this).get(SingleValidationViewModel.class);
// 	}
// 
// 	@Nullable
// 	@Override
// 	public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
// 		mBinding = FragmentExampleSingleBinding.inflate(inflater);
// 		mBinding.setView(this);
// 		mBinding.setViewModel(mViewModel);
// 		return mBinding.getRoot();
// 	}
// 
// 	@Override
// 	public void onSubmitClicked() {
// 		Toast.makeText(getContext(), "Submit clicked and got " + mViewModel.username.getValue(), Toast.LENGTH_LONG).show();
// 	}
// 
// 	@Override
// 	public void onExternalErrorClick() {
// 		mViewModel.username.setError("This is external error");
// 	}
// }


import android.os.Bundle;
import com.google.android.material.tabs.TabLayout;
import com.mlykotom.example_arch_viewmodel.form.FormValidationFragment;
import com.mlykotom.example_arch_viewmodel.manual.ManualValidationFragment;
import com.mlykotom.example_arch_viewmodel.single.SingleValidationFragment;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;
import androidx.viewpager.widget.ViewPager;
package com.mlykotom.example_arch_viewmodel;




public class ExampleViewModelActivity extends AppCompatActivity {
	private PagesAdapter mAdapter;
	private ViewPager mViewPager;
	private TabLayout mTabLayout;

	@Override
	protected void onCreate(@Nullable Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_example);
		setupActionbar();
// Path: example-arch-viewmodel/src/main/java/com/mlykotom/example_arch_viewmodel/form/FormValidationFragment.java
// public class FormValidationFragment extends Fragment implements FormValidationView {
// 	private FragmentExampleFormBinding mBinding;
// 	private FormValidationViewModel mViewModel;
// 
// 	public static FormValidationFragment newInstance() {
// 		Bundle args = new Bundle();
// 		FormValidationFragment fragment = new FormValidationFragment();
// 		fragment.setArguments(args);
// 		return fragment;
// 	}
// 
// 	@Override
// 	public void onCreate(@Nullable Bundle savedInstanceState) {
// 		super.onCreate(savedInstanceState);
// 		mViewModel = ViewModelProviders.of(this).get(FormValidationViewModel.class);
// 	}
// 
// 	@Nullable
// 	@Override
// 	public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
// 		mBinding = FragmentExampleFormBinding.inflate(inflater);
// 		mBinding.setView(this);
// 		mBinding.setViewModel(mViewModel);
// 		return mBinding.getRoot();
// 	}
// 
// 	@Override
// 	public void onSubmitClicked() {
// 		Toast.makeText(getContext(), "Submit clicked and form is valid!", Toast.LENGTH_LONG).show();
// 	}
// 
// 	@Override
// 	public void onResetClicked() {
// 		mViewModel.email.reset();
// 	}
// }
// 
// Path: example-arch-viewmodel/src/main/java/com/mlykotom/example_arch_viewmodel/manual/ManualValidationFragment.java
// public class ManualValidationFragment extends Fragment implements ManualValidationView {
// 	private FragmentExampleManualBinding mBinding;
// 	private ManualValidationViewModel mViewModel;
// 
// 	public static ManualValidationFragment newInstance() {
// 
// 		Bundle args = new Bundle();
// 
// 		ManualValidationFragment fragment = new ManualValidationFragment();
// 		fragment.setArguments(args);
// 		return fragment;
// 	}
// 
// 	@Override
// 	public void onCreate(@Nullable Bundle savedInstanceState) {
// 		super.onCreate(savedInstanceState);
// 		mViewModel = ViewModelProviders.of(this).get(ManualValidationViewModel.class);
// 	}
// 
// 	@Nullable
// 	@Override
// 	public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
// 		mBinding = FragmentExampleManualBinding.inflate(inflater);
// 		mBinding.setView(this);
// 		mBinding.setViewModel(mViewModel);
// 		return mBinding.getRoot();
// 	}
// 
// 	@Override
// 	public void onManualSubmitClicked() {
// 		if (mViewModel.onManualSubmit()) {
// 			Toast.makeText(getContext(), "Form is valid!", Toast.LENGTH_LONG).show();
// 		}
// 	}
// }
// 
// Path: example-arch-viewmodel/src/main/java/com/mlykotom/example_arch_viewmodel/single/SingleValidationFragment.java
// public class SingleValidationFragment extends Fragment implements SingleValidationView {
// 	private FragmentExampleSingleBinding mBinding;
// 	private SingleValidationViewModel mViewModel;
// 
// 	public static SingleValidationFragment newInstance() {
// 
// 		Bundle args = new Bundle();
// 
// 		SingleValidationFragment fragment = new SingleValidationFragment();
// 		fragment.setArguments(args);
// 		return fragment;
// 	}
// 
// 	@Override
// 	public void onCreate(@Nullable Bundle savedInstanceState) {
// 		super.onCreate(savedInstanceState);
// 		mViewModel = ViewModelProviders.of(this).get(SingleValidationViewModel.class);
// 	}
// 
// 	@Nullable
// 	@Override
// 	public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
// 		mBinding = FragmentExampleSingleBinding.inflate(inflater);
// 		mBinding.setView(this);
// 		mBinding.setViewModel(mViewModel);
// 		return mBinding.getRoot();
// 	}
// 
// 	@Override
// 	public void onSubmitClicked() {
// 		Toast.makeText(getContext(), "Submit clicked and got " + mViewModel.username.getValue(), Toast.LENGTH_LONG).show();
// 	}
// 
// 	@Override
// 	public void onExternalErrorClick() {
// 		mViewModel.username.setError("This is external error");
// 	}
// }


// Path: example-arch-viewmodel/src/main/java/com/mlykotom/example_arch_viewmodel/ExampleViewModelActivity.java
import android.os.Bundle;
import com.google.android.material.tabs.TabLayout;
import com.mlykotom.example_arch_viewmodel.form.FormValidationFragment;
import com.mlykotom.example_arch_viewmodel.manual.ManualValidationFragment;
import com.mlykotom.example_arch_viewmodel.single.SingleValidationFragment;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;
import androidx.viewpager.widget.ViewPager;

package com.mlykotom.example_arch_viewmodel;




public class ExampleViewModelActivity extends AppCompatActivity {
	private PagesAdapter mAdapter;
	private ViewPager mViewPager;
	private TabLayout mTabLayout;

	@Override
	protected void onCreate(@Nullable Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_example);
		setupActionbar();
		setupAdapter();