// Path: app/src/main/java/com/neurospeech/hypercubesample/adapters/NavigationListAdapter.java
// public abstract class NavigationListAdapter
//         extends HeaderedAdapter<MenuModel,RecyclerView.ViewHolder> {
// 
//     public NavigationListAdapter(Context context) {
//         super(context);
//     }
// 
//     @Override
//     public Object getHeader(MenuModel item) {
//         return item.header;
//     }
// 
// 
//     public abstract void onItemClick(MenuModel item);
// 
// 
// 
// }
// 
// Path: app/src/main/java/com/neurospeech/hypercubesample/fragments/HomeFragment.java
// public class HomeFragment extends Fragment {
// 
//     @Nullable
//     @Override
//     public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
//         View view = inflater.inflate(R.layout.fragment_home,container,false);
// 
//         return view;
//     }
// }
// 
// Path: app/src/main/java/com/neurospeech/hypercubesample/fragments/form/EditTextFragment.java
// public class EditTextFragment extends Fragment {
//     @Nullable
//     @Override
//     public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
//         View view = inflater.inflate(R.layout.form_edit_text_fragment,container,false);
// 
//         TextValidator tv = new TextValidator() {
//             @Override
//             public Object invalidError(String value) {
//                 if(value == null || value.isEmpty())
//                     return "Field cannot be empty";
//                 return null;
//             }
//         };
// 
//         HyperEditText editText;
//         editText = (HyperEditText)view.findViewById(R.id.edit_validate_on_lost_focus);
//         editText.setValidator(true,false,tv);
// 
//         editText.setText("1000");
// 
// 
// 
//         editText = (HyperEditText)view.findViewById(R.id.edit_validate_on_typing);
//         editText.setValidator(true,true,tv);
// 
// 
//         editText = (HyperEditText)view.findViewById(R.id.edit_validate_no_auto);
//         editText.setValidator(false,false,tv);
// 
//         view.findViewById(R.id.validate_button).setOnClickListener(new View.OnClickListener() {
//             @Override
//             public void onClick(View v) {
// 
//             }
//         });
// 
//         return view;
//     }
// }
// 
// Path: app/src/main/java/com/neurospeech/hypercubesample/fragments/recyclerviewsamples/HeaderFooterFragment.java
// public class HeaderFooterFragment extends Fragment {
// }
// 
// Path: app/src/main/java/com/neurospeech/hypercubesample/fragments/recyclerviewsamples/ItemHeadersFragment.java
// public class ItemHeadersFragment extends Fragment {
// }
// 
// Path: app/src/main/java/com/neurospeech/hypercubesample/model/MenuModel.java
// public class MenuModel {
// 
//     private final Class activity;
//     public String name;
// 
//     public String header;
// 
//     public MenuModel(String header, String name, Class activity) {
//         super();
//         this.name = name;
//         this.header = header;
//         this.activity = activity;
//     }
// 
//     public Object newInstance(){
//         try {
//             return activity.newInstance();
//         }catch (Exception ex){
//             ex.printStackTrace();
//         }
//         return null;
//     }
// }


import android.app.Activity;
import android.app.SearchManager;
import android.content.res.Resources;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.MenuItemCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.SearchView;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;
import com.neurospeech.hypercubesample.adapters.NavigationListAdapter;
import com.neurospeech.hypercubesample.fragments.HomeFragment;
import com.neurospeech.hypercubesample.fragments.form.EditTextFragment;
import com.neurospeech.hypercubesample.fragments.recyclerviewsamples.HeaderFooterFragment;
import com.neurospeech.hypercubesample.fragments.recyclerviewsamples.ItemHeadersFragment;
import com.neurospeech.hypercubesample.model.MenuModel;
import java.util.ArrayList;
            HomeFragment homeFragment = new HomeFragment();

            // In case this activity was started with special instructions from an
            // Intent, pass the Intent's extras to the fragment as arguments
            homeFragment.setArguments(getIntent().getExtras());
            fragmentTransaction(homeFragment);
        }


    }

    @Override
    protected void onPostCreate(@Nullable Bundle savedInstanceState) {
        super.onPostCreate(savedInstanceState);
        actionBarDrawerToggle.syncState();

    }

    private void onMenuClicked(MenuModel item) {
        fragmentTransaction((Fragment) item.newInstance());
        drawerLayout.closeDrawers();
    }


    /**
     * getSupportFragmentManager() - Returns the SupportFragmentManager for interacting with fragments
     * associated with activity
     * FragmentTransaction is a way to add / replace / remove fragments
     * @param fragment - List of fragments associated with Activity
     */
// Path: app/src/main/java/com/neurospeech/hypercubesample/adapters/NavigationListAdapter.java
// public abstract class NavigationListAdapter
//         extends HeaderedAdapter<MenuModel,RecyclerView.ViewHolder> {
// 
//     public NavigationListAdapter(Context context) {
//         super(context);
//     }
// 
//     @Override
//     public Object getHeader(MenuModel item) {
//         return item.header;
//     }
// 
// 
//     public abstract void onItemClick(MenuModel item);
// 
// 
// 
// }
// 
// Path: app/src/main/java/com/neurospeech/hypercubesample/fragments/HomeFragment.java
// public class HomeFragment extends Fragment {
// 
//     @Nullable
//     @Override
//     public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
//         View view = inflater.inflate(R.layout.fragment_home,container,false);
// 
//         return view;
//     }
// }
// 
// Path: app/src/main/java/com/neurospeech/hypercubesample/fragments/form/EditTextFragment.java
// public class EditTextFragment extends Fragment {
//     @Nullable
//     @Override
//     public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
//         View view = inflater.inflate(R.layout.form_edit_text_fragment,container,false);
// 
//         TextValidator tv = new TextValidator() {
//             @Override
//             public Object invalidError(String value) {
//                 if(value == null || value.isEmpty())
//                     return "Field cannot be empty";
//                 return null;
//             }
//         };
// 
//         HyperEditText editText;
//         editText = (HyperEditText)view.findViewById(R.id.edit_validate_on_lost_focus);
//         editText.setValidator(true,false,tv);
// 
//         editText.setText("1000");
// 
// 
// 
//         editText = (HyperEditText)view.findViewById(R.id.edit_validate_on_typing);
//         editText.setValidator(true,true,tv);
// 
// 
//         editText = (HyperEditText)view.findViewById(R.id.edit_validate_no_auto);
//         editText.setValidator(false,false,tv);
// 
//         view.findViewById(R.id.validate_button).setOnClickListener(new View.OnClickListener() {
//             @Override
//             public void onClick(View v) {
// 
//             }
//         });
// 
//         return view;
//     }
// }
// 
// Path: app/src/main/java/com/neurospeech/hypercubesample/fragments/recyclerviewsamples/HeaderFooterFragment.java
// public class HeaderFooterFragment extends Fragment {
// }
// 
// Path: app/src/main/java/com/neurospeech/hypercubesample/fragments/recyclerviewsamples/ItemHeadersFragment.java
// public class ItemHeadersFragment extends Fragment {
// }
// 
// Path: app/src/main/java/com/neurospeech/hypercubesample/model/MenuModel.java
// public class MenuModel {
// 
//     private final Class activity;
//     public String name;
// 
//     public String header;
// 
//     public MenuModel(String header, String name, Class activity) {
//         super();
//         this.name = name;
//         this.header = header;
//         this.activity = activity;
//     }
// 
//     public Object newInstance(){
//         try {
//             return activity.newInstance();
//         }catch (Exception ex){
//             ex.printStackTrace();
//         }
//         return null;
//     }
// }


// Path: app/src/main/java/com/neurospeech/hypercubesample/MainActivity.java
import android.app.Activity;
import android.app.SearchManager;
import android.content.res.Resources;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.MenuItemCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.SearchView;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;
import com.neurospeech.hypercubesample.adapters.NavigationListAdapter;
import com.neurospeech.hypercubesample.fragments.HomeFragment;
import com.neurospeech.hypercubesample.fragments.form.EditTextFragment;
import com.neurospeech.hypercubesample.fragments.recyclerviewsamples.HeaderFooterFragment;
import com.neurospeech.hypercubesample.fragments.recyclerviewsamples.ItemHeadersFragment;
import com.neurospeech.hypercubesample.model.MenuModel;
import java.util.ArrayList;

            HomeFragment homeFragment = new HomeFragment();

            // In case this activity was started with special instructions from an
            // Intent, pass the Intent's extras to the fragment as arguments
            homeFragment.setArguments(getIntent().getExtras());
            fragmentTransaction(homeFragment);
        }


    }

    @Override
    protected void onPostCreate(@Nullable Bundle savedInstanceState) {
        super.onPostCreate(savedInstanceState);
        actionBarDrawerToggle.syncState();

    }

    private void onMenuClicked(MenuModel item) {
        fragmentTransaction((Fragment) item.newInstance());
        drawerLayout.closeDrawers();
    }


    /**
     * getSupportFragmentManager() - Returns the SupportFragmentManager for interacting with fragments
     * associated with activity
     * FragmentTransaction is a way to add / replace / remove fragments
     * @param fragment - List of fragments associated with Activity
     */
    public void fragmentTransaction(Fragment fragment) {