| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 保存购买记录 |
| | | * |
| | | * @param context |
| | | * @param content |
| | | */ |
| | | public static void saveBuyRecordUrl(Context context, String content) { |
| | | saveConfig("buyRecordUrl", content, context); |
| | | } |
| | | |
| | | |
| | | public static String getBuyRecordUrl(Context context) { |
| | | return getConfig("buyRecordUrl", context); |
| | | } |
| | | |
| | | |
| | | public static void saveOnLining(Context context, boolean content) { |
| | | saveConfig("onLining", content+"", context); |
| | | } |
| | | |
| | | |
| | | public static boolean isOnLining(Context context) { |
| | | String onLine= getConfig("onLining", context); |
| | | if(StringUtils.isEmpty(onLine)){ |
| | | return false; |
| | | } |
| | | return Boolean.parseBoolean(onLine); |
| | | } |
| | | |
| | | |
| | | public static void saveAiDaoMode(Context context, boolean content) { |
| | | saveConfig("aiDaoMode", content+"", context); |
| | | } |
| | | |
| | | public static boolean isAiDaoMode(Context context){ |
| | | String onLine= getConfig("aiDaoMode", context); |
| | | if(StringUtils.isEmpty(onLine)){ |
| | | return false; |
| | | } |
| | | return Boolean.parseBoolean(onLine); |
| | | } |
| | | |
| | | |
| | | private static void saveConfig(String key, String value, Context context) { |
| | | SharedPreferences.Editor editor = context.getSharedPreferences("config", Context.MODE_PRIVATE).edit(); |
| | | editor.putString(key, value); |