// Path: app/src/main/java/com/github/zzwwws/rxzhihudaily/common/util/ScreenUtil.java
// public class ScreenUtil {
//     private static final String TAG = "ScreenUtil";
//     public static int screenWidth;
//     public static int screenHeight;
//     public static int screenMin;// 宽高中，较小的值
//     public static int screenMax;// 宽高中，较大的值
//     public static float density;
//     public static float scaleDensity;
//     public static float xdpi;
//     public static float ydpi;
//     public static int densityDpi;
//     public static int dialogWidth;
//     public static int statusbarheight;
//     public static int navbarheight;
//     private static double RATIO = 0.85;
// 
//     public static void GetInfo(Context context) {
//         if (null == context) {
//             return;
//         }
//         DisplayMetrics dm = context.getApplicationContext().getResources().getDisplayMetrics();
//         screenWidth = dm.widthPixels;
//         screenHeight = dm.heightPixels;
//         screenMin = (screenWidth > screenHeight) ? screenHeight : screenWidth;
//         screenMax = (screenWidth < screenHeight) ? screenHeight : screenWidth;
//         density = dm.density;
//         scaleDensity = dm.scaledDensity;
//         xdpi = dm.xdpi;
//         ydpi = dm.ydpi;
//         densityDpi = dm.densityDpi;
//         statusbarheight = getStatusBarHeight(context);
//         navbarheight = getNavBarHeight(context);
//         Log.d(TAG, "screenWidth=" + screenWidth + " screenHeight=" + screenHeight + " density=" + density);
//     }
// 
//     public static int getStatusBarHeight(Context context) {
//         Class<?> c = null;
//         Object obj = null;
//         Field field = null;
//         int x = 0, sbar = 0;
//         try {
//             c = Class.forName("com.android.internal.R$dimen");
//             obj = c.newInstance();
//             field = c.getField("status_bar_height");
//             x = Integer.parseInt(field.get(obj).toString());
//             sbar = context.getResources().getDimensionPixelSize(x);
//         } catch (Exception E) {
//             E.printStackTrace();
//         }
//         return sbar;
//     }
// 
//     public static int getNavBarHeight(Context context) {
//         Resources resources = context.getResources();
//         int resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android");
//         if (resourceId > 0) {
//             return resources.getDimensionPixelSize(resourceId);
//         }
//         return 0;
//     }
// 
//     public static int dip2px(float dipValue) {
//         final float scale = ScreenUtil.getDisplayDensity();
//         return (int) (dipValue * scale + 0.5f);
//     }
// 
//     public static int px2dip(float pxValue) {
//         final float scale = ScreenUtil.getDisplayDensity();
//         return (int) (pxValue / scale + 0.5f);
//     }
// 
//     private static float getDisplayDensity() {
//         if (density == 0) {
//             GetInfo(BaseApplication.get());
//         }
//         return density;
//     }
// 
//     public static int getDisplayWidth() {
//         if (screenWidth == 0) {
//             GetInfo(BaseApplication.get());
//         }
//         return screenWidth;
//     }
// 
//     public static int getDisplayHeight() {
//         if (screenHeight == 0) {
//             GetInfo(BaseApplication.get());
//         }
//         return screenHeight;
//     }
// 
//     public static int getScreenMin() {
//         if (screenMin == 0) {
//             GetInfo(BaseApplication.get());
//         }
//         return screenMin;
//     }
// 
//     public static int getScreenMax() {
//         if (screenMin == 0) {
//             GetInfo(BaseApplication.get());
//         }
//         return screenMax;
//     }
// 
//     public static int getDialogWidth() {
//         dialogWidth = (int) (getScreenMin() * RATIO);
//         return dialogWidth;
//     }
// 
//     public static String getImageDensity(){
//         return getDisplayWidth()+"*"+getDisplayHeight();
//     }
// }
// 
// Path: app/src/main/java/com/github/zzwwws/rxzhihudaily/common/util/StrictModeUtil.java
// public class StrictModeUtil {
// 
//     public static void startStrictMode(){
//         if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD){
//             startThreadStrictMode();
//             startVmStrictMode();
//         }
//     }
// 
//     @TargetApi(9)
//     private static final void startThreadStrictMode(){
//         StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectAll().permitDiskReads().permitDiskWrites().penaltyLog().build());
//     }
// 
//     @TargetApi(9)
//     private static final void startVmStrictMode(){
//         StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectAll().penaltyLog().build());
//     }
// }


import android.app.Application;
import com.github.zzwwws.rxzhihudaily.common.util.ScreenUtil;
import com.github.zzwwws.rxzhihudaily.common.util.StrictModeUtil;
package com.github.zzwwws.rxzhihudaily.common;



public class BaseApplication extends Application {

    private static BaseApplication instance;

    public static BaseApplication get() {
        return instance;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        instance = (BaseApplication) getApplicationContext();

        if (AppConfig.DEBUG) {
// Path: app/src/main/java/com/github/zzwwws/rxzhihudaily/common/util/ScreenUtil.java
// public class ScreenUtil {
//     private static final String TAG = "ScreenUtil";
//     public static int screenWidth;
//     public static int screenHeight;
//     public static int screenMin;// 宽高中，较小的值
//     public static int screenMax;// 宽高中，较大的值
//     public static float density;
//     public static float scaleDensity;
//     public static float xdpi;
//     public static float ydpi;
//     public static int densityDpi;
//     public static int dialogWidth;
//     public static int statusbarheight;
//     public static int navbarheight;
//     private static double RATIO = 0.85;
// 
//     public static void GetInfo(Context context) {
//         if (null == context) {
//             return;
//         }
//         DisplayMetrics dm = context.getApplicationContext().getResources().getDisplayMetrics();
//         screenWidth = dm.widthPixels;
//         screenHeight = dm.heightPixels;
//         screenMin = (screenWidth > screenHeight) ? screenHeight : screenWidth;
//         screenMax = (screenWidth < screenHeight) ? screenHeight : screenWidth;
//         density = dm.density;
//         scaleDensity = dm.scaledDensity;
//         xdpi = dm.xdpi;
//         ydpi = dm.ydpi;
//         densityDpi = dm.densityDpi;
//         statusbarheight = getStatusBarHeight(context);
//         navbarheight = getNavBarHeight(context);
//         Log.d(TAG, "screenWidth=" + screenWidth + " screenHeight=" + screenHeight + " density=" + density);
//     }
// 
//     public static int getStatusBarHeight(Context context) {
//         Class<?> c = null;
//         Object obj = null;
//         Field field = null;
//         int x = 0, sbar = 0;
//         try {
//             c = Class.forName("com.android.internal.R$dimen");
//             obj = c.newInstance();
//             field = c.getField("status_bar_height");
//             x = Integer.parseInt(field.get(obj).toString());
//             sbar = context.getResources().getDimensionPixelSize(x);
//         } catch (Exception E) {
//             E.printStackTrace();
//         }
//         return sbar;
//     }
// 
//     public static int getNavBarHeight(Context context) {
//         Resources resources = context.getResources();
//         int resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android");
//         if (resourceId > 0) {
//             return resources.getDimensionPixelSize(resourceId);
//         }
//         return 0;
//     }
// 
//     public static int dip2px(float dipValue) {
//         final float scale = ScreenUtil.getDisplayDensity();
//         return (int) (dipValue * scale + 0.5f);
//     }
// 
//     public static int px2dip(float pxValue) {
//         final float scale = ScreenUtil.getDisplayDensity();
//         return (int) (pxValue / scale + 0.5f);
//     }
// 
//     private static float getDisplayDensity() {
//         if (density == 0) {
//             GetInfo(BaseApplication.get());
//         }
//         return density;
//     }
// 
//     public static int getDisplayWidth() {
//         if (screenWidth == 0) {
//             GetInfo(BaseApplication.get());
//         }
//         return screenWidth;
//     }
// 
//     public static int getDisplayHeight() {
//         if (screenHeight == 0) {
//             GetInfo(BaseApplication.get());
//         }
//         return screenHeight;
//     }
// 
//     public static int getScreenMin() {
//         if (screenMin == 0) {
//             GetInfo(BaseApplication.get());
//         }
//         return screenMin;
//     }
// 
//     public static int getScreenMax() {
//         if (screenMin == 0) {
//             GetInfo(BaseApplication.get());
//         }
//         return screenMax;
//     }
// 
//     public static int getDialogWidth() {
//         dialogWidth = (int) (getScreenMin() * RATIO);
//         return dialogWidth;
//     }
// 
//     public static String getImageDensity(){
//         return getDisplayWidth()+"*"+getDisplayHeight();
//     }
// }
// 
// Path: app/src/main/java/com/github/zzwwws/rxzhihudaily/common/util/StrictModeUtil.java
// public class StrictModeUtil {
// 
//     public static void startStrictMode(){
//         if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD){
//             startThreadStrictMode();
//             startVmStrictMode();
//         }
//     }
// 
//     @TargetApi(9)
//     private static final void startThreadStrictMode(){
//         StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectAll().permitDiskReads().permitDiskWrites().penaltyLog().build());
//     }
// 
//     @TargetApi(9)
//     private static final void startVmStrictMode(){
//         StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectAll().penaltyLog().build());
//     }
// }


// Path: app/src/main/java/com/github/zzwwws/rxzhihudaily/common/BaseApplication.java
import android.app.Application;
import com.github.zzwwws.rxzhihudaily.common.util.ScreenUtil;
import com.github.zzwwws.rxzhihudaily.common.util.StrictModeUtil;

package com.github.zzwwws.rxzhihudaily.common;



public class BaseApplication extends Application {

    private static BaseApplication instance;

    public static BaseApplication get() {
        return instance;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        instance = (BaseApplication) getApplicationContext();

        if (AppConfig.DEBUG) {
            StrictModeUtil.startStrictMode();