// Path: app/src/main/java/com/kong/lib/AppRun.java
// public class AppRun {
// 
//     private Context mContext = null;
// 
//     private static AppRun sInstance;
// 
//     public static AppRun get() {
//         if (sInstance == null) {
//             sInstance = new AppRun();
//         }
//         return sInstance;
//     }
// 
//     public void init(Context context) {
//         if (mContext != null) {
//             throw new IllegalStateException("App just call once init!!");
//         }
//         mContext = context;
//     }
// 
//     private void ensureAppContext() {
//         if (mContext == null) {
//             throw new IllegalStateException("App not call init!!.");
//         }
//     }
// 
//     public Context getApplicationContext() {
//         ensureAppContext();
//         return mContext;
//     }
// 
// }


import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import com.kong.lib.AppRun;
package com.kong.app.news.utils;



/**
 * Created by CaoPengfei on 17/6/17.
 */

public class SettingsUtil {

    public static int getThemeIndex() {
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(AppRun.get().getApplicationContext());
        return prefs.getInt("ThemeIndex", 0);
    }

    public static void setThemeIndex(int index) {
// Path: app/src/main/java/com/kong/lib/AppRun.java
// public class AppRun {
// 
//     private Context mContext = null;
// 
//     private static AppRun sInstance;
// 
//     public static AppRun get() {
//         if (sInstance == null) {
//             sInstance = new AppRun();
//         }
//         return sInstance;
//     }
// 
//     public void init(Context context) {
//         if (mContext != null) {
//             throw new IllegalStateException("App just call once init!!");
//         }
//         mContext = context;
//     }
// 
//     private void ensureAppContext() {
//         if (mContext == null) {
//             throw new IllegalStateException("App not call init!!.");
//         }
//     }
// 
//     public Context getApplicationContext() {
//         ensureAppContext();
//         return mContext;
//     }
// 
// }


// Path: app/src/main/java/com/kong/app/news/utils/SettingsUtil.java
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import com.kong.lib.AppRun;

package com.kong.app.news.utils;



/**
 * Created by CaoPengfei on 17/6/17.
 */

public class SettingsUtil {

    public static int getThemeIndex() {
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(AppRun.get().getApplicationContext());
        return prefs.getInt("ThemeIndex", 0);
    }

    public static void setThemeIndex(int index) {
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(AppRun.get().getApplicationContext());