// Path: app/src/main/java/io/bxbxbai/zhuanlan/widget/DrawerMenuContent.java
// public class DrawerMenuContent {
// 
//     public static final int DRAWER_MENU_COUNT = 3;
// 
//     private static final String FIELD_TITLE = "title";
//     private static final String FIELD_ICON = "icon";
// 
//     private List<DrawerItem> items;
//     private Class[] activities;
// 
//     public DrawerMenuContent(Context context) {
//         activities = new Class[DRAWER_MENU_COUNT];
//         items = new ArrayList<>(DRAWER_MENU_COUNT);
// 
//         activities[0] = SearchActivity.class;
//         items.add(new DrawerItem(R.id.menu_search, context.getString(R.string.searching),
//                 R.drawable.ic_search_black_18dp));
// 
//         activities[1] = AllPeopleActivity.class;
//         items.add(new DrawerItem(R.id.menu_all_people, context.getString(R.string.all_people),
//                 R.drawable.ic_supervisor_account_black_18dp));
// 
//         activities[2] = PostListActivity.class;
//         items.add(new DrawerItem(R.id.menu_recent_news, context.getString(R.string.recent_news),
//                 R.drawable.ic_view_list_black_18dp));
//     }
// 
//     public List<DrawerItem> getItems() {
//         return items;
//     }
// 
//     public Class getActivity(int pos) {
//         if (0 <= pos && pos < activities.length) {
//             return activities[pos];
//         }
//         return null;
//     }
// 
// 
//     public int getPosition(Class clazz) {
//         for (int i = 0; i < activities.length; i++) {
//             if (activities[i].equals(clazz)) {
//                 return i;
//             }
//         }
//         return -1;
//     }
// 
//     public static class DrawerItem {
//         public int id;
//         public String title;
//         public int icon;
// 
//         private DrawerItem(int id, String title, @DrawableRes int icon) {
//             this.id = id;
//             this.title = title;
//             this.icon = icon;
//         }
//     }
// }
// 
// Path: app/src/main/java/io/bxbxbai/zhuanlan/widget/OnMenuListClickListener.java
// public class OnMenuListClickListener implements AdapterView.OnItemClickListener {
// 
//     private Activity mActivity;
//     private DrawerLayout mDrawerLayout;
// 
//     public OnMenuListClickListener(Activity activity, DrawerLayout drawerLayout) {
//         mActivity = activity;
//         mDrawerLayout = drawerLayout;
//     }
// 
//     @Override
//     public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
//         DrawerMenuContent.DrawerItem item = (DrawerMenuContent.DrawerItem) view.getTag(R.id.key_data);
// 
//         if (mDrawerLayout != null && mDrawerLayout.isDrawerOpen(GravityCompat.START)) {
//             mDrawerLayout.closeDrawers();
//         }
// 
//         switch (item.id) {
//             case R.id.menu_search :
//                 Tips.showToast("Coming soon...");
//                 break;
// 
//             case R.id.menu_all_people:
//                 AllPeopleActivity.start(mActivity);
//                 break;
// 
//             case R.id.menu_recent_news :
//                 RecentPostListActivity.start(mActivity);
//                 break;
// 
//             default:break;
//         }
//     }
// }


import android.app.Activity;
import android.app.FragmentManager;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ListView;
import butterknife.Bind;
import butterknife.ButterKnife;
import io.bxbxbai.common.Tips;
import io.bxbxbai.common.utils.CommonExecutor;
import io.bxbxbai.common.utils.PrefUtils;
import io.bxbxbai.zhuanlan.R;
import io.bxbxbai.zhuanlan.widget.DrawerMenuContent;
import io.bxbxbai.zhuanlan.widget.MenuAdapter;
import io.bxbxbai.zhuanlan.widget.OnMenuListClickListener;
package io.bxbxbai.zhuanlan.ui;


public class MainActivity extends BaseActivity {

    @Bind(R.id.drawer_list)
    protected ListView listView;
    @Bind(R.id.toolbar)
    protected Toolbar toolbar;
    @Bind(R.id.drawerLayout)
    protected DrawerLayout drawerLayout;

    private ActionBarDrawerToggle actionBarDrawerToggle;

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

// Path: app/src/main/java/io/bxbxbai/zhuanlan/widget/DrawerMenuContent.java
// public class DrawerMenuContent {
// 
//     public static final int DRAWER_MENU_COUNT = 3;
// 
//     private static final String FIELD_TITLE = "title";
//     private static final String FIELD_ICON = "icon";
// 
//     private List<DrawerItem> items;
//     private Class[] activities;
// 
//     public DrawerMenuContent(Context context) {
//         activities = new Class[DRAWER_MENU_COUNT];
//         items = new ArrayList<>(DRAWER_MENU_COUNT);
// 
//         activities[0] = SearchActivity.class;
//         items.add(new DrawerItem(R.id.menu_search, context.getString(R.string.searching),
//                 R.drawable.ic_search_black_18dp));
// 
//         activities[1] = AllPeopleActivity.class;
//         items.add(new DrawerItem(R.id.menu_all_people, context.getString(R.string.all_people),
//                 R.drawable.ic_supervisor_account_black_18dp));
// 
//         activities[2] = PostListActivity.class;
//         items.add(new DrawerItem(R.id.menu_recent_news, context.getString(R.string.recent_news),
//                 R.drawable.ic_view_list_black_18dp));
//     }
// 
//     public List<DrawerItem> getItems() {
//         return items;
//     }
// 
//     public Class getActivity(int pos) {
//         if (0 <= pos && pos < activities.length) {
//             return activities[pos];
//         }
//         return null;
//     }
// 
// 
//     public int getPosition(Class clazz) {
//         for (int i = 0; i < activities.length; i++) {
//             if (activities[i].equals(clazz)) {
//                 return i;
//             }
//         }
//         return -1;
//     }
// 
//     public static class DrawerItem {
//         public int id;
//         public String title;
//         public int icon;
// 
//         private DrawerItem(int id, String title, @DrawableRes int icon) {
//             this.id = id;
//             this.title = title;
//             this.icon = icon;
//         }
//     }
// }
// 
// Path: app/src/main/java/io/bxbxbai/zhuanlan/widget/OnMenuListClickListener.java
// public class OnMenuListClickListener implements AdapterView.OnItemClickListener {
// 
//     private Activity mActivity;
//     private DrawerLayout mDrawerLayout;
// 
//     public OnMenuListClickListener(Activity activity, DrawerLayout drawerLayout) {
//         mActivity = activity;
//         mDrawerLayout = drawerLayout;
//     }
// 
//     @Override
//     public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
//         DrawerMenuContent.DrawerItem item = (DrawerMenuContent.DrawerItem) view.getTag(R.id.key_data);
// 
//         if (mDrawerLayout != null && mDrawerLayout.isDrawerOpen(GravityCompat.START)) {
//             mDrawerLayout.closeDrawers();
//         }
// 
//         switch (item.id) {
//             case R.id.menu_search :
//                 Tips.showToast("Coming soon...");
//                 break;
// 
//             case R.id.menu_all_people:
//                 AllPeopleActivity.start(mActivity);
//                 break;
// 
//             case R.id.menu_recent_news :
//                 RecentPostListActivity.start(mActivity);
//                 break;
// 
//             default:break;
//         }
//     }
// }


// Path: app/src/main/java/io/bxbxbai/zhuanlan/ui/MainActivity.java
import android.app.Activity;
import android.app.FragmentManager;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.view.GravityCompat;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ListView;
import butterknife.Bind;
import butterknife.ButterKnife;
import io.bxbxbai.common.Tips;
import io.bxbxbai.common.utils.CommonExecutor;
import io.bxbxbai.common.utils.PrefUtils;
import io.bxbxbai.zhuanlan.R;
import io.bxbxbai.zhuanlan.widget.DrawerMenuContent;
import io.bxbxbai.zhuanlan.widget.MenuAdapter;
import io.bxbxbai.zhuanlan.widget.OnMenuListClickListener;

package io.bxbxbai.zhuanlan.ui;


public class MainActivity extends BaseActivity {

    @Bind(R.id.drawer_list)
    protected ListView listView;
    @Bind(R.id.toolbar)
    protected Toolbar toolbar;
    @Bind(R.id.drawerLayout)
    protected DrawerLayout drawerLayout;

    private ActionBarDrawerToggle actionBarDrawerToggle;

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

        DrawerMenuContent content = new DrawerMenuContent(this);