package com.mobile.constellations.util;

import android.content.Context;

/**
 * 存储升级相关的信息
 * @author WuYiMing
 *
 */
public class ConfigPreferences extends BaseSharedPreferences{

	private static final String NAME = "config";
	public static final String KEY_FIRST_TIME_LOGIN = "first_time_login";
	private static ConfigPreferences mInstance;
	
	public static ConfigPreferences getInstance(Context ctx) {
		if(mInstance == null) {
			mInstance = new ConfigPreferences(ctx);
		}
		return mInstance;
	}
	
	private ConfigPreferences(Context ctx) {
		super(ctx);
	}

	@Override
	public String getSpNmae() {
		return NAME;
	}
	
	public void setFirstTimeLogin(boolean firstTime) {
		getSp().edit().putBoolean(KEY_FIRST_TIME_LOGIN, firstTime).commit();
	}
	
	public boolean isFirstTimeLogin() {
		return getSp().getBoolean(KEY_FIRST_TIME_LOGIN, true);
	}
	
}
