// Path: common/src/main/java/io/gitcafe/zhanjiashu/common/util/DisplayUtils.java
// public class DisplayUtils {
// 
//     public static int getStatusBarHeight(Context context) {
//         int result = 0;
//         int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
//         if (resourceId > 0) {
//             result = context.getResources().getDimensionPixelSize(resourceId);
//         }
//         return result;
//     }
// }
// 
// Path: app/src/main/java/io/gitcafe/zhanjiashu/newzhihudialy/util/VolleyUtils.java
// public class VolleyUtils {
// 
//     private static VolleyUtils mInstance;
//     private RequestQueue mRequestQueue;
//     private ImageLoader mImageLoader;
//     private VolleyUtils(Context context) {
//         mRequestQueue = getRequestQueue();
//         mImageLoader = new ImageLoader(mRequestQueue, new VolleyLruImageCache(context));
//     }
// 
// 
//     public static VolleyUtils getInstance(Context context) {
//         if (mInstance == null) {
//             synchronized (VolleyUtils.class) {
//                 if (mInstance == null) {
//                     mInstance = new VolleyUtils(context.getApplicationContext());
//                 }
//             }
//         }
//         return mInstance;
//     }
// 
//     private RequestQueue getRequestQueue() {
//         if (mRequestQueue == null) {
//             mRequestQueue = Volley.newRequestQueue(App.getContext());
//         }
//         return mRequestQueue;
//     }
// 
//     public <T> void addRequest(Request<T> request) {
//         mRequestQueue.add(request);
//     }
// }


import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.LinearLayout;
import android.widget.TextView;
import de.greenrobot.event.EventBus;
import io.gitcafe.zhanjiashu.newzhihudialy.R;
import io.gitcafe.zhanjiashu.common.util.DisplayUtils;
import io.gitcafe.zhanjiashu.newzhihudialy.util.VolleyUtils;
package io.gitcafe.zhanjiashu.newzhihudialy.activity;



/**
 * Created by Jiashu on 2015/5/31.
 */
public class BaseActivity extends AppCompatActivity {

    EventBus mEventBus;
    VolleyUtils mVolleyUtils;
    FragmentManager mFragmentManager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mEventBus = EventBus.getDefault();
        mVolleyUtils = VolleyUtils.getInstance(this);
        mFragmentManager = getSupportFragmentManager();

        // Android4.4 以上实现沉浸式状态栏
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);

            View view = new TextView(this);
            LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
                    LinearLayout.LayoutParams.MATCH_PARENT,
                    DisplayUtils.getStatusBarHeight(BaseActivity.this));
// Path: common/src/main/java/io/gitcafe/zhanjiashu/common/util/DisplayUtils.java
// public class DisplayUtils {
// 
//     public static int getStatusBarHeight(Context context) {
//         int result = 0;
//         int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
//         if (resourceId > 0) {
//             result = context.getResources().getDimensionPixelSize(resourceId);
//         }
//         return result;
//     }
// }
// 
// Path: app/src/main/java/io/gitcafe/zhanjiashu/newzhihudialy/util/VolleyUtils.java
// public class VolleyUtils {
// 
//     private static VolleyUtils mInstance;
//     private RequestQueue mRequestQueue;
//     private ImageLoader mImageLoader;
//     private VolleyUtils(Context context) {
//         mRequestQueue = getRequestQueue();
//         mImageLoader = new ImageLoader(mRequestQueue, new VolleyLruImageCache(context));
//     }
// 
// 
//     public static VolleyUtils getInstance(Context context) {
//         if (mInstance == null) {
//             synchronized (VolleyUtils.class) {
//                 if (mInstance == null) {
//                     mInstance = new VolleyUtils(context.getApplicationContext());
//                 }
//             }
//         }
//         return mInstance;
//     }
// 
//     private RequestQueue getRequestQueue() {
//         if (mRequestQueue == null) {
//             mRequestQueue = Volley.newRequestQueue(App.getContext());
//         }
//         return mRequestQueue;
//     }
// 
//     public <T> void addRequest(Request<T> request) {
//         mRequestQueue.add(request);
//     }
// }


// Path: app/src/main/java/io/gitcafe/zhanjiashu/newzhihudialy/activity/BaseActivity.java
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.LinearLayout;
import android.widget.TextView;
import de.greenrobot.event.EventBus;
import io.gitcafe.zhanjiashu.newzhihudialy.R;
import io.gitcafe.zhanjiashu.common.util.DisplayUtils;
import io.gitcafe.zhanjiashu.newzhihudialy.util.VolleyUtils;

package io.gitcafe.zhanjiashu.newzhihudialy.activity;



/**
 * Created by Jiashu on 2015/5/31.
 */
public class BaseActivity extends AppCompatActivity {

    EventBus mEventBus;
    VolleyUtils mVolleyUtils;
    FragmentManager mFragmentManager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mEventBus = EventBus.getDefault();
        mVolleyUtils = VolleyUtils.getInstance(this);
        mFragmentManager = getSupportFragmentManager();

        // Android4.4 以上实现沉浸式状态栏
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);

            View view = new TextView(this);
            LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
                    LinearLayout.LayoutParams.MATCH_PARENT,
                    DisplayUtils.getStatusBarHeight(BaseActivity.this));
            view.setBackgroundColor(getResources().getColor(R.color.material_colorPrimary));