Skip to content

Commit

Permalink
fix: fix tab bar color not properly applying (#85)
Browse files Browse the repository at this point in the history
* fix: fix tar bar color not properly applying
* chore: parity with android for discover icon
  • Loading branch information
saeedbashir authored and rnr committed Dec 13, 2024
1 parent 555d662 commit efbb635
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 36 deletions.

This file was deleted.

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions Core/Core/SwiftGen/Assets.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ public enum CoreAssets {
public static let noAnnouncements = ImageAsset(name: "noAnnouncements")
public static let noHandouts = ImageAsset(name: "noHandouts")
public static let dashboard = ImageAsset(name: "dashboard")
public static let discoverActive = ImageAsset(name: "discover_active")
public static let discoverInactive = ImageAsset(name: "discover_inactive")
public static let discover = ImageAsset(name: "discover")
public static let learnActive = ImageAsset(name: "learn_active")
public static let learnInactive = ImageAsset(name: "learn_inactive")
public static let profileActive = ImageAsset(name: "profile_active")
Expand Down
12 changes: 4 additions & 8 deletions OpenEdX/View/MainScreenView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ struct MainScreenView: View {
init(viewModel: MainScreenViewModel) {
self.viewModel = viewModel
UITabBar.appearance().isTranslucent = false
UITabBar.appearance().barTintColor = UIColor(Theme.Colors.tabbarColor)
UITabBar.appearance().backgroundColor = UIColor(Theme.Colors.tabbarColor)
UITabBar.appearance().unselectedItemTintColor = UIColor(Theme.Colors.textSecondaryLight)
UITabBar.appearance().barTintColor = Theme.UIColors.tabbarActiveColor
UITabBar.appearance().backgroundColor = Theme.UIColors.tabbarBGColor
UITabBar.appearance().unselectedItemTintColor = Theme.UIColors.tabbarInactiveColor

UITabBarItem.appearance().setTitleTextAttributes(
[NSAttributedString.Key.font: Theme.UIFonts.labelSmall()],
Expand Down Expand Up @@ -130,11 +130,7 @@ struct MainScreenView: View {
}
}
.tabItem {
if viewModel.selection == .discovery {
CoreAssets.discoverActive.swiftUIImage.renderingMode(.template)
} else {
CoreAssets.discoverInactive.swiftUIImage.renderingMode(.template)
}
CoreAssets.discover.swiftUIImage.renderingMode(.template)
Text(CoreLocalization.Mainscreen.discovery)
}
.tag(MainTab.discovery)
Expand Down
5 changes: 3 additions & 2 deletions Theme/Theme/Theme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ public struct Theme: Sendable {
secondaryButtonBorderColor: Color = ThemeAssets.secondaryButtonBorderColor.swiftUIColor,
secondaryButtonTextColor: Color = ThemeAssets.secondaryButtonTextColor.swiftUIColor,
success: Color = ThemeAssets.success.swiftUIColor,
tabbarColor: Color = ThemeAssets.tabbarColor.swiftUIColor,
primaryButtonTextColor: Color = ThemeAssets.primaryButtonTextColor.swiftUIColor,
toggleSwitchColor: Color = ThemeAssets.toggleSwitchColor.swiftUIColor,
textInputTextColor: Color = ThemeAssets.textInputTextColor.swiftUIColor,
Expand Down Expand Up @@ -163,7 +162,6 @@ public struct Theme: Sendable {
self.secondaryButtonBorderColor = secondaryButtonBorderColor
self.secondaryButtonTextColor = secondaryButtonTextColor
self.success = success
self.tabbarColor = tabbarColor
self.primaryButtonTextColor = primaryButtonTextColor
self.toggleSwitchColor = toggleSwitchColor
self.textInputTextColor = textInputTextColor
Expand All @@ -181,6 +179,9 @@ public struct Theme: Sendable {
nonisolated(unsafe) public private(set) static var accentXColor = ThemeAssets.accentXColor.color
nonisolated(unsafe) public private(set) static var navigationBarTintColor =
ThemeAssets.navigationBarTintColor.color
nonisolated(unsafe) public private(set) static var tabbarActiveColor = ThemeAssets.tabbarActiveColor.color
nonisolated(unsafe) public private(set) static var tabbarBGColor = ThemeAssets.tabbarBGColor.color
nonisolated(unsafe) public private(set) static var tabbarInactiveColor = ThemeAssets.tabbarInactiveColor.color

public static func update(
textPrimary: UIColor = ThemeAssets.textPrimary.color,
Expand Down

0 comments on commit efbb635

Please sign in to comment.