// Path: android/JBox/app/src/main/java/com/jiguang/jbox/AppApplication.java
// public class AppApplication extends Application {
//   private static Context mContext;
// 
//   public static boolean shouldUpdateData = false;
// 
//   public static String currentDevKey = "";
//   public static String currentChannelName = "";
// 
//   @Override public void onCreate() {
//     super.onCreate();
//     mContext = getApplicationContext();
//     JPushInterface.init(this);
//     ActiveAndroid.initialize(this);
//   }
// 
//   @Override public void onTerminate() {
//     super.onTerminate();
//     ActiveAndroid.dispose();
//   }
// 
//   public static Context getAppContext() {
//     return mContext;
//   }
// 
//   public static String getAppKey() {
//     PackageManager pm = mContext.getPackageManager();
//     ApplicationInfo appInfo;
//     try {
//       appInfo = pm.getApplicationInfo(mContext.getPackageName(), PackageManager.GET_META_DATA);
//     } catch (PackageManager.NameNotFoundException e) {
//       e.printStackTrace();
//       return "";
//     }
//     return appInfo.metaData.getString("JPUSH_APPKEY");
//   }
// }
// 
// Path: android/JBox/app/src/main/java/com/jiguang/jbox/ui/drawer/adapter/DrawerViewPagerAdapter.java
// public class DrawerViewPagerAdapter extends FragmentPagerAdapter {
//     private List<Fragment> mFragmentList;
// 
//     public DrawerViewPagerAdapter(FragmentManager fm, List<Fragment> fragments) {
//         super(fm);
//         mFragmentList = fragments;
//     }
// 
//     @Override
//     public Fragment getItem(int position) {
//         return mFragmentList.get(position);
//     }
// 
//     @Override
//     public int getCount() {
//         return mFragmentList.size();
//     }
// }


import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.jiguang.jbox.AppApplication;
import com.jiguang.jbox.R;
import com.jiguang.jbox.ui.drawer.adapter.DrawerViewPagerAdapter;
import java.util.ArrayList;
import java.util.List;
import static com.jiguang.jbox.R.id.viewPager;
package com.jiguang.jbox.ui.drawer;





/**
 * 侧滑界面。
 */
public class NavigationDrawerFragment extends Fragment
    implements DeveloperListFragment.OnListFragmentInteractionListener {

  private ViewPager mViewPager;

  private ImageView mIvCircleFirst;
  private ImageView mIvCircleSecond;

  public DeveloperListFragment devListFragment;
  public ChannelListFragment channelListFragment;

  public NavigationDrawerFragment() {
  }

  @Override public void onAttach(Context context) {
    super.onAttach(context);
  }

  @Override public View onCreateView(LayoutInflater inflater, final ViewGroup container,
      Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.drawer_main, container, false);

    mIvCircleFirst = (ImageView) v.findViewById(R.id.iv_circle_first);
    mIvCircleSecond = (ImageView) v.findViewById(R.id.iv_circle_second);
    mIvCircleFirst.setSelected(true);

    final List<Fragment> fragmentList = new ArrayList<>(2);

    devListFragment = new DeveloperListFragment();
    devListFragment.setListener(this);
    fragmentList.add(devListFragment);

    channelListFragment = new ChannelListFragment();
    fragmentList.add(channelListFragment);

    FragmentManager fm = getActivity().getSupportFragmentManager();

    mViewPager = (ViewPager) v.findViewById(viewPager);
// Path: android/JBox/app/src/main/java/com/jiguang/jbox/AppApplication.java
// public class AppApplication extends Application {
//   private static Context mContext;
// 
//   public static boolean shouldUpdateData = false;
// 
//   public static String currentDevKey = "";
//   public static String currentChannelName = "";
// 
//   @Override public void onCreate() {
//     super.onCreate();
//     mContext = getApplicationContext();
//     JPushInterface.init(this);
//     ActiveAndroid.initialize(this);
//   }
// 
//   @Override public void onTerminate() {
//     super.onTerminate();
//     ActiveAndroid.dispose();
//   }
// 
//   public static Context getAppContext() {
//     return mContext;
//   }
// 
//   public static String getAppKey() {
//     PackageManager pm = mContext.getPackageManager();
//     ApplicationInfo appInfo;
//     try {
//       appInfo = pm.getApplicationInfo(mContext.getPackageName(), PackageManager.GET_META_DATA);
//     } catch (PackageManager.NameNotFoundException e) {
//       e.printStackTrace();
//       return "";
//     }
//     return appInfo.metaData.getString("JPUSH_APPKEY");
//   }
// }
// 
// Path: android/JBox/app/src/main/java/com/jiguang/jbox/ui/drawer/adapter/DrawerViewPagerAdapter.java
// public class DrawerViewPagerAdapter extends FragmentPagerAdapter {
//     private List<Fragment> mFragmentList;
// 
//     public DrawerViewPagerAdapter(FragmentManager fm, List<Fragment> fragments) {
//         super(fm);
//         mFragmentList = fragments;
//     }
// 
//     @Override
//     public Fragment getItem(int position) {
//         return mFragmentList.get(position);
//     }
// 
//     @Override
//     public int getCount() {
//         return mFragmentList.size();
//     }
// }


// Path: android/JBox/app/src/main/java/com/jiguang/jbox/ui/drawer/NavigationDrawerFragment.java
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.jiguang.jbox.AppApplication;
import com.jiguang.jbox.R;
import com.jiguang.jbox.ui.drawer.adapter.DrawerViewPagerAdapter;
import java.util.ArrayList;
import java.util.List;
import static com.jiguang.jbox.R.id.viewPager;

package com.jiguang.jbox.ui.drawer;





/**
 * 侧滑界面。
 */
public class NavigationDrawerFragment extends Fragment
    implements DeveloperListFragment.OnListFragmentInteractionListener {

  private ViewPager mViewPager;

  private ImageView mIvCircleFirst;
  private ImageView mIvCircleSecond;

  public DeveloperListFragment devListFragment;
  public ChannelListFragment channelListFragment;

  public NavigationDrawerFragment() {
  }

  @Override public void onAttach(Context context) {
    super.onAttach(context);
  }

  @Override public View onCreateView(LayoutInflater inflater, final ViewGroup container,
      Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.drawer_main, container, false);

    mIvCircleFirst = (ImageView) v.findViewById(R.id.iv_circle_first);
    mIvCircleSecond = (ImageView) v.findViewById(R.id.iv_circle_second);
    mIvCircleFirst.setSelected(true);

    final List<Fragment> fragmentList = new ArrayList<>(2);

    devListFragment = new DeveloperListFragment();
    devListFragment.setListener(this);
    fragmentList.add(devListFragment);

    channelListFragment = new ChannelListFragment();
    fragmentList.add(channelListFragment);

    FragmentManager fm = getActivity().getSupportFragmentManager();

    mViewPager = (ViewPager) v.findViewById(viewPager);
    mViewPager.setAdapter(new DrawerViewPagerAdapter(fm, fragmentList));