commit e019ceee74abaf02c35d44639d090fae4859fc47 parent fcf82de988de57da8f480e903a459bf6fd5e9beb Author: Jacob Thomas <41988041+bocajthomas@users.noreply.github.com> Date: Sat, 4 May 2024 15:11:58 +0100 feat(core/colors): camera gridlines (#977) Co-authored-by: auth <64337177+authorisation@users.noreply.github.com> Diffstat:
3 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/common/src/main/assets/lang/en_US.json b/common/src/main/assets/lang/en_US.json @@ -387,6 +387,10 @@ "action_menu_round_background_color": { "name": "Action Menu Round Background Color", "description": "Changes Snapchats chat action menu round background color\nInput a hex color code" + }, + "camera_grid_lines": { + "name": "Camera Gridlines Color", + "description": "Changes Snapchats Gridlines color on the Camera Preview \nInput a hex color code\nNote: Enable the grid on the my camera settings" } } }, @@ -480,7 +484,7 @@ }, "message_indicators": { "name": "Message Indicators", - "description": "Adds specific indicators icons to messages\nNote: indicators might not be 100% accurate" + "description": "Adds specific indicators icons to messages\nNote: Indicators might not be 100% accurate" }, "stealth_mode_indicator": { "name": "Stealth Mode Indicator", @@ -904,7 +908,7 @@ }, "account_switcher": { "name": "Account Switcher", - "description": "Allows you to switch between accounts without logging out\nLong press on the search icon next to your Bitmoji profile to open the menu\nNote: this feature is experimental and will likely change in the future", + "description": "Allows you to switch between accounts without logging out\nLong press on the search icon next to your Bitmoji profile to open the menu\nNote: This feature is experimental and will likely change in the future", "properties": { "auto_backup_current_account": { "name": "Auto Backup Current Account", @@ -940,7 +944,7 @@ }, "best_friend_pinning": { "name": "Best Friend Pinning", - "description": "Allows you to pin a friend as your number one best friend. Note: only you can see your pinned best friend" + "description": "Allows you to pin a friend as your number one best friend. Note: Only you can see your pinned best friend" }, "e2ee": { "name": "End-To-End Encryption", diff --git a/common/src/main/kotlin/me/rhunk/snapenhance/common/config/impl/UserInterfaceTweaks.kt b/common/src/main/kotlin/me/rhunk/snapenhance/common/config/impl/UserInterfaceTweaks.kt @@ -28,7 +28,8 @@ class UserInterfaceTweaks : ConfigContainer() { val backgroundColor = string("background_color") { inputCheck = checkInputColor } val backgroundColorSurface = string("background_color_surface") { inputCheck = checkInputColor } val actionMenuBackgroundColor = string("action_menu_background_color") { inputCheck = checkInputColor } - val actionMenuRoundBackgroundColor = string("action_menu_round_background_color") { inputCheck = checkInputColor } + val actionMenuRoundBackgroundColor = string("action_menu_round_background_color") { inputCheck = checkInputColor } + val cameraGridLines = string("camera_grid_lines") { inputCheck = checkInputColor } } val friendFeedMenuButtons = multiple( diff --git a/core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/ui/CustomizeUI.kt b/core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/ui/CustomizeUI.kt @@ -31,7 +31,9 @@ class CustomizeUI: Feature("Customize UI", loadParams = FeatureLoadParams.ACTIVI val effectiveBackgroundColorSurface by lazy { parseColor(customizeUIConfig.backgroundColorSurface.get()) } val effectiveActionMenuBackgroundColor by lazy { parseColor(customizeUIConfig.actionMenuBackgroundColor.get()) } val effectiveActionMenuRoundBackgroundColor by lazy { parseColor(customizeUIConfig.actionMenuRoundBackgroundColor.get()) } - + val effectiveCameraGridLines by lazy { parseColor(customizeUIConfig.cameraGridLines.get()) } + + val attributeCache = mutableMapOf<String, Int>() fun getAttribute(name: String): Int { @@ -72,6 +74,10 @@ class CustomizeUI: Feature("Customize UI", loadParams = FeatureLoadParams.ACTIVI ephemeralHook("getColor", effectiveTextColor ?: return@hook) } + getAttribute("sigColorTextSecondary") -> { + ephemeralHook("getColor", effectiveTextColor ?: return@hook) + } + getAttribute("sigColorBackgroundMain") -> { ephemeralHook("getColor", effectiveBackgroundColor ?: return@hook) } @@ -87,21 +93,30 @@ class CustomizeUI: Feature("Customize UI", loadParams = FeatureLoadParams.ACTIVI getAttribute("actionSheetRoundedBackgroundDrawable") -> { ephemeralHook("getDrawable", ColorDrawable(effectiveActionMenuRoundBackgroundColor ?: return@hook)) } + getAttribute("sigColorChatActivity") -> { ephemeralHook("getColor", effectivesendAndReceivedTextColor ?: return@hook) } + getAttribute("sigColorChatChat") -> { ephemeralHook("getColor", effectivesendAndReceivedTextColor ?: return@hook) } + getAttribute("sigColorChatPendingSending") -> { ephemeralHook("getColor", effectivesendAndReceivedTextColor ?: return@hook) } + getAttribute("sigColorChatSnapWithSound") -> { ephemeralHook("getColor", effectivesendAndReceivedTextColor ?: return@hook) } + getAttribute("sigColorChatSnapWithoutSound") -> { ephemeralHook("getColor", effectivesendAndReceivedTextColor ?: return@hook) } + + getAttribute("sigExceptionColorCameraGridLines") -> { + ephemeralHook("getColor", effectiveCameraGridLines ?: return@hook) + } } } }