From 405e8b2d2ad9a2d6d51cd65173b42c9fcde0ce4f Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期一, 29 三月 2021 19:00:03 +0800 Subject: [PATCH] 白色背景修改 --- BuWanVideo/src/com/weikou/beibeivideo/util/ConfigUtil.java | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/BuWanVideo/src/com/weikou/beibeivideo/util/ConfigUtil.java b/BuWanVideo/src/com/weikou/beibeivideo/util/ConfigUtil.java index 216d10b..dc28af9 100644 --- a/BuWanVideo/src/com/weikou/beibeivideo/util/ConfigUtil.java +++ b/BuWanVideo/src/com/weikou/beibeivideo/util/ConfigUtil.java @@ -3,6 +3,12 @@ import android.content.Context; import android.content.SharedPreferences; +import com.lcjian.library.util.common.StringUtils; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + public class ConfigUtil { public static void saveVipLink(Context context, String link) { @@ -13,6 +19,21 @@ return getConfig("vipLink", context); } + + public static void saveWebSpeedUpHost(Context context, String hosts) { + saveConfig("webSpeedUpHost", hosts, context); + } + + public static Set<String> getWebSpeedUpHost(Context context) { + Set<String> set = new HashSet<>(); + String value = getConfig("webSpeedUpHost", context); + if (!StringUtils.isEmpty(value)) { + set.addAll(Arrays.asList(value.split(","))); + } + return set; + } + + private static void saveConfig(String key, String value, Context context) { SharedPreferences.Editor editor = context.getSharedPreferences("config", Context.MODE_PRIVATE).edit(); editor.putString(key, value); @@ -21,6 +42,8 @@ private static String getConfig(String key, Context context) { + if (context == null) + return null; SharedPreferences share = context.getSharedPreferences("config", Context.MODE_PRIVATE); return share.getString(key, ""); } -- Gitblit v1.8.0