// Path: app/src/main/java/com/github/cchao/touchnews/BaseApplication.java
// public class BaseApplication extends Application {
//     public static BaiDuApiService mBaiDuApiService;
//     public static AppComponent mAppComponent;
//     private static Application mApplication;
// 
//     public static AppComponent getAppComponent() {
//         mBaiDuApiService = mAppComponent.getBaiDuApiService();
//         return mAppComponent;
//     }
// 
//     public static Context getContext() {
//         return mApplication;
//     }
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         setupLogUtils();
//         setupComponent();
//         mApplication = this;
//         MobclickAgent.startWithConfigure(new MobclickAgent.UMAnalyticsConfig(this, "5739942de0f55a0b3c001aab", "APP0"));
//     }
// 
//     /**
//      * 设置LogUtil
//      */
//     private void setupLogUtils() {
//         LogUtils.getLogConfig()
//             .configAllowLog(true)
//             .configTagPrefix("TouchNews")
//             .configShowBorders(true)
//             .configLevel(LogLevel.TYPE_VERBOSE);
//     }
// 
//     /**
//      * 设置AppComponent
//      */
//     private void setupComponent() {
//         mAppComponent = DaggerAppComponent.builder()
//             .appModule(new AppModule(this))
//             .apiModule(new ApiModule())
//             .build();
//         mBaiDuApiService = mAppComponent.getBaiDuApiService();
// 
//     }
// 
//     @Override
//     public void onLowMemory() {
//         super.onLowMemory();
//     }
// 
//     @Override
//     public void onConfigurationChanged(Configuration newConfig) {
//         super.onConfigurationChanged(newConfig);
//     }
// }


import android.annotation.SuppressLint;
import android.content.Context;
import android.support.annotation.StringRes;
import android.view.View;
import android.widget.Toast;
import com.github.cchao.touchnews.BaseApplication;
package com.github.cchao.touchnews.util;



/**
 * Created by cchao on 2016/4/22.
 * E-mail:   cchao1024@163.com
 * Description:
 */
public class ToastUtil {
    private static Toast toast;
    private static View view;

    private ToastUtil() {
    }

    @SuppressLint("ShowToast")
    private static void getToast(Context context) {
        if (toast == null) {
            toast = new Toast(context);
        }
        if (view == null) {
            view = Toast.makeText(context, "", Toast.LENGTH_SHORT).getView();
        }
        toast.setView(view);
    }

    public static void showShortToast(Context context, CharSequence msg) {
        if (context == null) {
// Path: app/src/main/java/com/github/cchao/touchnews/BaseApplication.java
// public class BaseApplication extends Application {
//     public static BaiDuApiService mBaiDuApiService;
//     public static AppComponent mAppComponent;
//     private static Application mApplication;
// 
//     public static AppComponent getAppComponent() {
//         mBaiDuApiService = mAppComponent.getBaiDuApiService();
//         return mAppComponent;
//     }
// 
//     public static Context getContext() {
//         return mApplication;
//     }
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         setupLogUtils();
//         setupComponent();
//         mApplication = this;
//         MobclickAgent.startWithConfigure(new MobclickAgent.UMAnalyticsConfig(this, "5739942de0f55a0b3c001aab", "APP0"));
//     }
// 
//     /**
//      * 设置LogUtil
//      */
//     private void setupLogUtils() {
//         LogUtils.getLogConfig()
//             .configAllowLog(true)
//             .configTagPrefix("TouchNews")
//             .configShowBorders(true)
//             .configLevel(LogLevel.TYPE_VERBOSE);
//     }
// 
//     /**
//      * 设置AppComponent
//      */
//     private void setupComponent() {
//         mAppComponent = DaggerAppComponent.builder()
//             .appModule(new AppModule(this))
//             .apiModule(new ApiModule())
//             .build();
//         mBaiDuApiService = mAppComponent.getBaiDuApiService();
// 
//     }
// 
//     @Override
//     public void onLowMemory() {
//         super.onLowMemory();
//     }
// 
//     @Override
//     public void onConfigurationChanged(Configuration newConfig) {
//         super.onConfigurationChanged(newConfig);
//     }
// }


// Path: app/src/main/java/com/github/cchao/touchnews/util/ToastUtil.java
import android.annotation.SuppressLint;
import android.content.Context;
import android.support.annotation.StringRes;
import android.view.View;
import android.widget.Toast;
import com.github.cchao.touchnews.BaseApplication;

package com.github.cchao.touchnews.util;



/**
 * Created by cchao on 2016/4/22.
 * E-mail:   cchao1024@163.com
 * Description:
 */
public class ToastUtil {
    private static Toast toast;
    private static View view;

    private ToastUtil() {
    }

    @SuppressLint("ShowToast")
    private static void getToast(Context context) {
        if (toast == null) {
            toast = new Toast(context);
        }
        if (view == null) {
            view = Toast.makeText(context, "", Toast.LENGTH_SHORT).getView();
        }
        toast.setView(view);
    }

    public static void showShortToast(Context context, CharSequence msg) {
        if (context == null) {
            showToast(BaseApplication.getContext(), msg, Toast.LENGTH_SHORT);