// Path: chh/src/main/java/com/fei_ke/chiphellclient/utils/GlobalSetting.java
// public class GlobalSetting {
//     private static final String SETTING = "setting";
//     public static final String SWIPE_BACK_EDGE = "swipe_back_edge";
//     public static final String FORUM_ADDRESS = "forum_address";
//     public static final String DEFAULT_FORUM_ADDRESS;
// 
//     private static SharedPreferences mPreferences;
// 
//     static {
//         DEFAULT_FORUM_ADDRESS = ChhApplication.getInstance().getString(R.string.default_forum_address);
//         mPreferences = ChhApplication.getInstance().getSharedPreferences(SETTING, Context.MODE_PRIVATE);
//     }
// 
//     public static int getSwipeBackEdge() {
//         return mPreferences.getInt(SWIPE_BACK_EDGE, 1);
//     }
// 
//     public static void putSwipeBackEdge(int edge) {
//         putInt(SWIPE_BACK_EDGE, edge);
//     }
// 
//     public static String getForumAddress() {
//         return mPreferences.getString(FORUM_ADDRESS, DEFAULT_FORUM_ADDRESS);
//     }
// 
//     public static void setForumAddress(String forumAddress) {
//         putString(FORUM_ADDRESS, forumAddress);
//     }
// 
//     private static void putInt(String key, int value) {
//         mPreferences.edit().putInt(key, value).apply();
//     }
// 
//     private static void putString(String key, String value) {
//         mPreferences.edit().putString(key, value).apply();
//     }
// }


import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.ActionBar;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import com.fei_ke.chiphellclient.R;
import com.fei_ke.chiphellclient.utils.GlobalSetting;
import com.umeng.analytics.MobclickAgent;
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.EActivity;
import me.imid.swipebacklayout.lib.app.SwipeBackActivity;

package com.fei_ke.chiphellclient.ui.activity;





/**
 * Activity基类
 *
 * @author fei-ke
 * @2014-6-14
 */
@EActivity
public abstract class BaseActivity extends SwipeBackActivity {
    protected MenuItem menuItemRefresh;
    boolean mIsRefreshing = true;
    private Toolbar toolbar;

    /**
     * 切勿调用和复写此方法
     */
    @AfterViews
    final protected void onPrivateAfterViews() {
        onAfterViews();
    }

    /**
     * 此方法在onCreate之后调用,勿在此方法上添加@AfterViews注解
     */
    protected abstract void onAfterViews();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
// Path: chh/src/main/java/com/fei_ke/chiphellclient/utils/GlobalSetting.java
// public class GlobalSetting {
//     private static final String SETTING = "setting";
//     public static final String SWIPE_BACK_EDGE = "swipe_back_edge";
//     public static final String FORUM_ADDRESS = "forum_address";
//     public static final String DEFAULT_FORUM_ADDRESS;
// 
//     private static SharedPreferences mPreferences;
// 
//     static {
//         DEFAULT_FORUM_ADDRESS = ChhApplication.getInstance().getString(R.string.default_forum_address);
//         mPreferences = ChhApplication.getInstance().getSharedPreferences(SETTING, Context.MODE_PRIVATE);
//     }
// 
//     public static int getSwipeBackEdge() {
//         return mPreferences.getInt(SWIPE_BACK_EDGE, 1);
//     }
// 
//     public static void putSwipeBackEdge(int edge) {
//         putInt(SWIPE_BACK_EDGE, edge);
//     }
// 
//     public static String getForumAddress() {
//         return mPreferences.getString(FORUM_ADDRESS, DEFAULT_FORUM_ADDRESS);
//     }
// 
//     public static void setForumAddress(String forumAddress) {
//         putString(FORUM_ADDRESS, forumAddress);
//     }
// 
//     private static void putInt(String key, int value) {
//         mPreferences.edit().putInt(key, value).apply();
//     }
// 
//     private static void putString(String key, String value) {
//         mPreferences.edit().putString(key, value).apply();
//     }
// }


// Path: chh/src/main/java/com/fei_ke/chiphellclient/ui/activity/BaseActivity.java
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.ActionBar;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import com.fei_ke.chiphellclient.R;
import com.fei_ke.chiphellclient.utils.GlobalSetting;
import com.umeng.analytics.MobclickAgent;
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.EActivity;
import me.imid.swipebacklayout.lib.app.SwipeBackActivity;


package com.fei_ke.chiphellclient.ui.activity;





/**
 * Activity基类
 *
 * @author fei-ke
 * @2014-6-14
 */
@EActivity
public abstract class BaseActivity extends SwipeBackActivity {
    protected MenuItem menuItemRefresh;
    boolean mIsRefreshing = true;
    private Toolbar toolbar;

    /**
     * 切勿调用和复写此方法
     */
    @AfterViews
    final protected void onPrivateAfterViews() {
        onAfterViews();
    }

    /**
     * 此方法在onCreate之后调用,勿在此方法上添加@AfterViews注解
     */
    protected abstract void onAfterViews();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getSwipeBackLayout().setEdgeTrackingEnabled(GlobalSetting.getSwipeBackEdge());