From 954fd7a8dbce61b24726d83b5eb26d0e11e4d27c Mon Sep 17 00:00:00 2001 From: iceandfire Date: Wed, 26 Jul 2023 13:28:59 +0530 Subject: [PATCH] Theme: Add translucency to navigation and tab bars on home timeline Added translucency to the navigation and tab bars on home timeline. I have kept the effect minimal and can be adjusted (increased or decreased) based on feedback. Before: https://ibb.co/qs6ksdq After: https://ibb.co/tH2f7q4 Signed-off-by: iceandfire --- .../Sources/MastodonCore/Service/Theme/ThemeService.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/MastodonSDK/Sources/MastodonCore/Service/Theme/ThemeService.swift b/MastodonSDK/Sources/MastodonCore/Service/Theme/ThemeService.swift index a3316fe69a..6e1bdd949d 100644 --- a/MastodonSDK/Sources/MastodonCore/Service/Theme/ThemeService.swift +++ b/MastodonSDK/Sources/MastodonCore/Service/Theme/ThemeService.swift @@ -47,8 +47,9 @@ extension ThemeService { public func apply(theme: Theme) { // set navigation bar appearance let appearance = UINavigationBarAppearance() - appearance.configureWithDefaultBackground() - appearance.backgroundColor = theme.navigationBarBackgroundColor + let translucentColor = theme.navigationBarBackgroundColor.withAlphaComponent(0.99) + appearance.configureWithOpaqueBackground() + appearance.backgroundColor = translucentColor UINavigationBar.appearance().standardAppearance = appearance UINavigationBar.appearance().compactAppearance = appearance UINavigationBar.appearance().scrollEdgeAppearance = appearance @@ -71,7 +72,8 @@ extension ThemeService { tabBarAppearance.inlineLayoutAppearance = tabBarItemAppearance tabBarAppearance.compactInlineLayoutAppearance = tabBarItemAppearance - tabBarAppearance.backgroundColor = theme.tabBarBackgroundColor + tabBarAppearance.configureWithOpaqueBackground() + tabBarAppearance.backgroundColor = translucentColor UITabBar.appearance().standardAppearance = tabBarAppearance UITabBar.appearance().scrollEdgeAppearance = tabBarAppearance UITabBar.appearance().barTintColor = theme.tabBarBackgroundColor