// Path: app/src/main/java/hr/foi/rsc/lifeline/adapters/MenuAdapter.java
// public class MenuAdapter extends ArrayAdapter<MenuItem> {
// 
//     public MenuAdapter(Context context, int resource,
//                        MenuItem[] objects) {
//         super(context, resource, objects);
//     }
// 
//     @Override
//     public View getView(int position, View convertView, ViewGroup parent) {
//         ViewHolder holder;
//         if (convertView == null) {
//             convertView =
//                 LayoutInflater.from(getContext()).inflate(R.layout.list_item_menu, parent, false);
//             holder = new ViewHolder(convertView);
//         } else {
//             holder = (ViewHolder) convertView.getTag();
//         }
// 
//         MenuItem item = getItem(position);
// 
//         holder.itemIcon.setImageResource(item.getIconResId());
//         holder.itemTitle.setText(item.getTitleResId());
// 
//         return convertView;
//     }
// 
//     static class ViewHolder {
// 
//         @InjectView(R.id.item_icon)
//         ImageView itemIcon;
// 
//         @InjectView(R.id.item_title)
//         TextView itemTitle;
// 
//         ViewHolder(View view) {
//             ButterKnife.inject(this, view);
//             view.setTag(this);
//         }
//     }
// }


import android.app.Activity;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.app.Fragment;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ListView;
import butterknife.ButterKnife;
import hr.foi.rsc.lifeline.R;
import hr.foi.rsc.lifeline.adapters.MenuAdapter;
package hr.foi.rsc.lifeline.activities;



/**
 * Fragment used for managing interactions for and presentation of a navigation drawer.
 * See the <a href="https://developer.android.com/design/patterns/navigation-drawer.html#Interaction">
 * design guidelines</a> for a complete explanation of the behaviors implemented here.
 */
public class NavigationDrawerFragment extends Fragment {

    /**
     * Remember the position of the selected item.
     */
    private static final String STATE_SELECTED_POSITION = "selected_navigation_drawer_position";

    /**
     * Per the design guidelines, you should show the drawer on launch until the user manually
     * expands it. This shared preference tracks this.
     */
    private static final String PREF_USER_LEARNED_DRAWER = "navigation_drawer_learned";

    /**
     * A pointer to the current callbacks instance (the Activity).
     */
    private NavigationDrawerCallbacks mCallbacks;

    /**
     * Helper component that ties the action bar to the navigation drawer.
     */
    private ActionBarDrawerToggle mDrawerToggle;

    private DrawerLayout mDrawerLayout;

    private ListView mDrawerListView;

    private View mFragmentContainerView;

    private int mCurrentSelectedPosition = 0;

    private boolean mFromSavedInstanceState;

    private boolean mUserLearnedDrawer;

// Path: app/src/main/java/hr/foi/rsc/lifeline/adapters/MenuAdapter.java
// public class MenuAdapter extends ArrayAdapter<MenuItem> {
// 
//     public MenuAdapter(Context context, int resource,
//                        MenuItem[] objects) {
//         super(context, resource, objects);
//     }
// 
//     @Override
//     public View getView(int position, View convertView, ViewGroup parent) {
//         ViewHolder holder;
//         if (convertView == null) {
//             convertView =
//                 LayoutInflater.from(getContext()).inflate(R.layout.list_item_menu, parent, false);
//             holder = new ViewHolder(convertView);
//         } else {
//             holder = (ViewHolder) convertView.getTag();
//         }
// 
//         MenuItem item = getItem(position);
// 
//         holder.itemIcon.setImageResource(item.getIconResId());
//         holder.itemTitle.setText(item.getTitleResId());
// 
//         return convertView;
//     }
// 
//     static class ViewHolder {
// 
//         @InjectView(R.id.item_icon)
//         ImageView itemIcon;
// 
//         @InjectView(R.id.item_title)
//         TextView itemTitle;
// 
//         ViewHolder(View view) {
//             ButterKnife.inject(this, view);
//             view.setTag(this);
//         }
//     }
// }


// Path: app/src/main/java/hr/foi/rsc/lifeline/activities/NavigationDrawerFragment.java
import android.app.Activity;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v4.app.Fragment;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ListView;
import butterknife.ButterKnife;
import hr.foi.rsc.lifeline.R;
import hr.foi.rsc.lifeline.adapters.MenuAdapter;

package hr.foi.rsc.lifeline.activities;



/**
 * Fragment used for managing interactions for and presentation of a navigation drawer.
 * See the <a href="https://developer.android.com/design/patterns/navigation-drawer.html#Interaction">
 * design guidelines</a> for a complete explanation of the behaviors implemented here.
 */
public class NavigationDrawerFragment extends Fragment {

    /**
     * Remember the position of the selected item.
     */
    private static final String STATE_SELECTED_POSITION = "selected_navigation_drawer_position";

    /**
     * Per the design guidelines, you should show the drawer on launch until the user manually
     * expands it. This shared preference tracks this.
     */
    private static final String PREF_USER_LEARNED_DRAWER = "navigation_drawer_learned";

    /**
     * A pointer to the current callbacks instance (the Activity).
     */
    private NavigationDrawerCallbacks mCallbacks;

    /**
     * Helper component that ties the action bar to the navigation drawer.
     */
    private ActionBarDrawerToggle mDrawerToggle;

    private DrawerLayout mDrawerLayout;

    private ListView mDrawerListView;

    private View mFragmentContainerView;

    private int mCurrentSelectedPosition = 0;

    private boolean mFromSavedInstanceState;

    private boolean mUserLearnedDrawer;

    private MenuAdapter menuAdapter;