| 1 | package tw.nekomimi.nekogram; |
| 2 | |
| 3 | import android.app.Activity; |
| 4 | import android.content.Intent; |
| 5 | import android.content.SharedPreferences; |
| 6 | import android.content.pm.ApplicationInfo; |
| 7 | import android.content.pm.PackageManager; |
| 8 | import android.content.res.Configuration; |
| 9 | import android.graphics.Typeface; |
| 10 | |
| 11 | import org.telegram.messenger.AndroidUtilities; |
| 12 | import org.telegram.messenger.ApplicationLoader; |
| 13 | import org.telegram.messenger.BuildVars; |
| 14 | import org.telegram.messenger.FileLog; |
| 15 | import org.telegram.messenger.LocaleController; |
| 16 | import org.telegram.messenger.NotificationCenter; |
| 17 | import org.telegram.messenger.NotificationsService; |
| 18 | import org.telegram.messenger.R; |
| 19 | import org.telegram.ui.ActionBar.Theme; |
| 20 | |
| 21 | import java.io.BufferedReader; |
| 22 | import java.io.FileReader; |
| 23 | import java.util.Locale; |
| 24 | import java.util.regex.Matcher; |
| 25 | import java.util.regex.Pattern; |
| 26 | |
| 27 | import cn.hutool.core.util.StrUtil; |
| 28 | |
| 29 | public class NekoConfig { |
| 30 | |
| 31 | public static final int TITLE_TYPE_TEXT = 0; |
| 32 | public static final int TITLE_TYPE_ICON = 1; |
| 33 | public static final int TITLE_TYPE_MIX = 2; |
| 34 | |
| 35 | public static SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE); |
| 36 | |
| 37 | public static boolean useIPv6; |
| 38 | |
| 39 | public static boolean useSystemEmoji; |
| 40 | public static boolean ignoreBlocked; |
| 41 | public static boolean hideProxySponsorChannel; |
| 42 | public static boolean disablePhotoSideAction; |
| 43 | public static boolean hideKeyboardOnChatScroll; |
| 44 | public static boolean rearVideoMessages; |
| 45 | public static boolean hideAllTab; |
| 46 | public static boolean pressTitleToOpenAllChats; |
| 47 | public static boolean confirmAVMessage; |
| 48 | public static boolean askBeforeCall; |
| 49 | public static boolean disableNumberRounding; |
| 50 | public static int mapPreviewProvider; |
| 51 | public static float stickerSize; |
| 52 | public static int translationProvider; |
| 53 | public static int tabsTitleType; |
| 54 | |
| 55 | public static boolean showAddToSavedMessages; |
| 56 | public static boolean showReport; |
| 57 | public static boolean showViewHistory; |
| 58 | public static boolean showAdminActions; |
| 59 | public static boolean showChangePermissions; |
| 60 | public static boolean showDeleteDownloadedFile; |
| 61 | public static boolean showMessageDetails; |
| 62 | public static boolean showTranslate; |
| 63 | public static boolean showRepeat; |
| 64 | public static boolean showMessageHide; |
| 65 | |
| 66 | public static boolean hidePhone; |
| 67 | public static int typeface; |
| 68 | public static boolean transparentStatusBar; |
| 69 | public static int tabletMode; |
| 70 | public static boolean openArchiveOnPull; |
| 71 | public static boolean avatarAsDrawerBackground; |
| 72 | public static boolean showTabsOnForward; |
| 73 | public static int nameOrder; |
| 74 | public static int eventType; |
| 75 | public static boolean newYear; |
| 76 | public static int actionBarDecoration; |
| 77 | public static boolean unlimitedFavedStickers; |
| 78 | public static boolean unlimitedPinnedDialogs; |
| 79 | public static boolean residentNotification; |
| 80 | |
| 81 | public static boolean disableChatAction; |
| 82 | public static boolean sortByUnread; |
| 83 | public static boolean sortByUnmuted; |
| 84 | public static boolean sortByUser; |
| 85 | public static boolean sortByContacts; |
| 86 | |
| 87 | public static boolean disableUndo; |
| 88 | |
| 89 | public static boolean filterUsers; |
| 90 | public static boolean filterContacts; |
| 91 | public static boolean filterGroups; |
| 92 | public static boolean filterChannels; |
| 93 | public static boolean filterBots; |
| 94 | public static boolean filterAdmins; |
| 95 | public static boolean filterUnmuted; |
| 96 | public static boolean filterUnread; |
| 97 | public static boolean filterUnmutedAndUnread; |
| 98 | |
| 99 | public static boolean ignoreMutedCount; |
| 100 | |
| 101 | public static boolean disableSystemAccount; |
| 102 | public static boolean disableProxyWhenVpnEnabled; |
| 103 | public static boolean skipOpenLinkConfirm; |
| 104 | |
| 105 | public static boolean useDefaultTheme; |
| 106 | public static boolean showIdAndDc; |
| 107 | |
| 108 | public static String googleCloudTranslateKey; |
| 109 | |
| 110 | public static String cachePath; |
| 111 | private static Typeface systemEmojiTypeface; |
| 112 | public static boolean loadSystemEmojiFailed = false; |
| 113 | |
| 114 | public static String translateToLang; |
| 115 | public static String translateInputLang; |
| 116 | |
| 117 | public static String ccToLang; |
| 118 | public static String ccInputLang; |
| 119 | public static boolean increaseVoiceMessageQuality; |
| 120 | |
| 121 | public static boolean hideProxyByDefault; |
| 122 | public static boolean useProxyItem; |
| 123 | |
| 124 | public static boolean disableAppBarShadow; |
| 125 | public static boolean mediaPreview; |
| 126 | |
| 127 | public static boolean proxyAutoSwitch; |
| 128 | |
| 129 | public static int usePersianCalendar; |
| 130 | public static boolean displayPersianCalendarByLatin; |
| 131 | |
| 132 | public static String openPGPApp; |
| 133 | public static long openPGPKeyId; |
| 134 | |
| 135 | public static boolean disableVibration; |
| 136 | public static boolean autoPauseVideo; |
| 137 | public static boolean disableProximityEvents; |
| 138 | |
| 139 | public static boolean ignoreContentRestrictions; |
| 140 | public static boolean useChatAttachMediaMenu; |
| 141 | public static boolean disableLinkPreviewByDefault; |
| 142 | public static boolean sendCommentAfterForward; |
| 143 | public static boolean acceptSecretChat; |
| 144 | |
| 145 | public static boolean avatarBackgroundBlur; |
| 146 | public static boolean avatarBackgroundDarken; |
| 147 | public static boolean disableTrending; |
| 148 | public static boolean dontSendGreetingSticker; |
| 149 | public static boolean hideTimeForSticker; |
| 150 | public static boolean takeGIFasVideo; |
| 151 | |
| 152 | public static boolean disableAutoDownloadingWin32Executable; |
| 153 | public static boolean disableAutoDownloadingArchive; |
| 154 | |
| 155 | public static boolean enableStickerPin; |
| 156 | public static boolean useMediaStreamInVoip; |
| 157 | |
| 158 | public static String getOpenPGPAppName() { |
| 159 | |
| 160 | if (StrUtil.isNotBlank(openPGPApp)) { |
| 161 | |
| 162 | try { |
| 163 | PackageManager manager = ApplicationLoader.applicationContext.getPackageManager(); |
| 164 | ApplicationInfo info = manager.getApplicationInfo(openPGPApp, PackageManager.GET_META_DATA); |
| 165 | return (String) manager.getApplicationLabel(info); |
| 166 | } catch (PackageManager.NameNotFoundException e) { |
| 167 | openPGPApp = ""; |
| 168 | } |
| 169 | |
| 170 | } |
| 171 | |
| 172 | return LocaleController.getString("None", R.string.None); |
| 173 | |
| 174 | } |
| 175 | |
| 176 | public static String formatLang(String name) { |
| 177 | |
| 178 | if (name == null) { |
| 179 | |
| 180 | return LocaleController.getString("Default", R.string.Default); |
| 181 | |
| 182 | } else { |
| 183 | |
| 184 | if (name.contains("-")) { |
| 185 | |
| 186 | return new Locale(StrUtil.subBefore(name, "-", false), StrUtil.subAfter(name, "-", false)).getDisplayName(LocaleController.getInstance().currentLocale); |
| 187 | |
| 188 | } else { |
| 189 | |
| 190 | return new Locale(name).getDisplayName(LocaleController.getInstance().currentLocale); |
| 191 | |
| 192 | } |
| 193 | |
| 194 | } |
| 195 | |
| 196 | } |
| 197 | |
| 198 | static { |
| 199 | |
| 200 | useIPv6 = preferences.getBoolean("useIPv6", false); |
| 201 | hidePhone = preferences.getBoolean("hidePhone", true); |
| 202 | ignoreBlocked = preferences.getBoolean("ignoreBlocked", false); |
| 203 | |
| 204 | boolean forceTablet = preferences.getBoolean("forceTablet", false); |
| 205 | if (forceTablet) { |
| 206 | tabletMode = 1; |
| 207 | preferences.edit() |
| 208 | .remove("forceTablet") |
| 209 | .putInt("tabletMode", 1) |
| 210 | .apply(); |
| 211 | } else { |
| 212 | tabletMode = preferences.getInt("tabletMode", 0); |
| 213 | } |
| 214 | |
| 215 | typeface = preferences.getInt("typeface", 0); |
| 216 | nameOrder = preferences.getInt("nameOrder", 1); |
| 217 | mapPreviewProvider = preferences.getInt("mapPreviewProvider", 0); |
| 218 | transparentStatusBar = preferences.getBoolean("transparentStatusBar", false); |
| 219 | residentNotification = preferences.getBoolean("residentNotification", false); |
| 220 | hideProxySponsorChannel = preferences.getBoolean("hideProxySponsorChannel", false); |
| 221 | showAddToSavedMessages = preferences.getBoolean("showAddToSavedMessages", true); |
| 222 | showReport = preferences.getBoolean("showReport", true); |
| 223 | showViewHistory = preferences.getBoolean("showViewHistory", true); |
| 224 | showAdminActions = preferences.getBoolean("showAdminActions", true); |
| 225 | showChangePermissions = preferences.getBoolean("showChangePermissions", true); |
| 226 | showDeleteDownloadedFile = preferences.getBoolean("showDeleteDownloadedFile", true); |
| 227 | showMessageDetails = preferences.getBoolean("showMessageDetails", false); |
| 228 | showTranslate = preferences.getBoolean("showTranslate", true); |
| 229 | showRepeat = preferences.getBoolean("showRepeat", false); |
| 230 | showMessageHide = preferences.getBoolean("showMessageHide", false); |
| 231 | |
| 232 | eventType = preferences.getInt("eventType", 0); |
| 233 | actionBarDecoration = preferences.getInt("actionBarDecoration", 0); |
| 234 | newYear = preferences.getBoolean("newYear", false); |
| 235 | stickerSize = preferences.getFloat("stickerSize", 14.0f); |
| 236 | unlimitedFavedStickers = preferences.getBoolean("unlimitedFavedStickers", false); |
| 237 | unlimitedPinnedDialogs = preferences.getBoolean("unlimitedPinnedDialogs", false); |
| 238 | translationProvider = preferences.getInt("translationProvider", 1); |
| 239 | disablePhotoSideAction = preferences.getBoolean("disablePhotoSideAction", true); |
| 240 | openArchiveOnPull = preferences.getBoolean("openArchiveOnPull", false); |
| 241 | //showHiddenFeature = preferences.getBoolean("showHiddenFeature", false); |
| 242 | hideKeyboardOnChatScroll = preferences.getBoolean("hideKeyboardOnChatScroll", false); |
| 243 | avatarAsDrawerBackground = preferences.getBoolean("avatarAsDrawerBackground", true); |
| 244 | avatarBackgroundBlur = preferences.getBoolean("avatarBackgroundBlur", false); |
| 245 | avatarBackgroundDarken = preferences.getBoolean("avatarBackgroundDarken", false); |
| 246 | useSystemEmoji = preferences.getBoolean("useSystemEmoji", false); |
| 247 | showTabsOnForward = preferences.getBoolean("showTabsOnForward", false); |
| 248 | rearVideoMessages = preferences.getBoolean("rearVideoMessages", false); |
| 249 | hideAllTab = preferences.getBoolean("hideAllTab", false); |
| 250 | pressTitleToOpenAllChats = preferences.getBoolean("pressTitleToOpenAllChats", false); |
| 251 | |
| 252 | disableChatAction = preferences.getBoolean("disable_chat_action", false); |
| 253 | sortByUnread = preferences.getBoolean("sort_by_unread", false); |
| 254 | sortByUnmuted = preferences.getBoolean("sort_by_unmuted", true); |
| 255 | sortByUser = preferences.getBoolean("sort_by_user", true); |
| 256 | sortByContacts = preferences.getBoolean("sort_by_contacts", true); |
| 257 | |
| 258 | disableUndo = preferences.getBoolean("disable_undo", false); |
| 259 | |
| 260 | filterUsers = preferences.getBoolean("filter_users", true); |
| 261 | filterContacts = preferences.getBoolean("filter_contacts", true); |
| 262 | filterGroups = preferences.getBoolean("filter_groups", true); |
| 263 | filterChannels = preferences.getBoolean("filter_channels", true); |
| 264 | filterBots = preferences.getBoolean("filter_bots", true); |
| 265 | filterAdmins = preferences.getBoolean("filter_admins", true); |
| 266 | filterUnmuted = preferences.getBoolean("filter_unmuted", true); |
| 267 | filterUnread = preferences.getBoolean("filter_unread", true); |
| 268 | filterUnmutedAndUnread = preferences.getBoolean("filter_unmuted_and_unread", true); |
| 269 | |
| 270 | disableSystemAccount = preferences.getBoolean("disable_system_account", false); |
| 271 | disableProxyWhenVpnEnabled = preferences.getBoolean("disable_proxy_when_vpn_enabled", false); |
| 272 | skipOpenLinkConfirm = preferences.getBoolean("skip_open_link_confirm", false); |
| 273 | |
| 274 | ignoreMutedCount = preferences.getBoolean("ignore_muted_count", true); |
| 275 | useDefaultTheme = preferences.getBoolean("use_default_theme", false); |
| 276 | showIdAndDc = preferences.getBoolean("show_id_and_dc", false); |
| 277 | |
| 278 | googleCloudTranslateKey = preferences.getString("google_cloud_translate_key", null); |
| 279 | cachePath = preferences.getString("cache_path", null); |
| 280 | |
| 281 | translateToLang = preferences.getString("trans_to_lang", null); |
| 282 | translateInputLang = preferences.getString("trans_input_to_lang", "en"); |
| 283 | |
| 284 | ccToLang = preferences.getString("opencc_to_lang", null); |
| 285 | ccInputLang = preferences.getString("opencc_input_to_lang", null); |
| 286 | |
| 287 | tabsTitleType = preferences.getInt("tabsTitleType", TITLE_TYPE_TEXT); |
| 288 | confirmAVMessage = preferences.getBoolean("confirmAVMessage", false); |
| 289 | askBeforeCall = preferences.getBoolean("askBeforeCall", false); |
| 290 | disableNumberRounding = preferences.getBoolean("disableNumberRounding", false); |
| 291 | |
| 292 | hideProxyByDefault = preferences.getBoolean("hide_proxy_by_default", false); |
| 293 | useProxyItem = preferences.getBoolean("use_proxy_item", true); |
| 294 | |
| 295 | disableAppBarShadow = preferences.getBoolean("disableAppBarShadow", false); |
| 296 | mediaPreview = preferences.getBoolean("mediaPreview", true); |
| 297 | |
| 298 | proxyAutoSwitch = preferences.getBoolean("proxy_auto_switch", false); |
| 299 | |
| 300 | usePersianCalendar = preferences.getInt("persian_calendar", 0); |
| 301 | displayPersianCalendarByLatin = preferences.getBoolean("displayPersianCalendarByLatin", false); |
| 302 | openPGPApp = preferences.getString("openPGPApp", ""); |
| 303 | openPGPKeyId = preferences.getLong("openPGPKeyId", 0L); |
| 304 | |
| 305 | disableVibration = preferences.getBoolean("disableVibration", false); |
| 306 | autoPauseVideo = preferences.getBoolean("autoPauseVideo", false); |
| 307 | disableProximityEvents = preferences.getBoolean("disableProximityEvents", false); |
| 308 | |
| 309 | ignoreContentRestrictions = preferences.getBoolean("ignoreContentRestrictions", !BuildVars.isPlay); |
| 310 | useChatAttachMediaMenu = preferences.getBoolean("useChatAttachMediaMenu", true); |
| 311 | disableLinkPreviewByDefault = preferences.getBoolean("disableLinkPreviewByDefault", false); |
| 312 | sendCommentAfterForward = preferences.getBoolean("sendCommentAfterForward", true); |
| 313 | increaseVoiceMessageQuality = preferences.getBoolean("increaseVoiceMessageQuality", true); |
| 314 | acceptSecretChat = preferences.getBoolean("acceptSecretChat", true); |
| 315 | disableTrending = preferences.getBoolean("disableTrending", true); |
| 316 | dontSendGreetingSticker = preferences.getBoolean("dontSendGreetingSticker", false); |
| 317 | hideTimeForSticker = preferences.getBoolean("hideTimeForSticker", false); |
| 318 | takeGIFasVideo = preferences.getBoolean("takeGIFasVideo", false); |
| 319 | |
| 320 | disableAutoDownloadingWin32Executable = preferences.getBoolean("disableAutoDownloadingWin32Executable", true); |
| 321 | disableAutoDownloadingArchive = preferences.getBoolean("disableAutoDownloadingArchive", true); |
| 322 | |
| 323 | enableStickerPin = preferences.getBoolean("enableStickerPin", false); |
| 324 | useMediaStreamInVoip = preferences.getBoolean("useMediaStreamInVoip", false); |
| 325 | |
| 326 | } |
| 327 | |
| 328 | public static void toggleShowAddToSavedMessages() { |
| 329 | showAddToSavedMessages = !showAddToSavedMessages; |
| 330 | SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE); |
| 331 | SharedPreferences.Editor editor = preferences.edit(); |
| 332 | editor.putBoolean("showAddToSavedMessages", showAddToSavedMessages); |
| 333 | editor.apply(); |
| 334 | } |
| 335 | |
| 336 | public static void toggleShowReport() { |
| 337 | showReport = !showReport; |
| 338 | SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE); |
| 339 | SharedPreferences.Editor editor = preferences.edit(); |
| 340 | editor.putBoolean("showReport", showReport); |
| 341 | editor.apply(); |
| 342 | } |
| 343 | |
| 344 | public static void toggleShowViewHistory() { |
| 345 | showViewHistory = !showViewHistory; |
| 346 | SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE); |
| 347 | SharedPreferences.Editor editor = preferences.edit(); |
| 348 | editor.putBoolean("showViewHistory", showViewHistory); |
| 349 | editor.apply(); |
| 350 | } |
| 351 | |
| 352 | public static void toggleShowAdminActions() { |
| 353 | showAdminActions = !showAdminActions; |
| 354 | SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE); |
| 355 | SharedPreferences.Editor editor = preferences.edit(); |
| 356 | editor.putBoolean("showAdminActions", showAdminActions); |
| 357 | editor.apply(); |
| 358 | } |
| 359 | |
| 360 | public static void toggleShowChangePermissions() { |
| 361 | showChangePermissions = !showChangePermissions; |
| 362 | SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE); |
| 363 | SharedPreferences.Editor editor = preferences.edit(); |
| 364 | editor.putBoolean("showChangePermissions", showChangePermissions); |
| 365 | editor.apply(); |
| 366 | } |
| 367 | |
| 368 | public static void toggleShowDeleteDownloadedFile() { |
| 369 | showDeleteDownloadedFile = !showDeleteDownloadedFile; |
| 370 | SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE); |
| 371 | SharedPreferences.Editor editor = preferences.edit(); |
| 372 | editor.putBoolean("showDeleteDownloadedFile", showDeleteDownloadedFile); |
| 373 | editor.apply(); |
| 374 | } |
| 375 | |
| 376 | public static void toggleShowMessageDetails() { |
| 377 | showMessageDetails = !showMessageDetails; |
| 378 | SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE); |
| 379 | SharedPreferences.Editor editor = preferences.edit(); |
| 380 | editor.putBoolean("showMessageDetails", showMessageDetails); |
| 381 | editor.apply(); |
| 382 | } |
| 383 | |
| 384 | public static void toggleShowRepeat() { |
| 385 | showRepeat = !showRepeat; |
| 386 | SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE); |
| 387 | SharedPreferences.Editor editor = preferences.edit(); |
| 388 | editor.putBoolean("showRepeat", showRepeat); |
| 389 | editor.apply(); |
| 390 | } |
| 391 | |
| 392 | public static void toggleShowHide() { |
| 393 | showMessageHide = !showMessageHide; |
| 394 | SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE); |
| 395 | SharedPreferences.Editor editor = preferences.edit(); |
| 396 | editor.putBoolean("showMessageHide", showMessageHide); |
| 397 | editor.apply(); |
| 398 | } |
| 399 | |
| 400 | public static void toggleIPv6() { |
| 401 | useIPv6 = !useIPv6; |
| 402 | SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE); |
| 403 | SharedPreferences.Editor editor = preferences.edit(); |
| 404 | editor.putBoolean("useIPv6", useIPv6); |
| 405 | editor.apply(); |
| 406 | } |
| 407 | |
| 408 | public static void toggleHidePhone() { |
| 409 | hidePhone = !hidePhone; |
| 410 | SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE); |
| 411 | SharedPreferences.Editor editor = preferences.edit(); |
| 412 | editor.putBoolean("hidePhone", hidePhone); |
| 413 | editor.apply(); |
| 414 | } |
| 415 | |
| 416 | public static void toggleIgnoreBlocked() { |
| 417 | ignoreBlocked = !ignoreBlocked; |
| 418 | SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE); |
| 419 | SharedPreferences.Editor editor = preferences.edit(); |
| 420 | editor.putBoolean("ignoreBlocked", ignoreBlocked); |
| 421 | editor.apply(); |
| 422 | } |
| 423 | |
| 424 | public static void toggleTypeface() { |
| 425 | typeface = typeface == 0 ? 1 : 0; |
| 426 | SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE); |
| 427 | SharedPreferences.Editor editor = preferences.edit(); |
| 428 | editor.putInt("typeface", typeface); |
| 429 | editor.apply(); |
| 430 | } |
| 431 | |
| 432 | public static void setNameOrder(int order) { |
| 433 | nameOrder = order; |
| 434 | SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE); |
| 435 | SharedPreferences.Editor editor = preferences.edit(); |
| 436 | editor.putInt("nameOrder", nameOrder); |
| 437 | editor.apply(); |
| 438 | |
| 439 | LocaleController.getInstance().recreateFormatters(); |
| 440 | } |
| 441 | |
| 442 | public static void setMapPreviewProvider(int provider) { |
| 443 | mapPreviewProvider = provider; |
| 444 | SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE); |
| 445 | SharedPreferences.Editor editor = preferences.edit(); |
| 446 | editor.putInt("mapPreviewProvider", mapPreviewProvider); |
| 447 | editor.apply(); |
| 448 | } |
| 449 | |
| 450 | public static void toggleTransparentStatusBar() { |
| 451 | transparentStatusBar = !transparentStatusBar; |
| 452 | SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE); |
| 453 | SharedPreferences.Editor editor = preferences.edit(); |
| 454 | editor.putBoolean("transparentStatusBar", transparentStatusBar); |
| 455 | editor.apply(); |
| 456 | } |
| 457 | |
| 458 | public static void toggleResidentNotification() { |
| 459 | residentNotification = !residentNotification; |
| 460 | SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE); |
| 461 | SharedPreferences.Editor editor = preferences.edit(); |
| 462 | editor.putBoolean("residentNotification", residentNotification); |
| 463 | editor.apply(); |
| 464 | ApplicationLoader.applicationContext.stopService(new Intent(ApplicationLoader.applicationContext, NotificationsService.class)); |
| 465 | ApplicationLoader.startPushService(); |
| 466 | } |
| 467 | |
| 468 | public static void toggleHideProxySponsorChannel() { |
| 469 | hideProxySponsorChannel = !hideProxySponsorChannel; |
| 470 | SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE); |
| 471 | SharedPreferences.Editor editor = preferences.edit(); |
| 472 | editor.putBoolean("hideProxySponsorChannel", hideProxySponsorChannel); |
| 473 | editor.apply(); |
| 474 | } |
| 475 | |
| 476 | public static void setActionBarDecoration(int decoration) { |
| 477 | actionBarDecoration = decoration; |
| 478 | SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE); |
| 479 | SharedPreferences.Editor editor = preferences.edit(); |
| 480 | editor.putInt("actionBarDecoration", actionBarDecoration); |
| 481 | editor.apply(); |
| 482 | } |
| 483 | |
| 484 | public static void toggleNewYear() { |
| 485 | newYear = !newYear; |
| 486 | SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE); |
| 487 | SharedPreferences.Editor editor = preferences.edit(); |
| 488 | editor.putBoolean("newYear", newYear); |
| 489 | editor.apply(); |
| 490 | } |
| 491 | |
| 492 | public static void toggleUnlimitedFavedStickers() { |
| 493 | unlimitedFavedStickers = !unlimitedFavedStickers; |
| 494 | SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE); |
| 495 | SharedPreferences.Editor editor = preferences.edit(); |
| 496 | editor.putBoolean("unlimitedFavedStickers", unlimitedFavedStickers); |
| 497 | editor.apply(); |
| 498 | } |
| 499 | |
| 500 | public static void toggleUnlimitedPinnedDialogs() { |
| 501 | unlimitedPinnedDialogs = !unlimitedPinnedDialogs; |
| 502 | SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE); |
| 503 | SharedPreferences.Editor editor = preferences.edit(); |
| 504 | editor.putBoolean("unlimitedPinnedDialogs", unlimitedPinnedDialogs); |
| 505 | editor.apply(); |
| 506 | } |
| 507 | |
| 508 | public static void toggleShowTranslate() { |
| 509 | showTranslate = !showTranslate; |
| 510 | SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE); |
| 511 | SharedPreferences.Editor editor = preferences.edit(); |
| 512 | editor.putBoolean("showTranslate", showTranslate); |
| 513 | editor.apply(); |
| 514 | } |
| 515 | |
| 516 | public static void setStickerSize(float size) { |
| 517 | stickerSize = size; |
| 518 | SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE); |
| 519 | SharedPreferences.Editor editor = preferences.edit(); |
| 520 | editor.putFloat("stickerSize", stickerSize); |
| 521 | editor.apply(); |
| 522 | } |
| 523 | |
| 524 | public static void setTranslationProvider(int provider) { |
| 525 | translationProvider = provider; |
| 526 | SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE); |
| 527 | SharedPreferences.Editor editor = preferences.edit(); |
| 528 | editor.putInt("translationProvider", translationProvider); |
| 529 | editor.apply(); |
| 530 | } |
| 531 | |
| 532 | public static void toggleDisablePhotoSideAction() { |
| 533 | disablePhotoSideAction = !disablePhotoSideAction; |
| 534 | SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE); |
| 535 | SharedPreferences.Editor editor = preferences.edit(); |
| 536 | editor.putBoolean("disablePhotoSideAction", disablePhotoSideAction); |
| 537 | editor.apply(); |
| 538 | } |
| 539 | |
| 540 | public static void toggleOpenArchiveOnPull() { |
| 541 | openArchiveOnPull = !openArchiveOnPull; |
| 542 | SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE); |
| 543 | SharedPreferences.Editor editor = preferences.edit(); |
| 544 | editor.putBoolean("openArchiveOnPull", openArchiveOnPull); |
| 545 | editor.apply(); |
| 546 | } |
| 547 | |
| 548 | public static void toggleHideKeyboardOnChatScroll() { |
| 549 | preferences.edit().putBoolean("hideKeyboardOnChatScroll", hideKeyboardOnChatScroll = !hideKeyboardOnChatScroll).apply(); |
| 550 | } |
| 551 | |
| 552 | public static void toggleAvatarAsDrawerBackground() { |
| 553 | preferences.edit().putBoolean("avatarAsDrawerBackground", avatarAsDrawerBackground = !avatarAsDrawerBackground).apply(); |
| 554 | } |
| 555 | |
| 556 | public static void toggleAvatarBackgroundBlur() { |
| 557 | avatarBackgroundBlur = !avatarBackgroundBlur; |
| 558 | SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE); |
| 559 | SharedPreferences.Editor editor = preferences.edit(); |
| 560 | editor.putBoolean("avatarBackgroundBlur", avatarBackgroundBlur); |
| 561 | editor.commit(); |
| 562 | } |
| 563 | |
| 564 | public static void toggleAvatarBackgroundDarken() { |
| 565 | avatarBackgroundDarken = !avatarBackgroundDarken; |
| 566 | SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE); |
| 567 | SharedPreferences.Editor editor = preferences.edit(); |
| 568 | editor.putBoolean("avatarBackgroundDarken", avatarBackgroundDarken); |
| 569 | editor.commit(); |
| 570 | } |
| 571 | |
| 572 | public static void toggleUseSystemEmoji() { |
| 573 | preferences.edit().putBoolean("useSystemEmoji", useSystemEmoji = !useSystemEmoji).apply(); |
| 574 | } |
| 575 | |
| 576 | public static void toggleDisableChatAction() { |
| 577 | preferences.edit().putBoolean("disable_chat_action", disableChatAction = !disableChatAction).apply(); |
| 578 | } |
| 579 | |
| 580 | public static void toggleSortByUnread() { |
| 581 | preferences.edit().putBoolean("sort_by_unread", sortByUnread = !sortByUnread).apply(); |
| 582 | } |
| 583 | |
| 584 | public static void toggleShowTabsOnForward() { |
| 585 | preferences.edit().putBoolean("showTabsOnForward", showTabsOnForward = !showTabsOnForward).apply(); |
| 586 | } |
| 587 | |
| 588 | public static void toggleRearVideoMessages() { |
| 589 | preferences.edit().putBoolean("rearVideoMessages", rearVideoMessages = !rearVideoMessages).apply(); |
| 590 | } |
| 591 | |
| 592 | public static void toggleHideAllTab() { |
| 593 | preferences.edit().putBoolean("hideAllTab", hideAllTab = !hideAllTab).apply(); |
| 594 | } |
| 595 | |
| 596 | public static void togglePressTitleToOpenAllChats() { |
| 597 | preferences.edit().putBoolean("pressTitleToOpenAllChats", pressTitleToOpenAllChats = !pressTitleToOpenAllChats).apply(); |
| 598 | } |
| 599 | |
| 600 | public static void toggleSortByUnmuted() { |
| 601 | preferences.edit().putBoolean("sort_by_unmuted", sortByUnmuted = !sortByUnmuted).apply(); |
| 602 | } |
| 603 | |
| 604 | public static void toggleSortByUser() { |
| 605 | preferences.edit().putBoolean("sort_by_user", sortByUser = !sortByUser).apply(); |
| 606 | } |
| 607 | |
| 608 | public static void toggleSortByContacts() { |
| 609 | preferences.edit().putBoolean("sort_by_contacts", sortByContacts = !sortByContacts).apply(); |
| 610 | } |
| 611 | |
| 612 | public static void toggleDisableUndo() { |
| 613 | preferences.edit().putBoolean("disable_undo", disableUndo = !disableUndo).apply(); |
| 614 | } |
| 615 | |
| 616 | public static void toggleFilterUsers() { |
| 617 | preferences.edit().putBoolean("filter_users", filterUsers = !filterUsers).apply(); |
| 618 | } |
| 619 | |
| 620 | public static void toggleFilterContacts() { |
| 621 | preferences.edit().putBoolean("filter_contacts", filterContacts = !filterContacts).apply(); |
| 622 | } |
| 623 | |
| 624 | public static void toggleFilterGroups() { |
| 625 | preferences.edit().putBoolean("filterGroups", filterGroups = !filterGroups).apply(); |
| 626 | } |
| 627 | |
| 628 | public static void toggleFilterChannels() { |
| 629 | preferences.edit().putBoolean("filter_channels", filterChannels = !filterChannels).apply(); |
| 630 | } |
| 631 | |
| 632 | public static void toggleFilterBots() { |
| 633 | preferences.edit().putBoolean("filter_bots", filterBots = !filterBots).apply(); |
| 634 | } |
| 635 | |
| 636 | public static void toggleFilterAdmins() { |
| 637 | preferences.edit().putBoolean("filter_admins", filterAdmins = !filterAdmins).apply(); |
| 638 | } |
| 639 | |
| 640 | public static void toggleFilterUnmuted() { |
| 641 | preferences.edit().putBoolean("filter_unmuted", filterUnmuted = !filterUnmuted).apply(); |
| 642 | } |
| 643 | |
| 644 | public static void toggleDisableFilterUnread() { |
| 645 | preferences.edit().putBoolean("filter_unread", filterUnread = !filterUnread).apply(); |
| 646 | } |
| 647 | |
| 648 | public static void toggleFilterUnmutedAndUnread() { |
| 649 | preferences.edit().putBoolean("filter_unmuted_and_unread", filterUnmutedAndUnread = !filterUnmutedAndUnread).apply(); |
| 650 | } |
| 651 | |
| 652 | public static void toggleDisableSystemAccount() { |
| 653 | preferences.edit().putBoolean("disable_system_account", disableSystemAccount = !disableSystemAccount).apply(); |
| 654 | } |
| 655 | |
| 656 | public static void toggleDisableProxyWhenVpnEnabled() { |
| 657 | preferences.edit().putBoolean("disable_proxy_when_vpn_enabled", disableProxyWhenVpnEnabled = !disableProxyWhenVpnEnabled).apply(); |
| 658 | } |
| 659 | |
| 660 | public static void toggleSkipOpenLinkConfirm() { |
| 661 | preferences.edit().putBoolean("skip_open_link_confirm", skipOpenLinkConfirm = !skipOpenLinkConfirm).apply(); |
| 662 | } |
| 663 | |
| 664 | public static void toggleIgnoredMutedCount() { |
| 665 | preferences.edit().putBoolean("ignore_muted_count", ignoreMutedCount = !ignoreMutedCount).apply(); |
| 666 | } |
| 667 | |
| 668 | public static void toggleUseDefaultTheme() { |
| 669 | preferences.edit().putBoolean("use_default_theme", useDefaultTheme = !useDefaultTheme).apply(); |
| 670 | } |
| 671 | |
| 672 | public static void toggleShowIdAndDc() { |
| 673 | preferences.edit().putBoolean("show_id_and_dc", showIdAndDc = !showIdAndDc).apply(); |
| 674 | } |
| 675 | |
| 676 | public static void setGoogleTranslateKey(String key) { |
| 677 | preferences.edit().putString("google_cloud_translate_key", googleCloudTranslateKey = key).apply(); |
| 678 | } |
| 679 | |
| 680 | public static void setCachePath(String cachePath) { |
| 681 | preferences.edit().putString("cache_path", NekoConfig.cachePath = cachePath).apply(); |
| 682 | } |
| 683 | |
| 684 | public static void setTranslateToLang(String toLang) { |
| 685 | preferences.edit().putString("trans_to_lang", translateToLang = toLang).apply(); |
| 686 | } |
| 687 | |
| 688 | public static void setTranslateInputToLang(String toLang) { |
| 689 | preferences.edit().putString("trans_input_to_lang", translateInputLang = toLang).apply(); |
| 690 | } |
| 691 | |
| 692 | public static void setTabsTitleType(int type) { |
| 693 | preferences.edit().putInt("tabsTitleType", tabsTitleType = type).apply(); |
| 694 | } |
| 695 | |
| 696 | public static void toggleConfirmAVMessage() { |
| 697 | preferences.edit().putBoolean("confirmAVMessage", confirmAVMessage = !confirmAVMessage).apply(); |
| 698 | } |
| 699 | |
| 700 | public static void toggleAskBeforeCall() { |
| 701 | preferences.edit().putBoolean("askBeforeCall", askBeforeCall = !askBeforeCall).apply(); |
| 702 | } |
| 703 | |
| 704 | public static void toggleHideProxyByDefault() { |
| 705 | preferences.edit().putBoolean("hide_proxy_by_default", hideProxyByDefault = !hideProxyByDefault).apply(); |
| 706 | NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.proxySettingsChanged); |
| 707 | } |
| 708 | |
| 709 | public static void toggleUseProxyItem() { |
| 710 | preferences.edit().putBoolean("use_proxy_item", useProxyItem = !useProxyItem).apply(); |
| 711 | NotificationCenter.getGlobalInstance().postNotificationName(NotificationCenter.proxySettingsChanged); |
| 712 | } |
| 713 | |
| 714 | public static void toggleDisableNumberRounding() { |
| 715 | preferences.edit().putBoolean("disableNumberRounding", disableNumberRounding = !disableNumberRounding).apply(); |
| 716 | } |
| 717 | |
| 718 | public static void toggleDisableAppBarShadow() { |
| 719 | preferences.edit().putBoolean("disableAppBarShadow", disableAppBarShadow = !disableAppBarShadow).apply(); |
| 720 | } |
| 721 | |
| 722 | public static void toggleMediaPreview() { |
| 723 | preferences.edit().putBoolean("mediaPreview", mediaPreview = !mediaPreview).apply(); |
| 724 | } |
| 725 | |
| 726 | public static void toggleProxyAutoSwitch() { |
| 727 | preferences.edit().putBoolean("proxy_auto_switch", proxyAutoSwitch = !proxyAutoSwitch).apply(); |
| 728 | } |
| 729 | |
| 730 | public static void toggleUsePersiancalendar() { |
| 731 | preferences.edit().putInt("persian_calendar", usePersianCalendar = usePersianCalendar > 1 ? 1 : 2).apply(); |
| 732 | } |
| 733 | |
| 734 | public static void toggleDisplayPersianCalendarByLatin() { |
| 735 | preferences.edit().putBoolean("displayPersianCalendarByLatin", displayPersianCalendarByLatin = !displayPersianCalendarByLatin).apply(); |
| 736 | } |
| 737 | |
| 738 | public static void setOpenPGPApp(String packageName) { |
| 739 | preferences.edit().putString("openPGPApp", openPGPApp = packageName).apply(); |
| 740 | } |
| 741 | |
| 742 | public static void setOpenPGPKeyId(long keyId) { |
| 743 | preferences.edit().putLong("openPGPKeyId", openPGPKeyId = keyId).apply(); |
| 744 | } |
| 745 | |
| 746 | public static void toggleDisableVibration() { |
| 747 | preferences.edit().putBoolean("disableVibration", disableVibration = !disableVibration).apply(); |
| 748 | } |
| 749 | |
| 750 | public static void toggleAutoPauseVideo() { |
| 751 | preferences.edit().putBoolean("autoPauseVideo", autoPauseVideo = !autoPauseVideo).apply(); |
| 752 | } |
| 753 | |
| 754 | public static void toggleDisableProximityEvents() { |
| 755 | preferences.edit().putBoolean("disableProximityEvents", disableProximityEvents = !disableProximityEvents).apply(); |
| 756 | } |
| 757 | |
| 758 | public static void toggleIgnoreContentRestrictions() { |
| 759 | preferences.edit().putBoolean("ignoreContentRestrictions", ignoreContentRestrictions = !ignoreContentRestrictions).apply(); |
| 760 | } |
| 761 | |
| 762 | public static void toggleUseChatAttachMediaMenu() { |
| 763 | preferences.edit().putBoolean("useChatAttachMediaMenu", useChatAttachMediaMenu = !useChatAttachMediaMenu).apply(); |
| 764 | } |
| 765 | |
| 766 | public static void toggleDisableLinkPreviewByDefault() { |
| 767 | preferences.edit().putBoolean("disableLinkPreviewByDefault", disableLinkPreviewByDefault = !disableLinkPreviewByDefault).apply(); |
| 768 | } |
| 769 | |
| 770 | public static void toggleSendCommentAfterForward() { |
| 771 | preferences.edit().putBoolean("sendCommentAfterForward", sendCommentAfterForward = !sendCommentAfterForward).apply(); |
| 772 | } |
| 773 | |
| 774 | public static void setCCToLang(String toLang) { |
| 775 | preferences.edit().putString("opencc_to_lang", ccToLang = toLang).apply(); |
| 776 | } |
| 777 | |
| 778 | public static void setCCInputToLang(String toLang) { |
| 779 | preferences.edit().putString("opencc_input_to_lang", ccInputLang = toLang).apply(); |
| 780 | } |
| 781 | |
| 782 | public static void toggleIncreaseVoiceMessageQuality() { |
| 783 | preferences.edit().putBoolean("increaseVoiceMessageQuality", increaseVoiceMessageQuality = !increaseVoiceMessageQuality).apply(); |
| 784 | } |
| 785 | |
| 786 | public static void toggleAcceptSecretChat() { |
| 787 | preferences.edit().putBoolean("acceptSecretChat", acceptSecretChat = !acceptSecretChat).apply(); |
| 788 | } |
| 789 | |
| 790 | public static void setTabletMode(int mode) { |
| 791 | preferences.edit().putInt("tabletMode", tabletMode = mode).apply(); |
| 792 | } |
| 793 | |
| 794 | public static void toggleDisableTrending() { |
| 795 | preferences.edit().putBoolean("disableTrending", disableTrending = !disableTrending).apply(); |
| 796 | } |
| 797 | |
| 798 | public static void toggleDisableAutoDownloadingWin32Executable() { |
| 799 | preferences.edit().putBoolean("disableAutoDownloadingWin32Executable", disableAutoDownloadingWin32Executable = !disableAutoDownloadingWin32Executable).apply(); |
| 800 | } |
| 801 | |
| 802 | public static void toggleDisableAutoDownloadingArchive() { |
| 803 | preferences.edit().putBoolean("disableAutoDownloadingArchive", disableAutoDownloadingArchive = !disableAutoDownloadingArchive).apply(); |
| 804 | } |
| 805 | |
| 806 | public static void toggleDontSendGreetingSticker() { |
| 807 | preferences.edit().putBoolean("dontSendGreetingSticker", dontSendGreetingSticker = !dontSendGreetingSticker).apply(); |
| 808 | } |
| 809 | |
| 810 | public static void toggleHideTimeForSticker() { |
| 811 | preferences.edit().putBoolean("hideTimeForSticker", hideTimeForSticker = !hideTimeForSticker).apply(); |
| 812 | } |
| 813 | |
| 814 | public static void toggleTakeGIFasVideo() { |
| 815 | preferences.edit().putBoolean("takeGIFasVideo", takeGIFasVideo = !takeGIFasVideo).apply(); |
| 816 | } |
| 817 | |
| 818 | public static void toggleEnableStickerPin() { |
| 819 | preferences.edit().putBoolean("enableStickerPin", enableStickerPin = !enableStickerPin).apply(); |
| 820 | } |
| 821 | |
| 822 | public static void toggleUseMediaStreamInVoip() { |
| 823 | preferences.edit().putBoolean("useMediaStreamInVoip", useMediaStreamInVoip = !useMediaStreamInVoip).apply(); |
| 824 | } |
| 825 | |
| 826 | private static final String EMOJI_FONT_AOSP = "NotoColorEmoji.ttf"; |
| 827 | |
| 828 | public static Typeface getSystemEmojiTypeface() { |
| 829 | if (!loadSystemEmojiFailed && systemEmojiTypeface == null) { |
| 830 | try { |
| 831 | Pattern p = Pattern.compile(">(.*emoji.*)</font>", Pattern.CASE_INSENSITIVE); |
| 832 | BufferedReader br = new BufferedReader(new FileReader("/system/etc/fonts.xml")); |
| 833 | String line; |
| 834 | while ((line = br.readLine()) != null) { |
| 835 | Matcher m = p.matcher(line); |
| 836 | if (m.find()) { |
| 837 | systemEmojiTypeface = Typeface.createFromFile("/system/fonts/" + m.group(1)); |
| 838 | FileLog.d("emoji font file fonts.xml = " + m.group(1)); |
| 839 | break; |
| 840 | } |
| 841 | } |
| 842 | br.close(); |
| 843 | } catch (Exception e) { |
| 844 | FileLog.e(e); |
| 845 | } |
| 846 | if (systemEmojiTypeface == null) { |
| 847 | try { |
| 848 | systemEmojiTypeface = Typeface.createFromFile("/system/fonts/" + EMOJI_FONT_AOSP); |
| 849 | FileLog.d("emoji font file = " + EMOJI_FONT_AOSP); |
| 850 | } catch (Exception e) { |
| 851 | FileLog.e(e); |
| 852 | loadSystemEmojiFailed = true; |
| 853 | } |
| 854 | } |
| 855 | } |
| 856 | return systemEmojiTypeface; |
| 857 | } |
| 858 | |
| 859 | public static int getNotificationColor() { |
| 860 | int color = 0; |
| 861 | Configuration configuration = ApplicationLoader.applicationContext.getResources().getConfiguration(); |
| 862 | boolean isDark = (configuration.uiMode & Configuration.UI_MODE_NIGHT_MASK) == Configuration.UI_MODE_NIGHT_YES; |
| 863 | if (isDark) { |
| 864 | color = 0xffffffff; |
| 865 | } else { |
| 866 | if (Theme.getActiveTheme().hasAccentColors()) { |
| 867 | color = Theme.getActiveTheme().getAccentColor(Theme.getActiveTheme().currentAccentId); |
| 868 | } |
| 869 | if (Theme.getActiveTheme().isDark() || color == 0) { |
| 870 | color = Theme.getColor(Theme.key_actionBarDefault); |
| 871 | } |
| 872 | // too bright |
| 873 | if (AndroidUtilities.computePerceivedBrightness(color) >= 0.721f) { |
| 874 | color = Theme.getColor(Theme.key_windowBackgroundWhiteBlueHeader) | 0xff000000; |
| 875 | } |
| 876 | } |
| 877 | return color; |
| 878 | } |
| 879 | |
| 880 | } |