From ac3dbe5a972b477cf89e4318af384346a3c18708 Mon Sep 17 00:00:00 2001 From: Saeed Bashir Date: Thu, 3 Oct 2024 10:25:00 +0500 Subject: [PATCH] chore: update tab bar icons for selected unselected states (#81) --- .../Contents.json | 5 +---- .../discover_active.svg | 3 +++ .../discover_inactive.imageset/Contents.json | 13 +++++++++++++ .../discover_inactive.svg | 3 +++ .../discovery.imageset/Frame-6.svg | 13 ------------- .../learn.imageset/learn filled.svg | 10 ---------- .../Contents.json | 2 +- .../learn_active.imageset/learn_active.svg | 6 ++++++ .../Contents.json | 2 +- .../learn_inactive.imageset/learn_inactive.svg | 3 +++ .../NavigationBar/profile.imageset/Frame-8.svg | 12 ------------ .../profile_active.imageset/Contents.json | 12 ++++++++++++ .../profile_active.imageset/profile_active.svg | 3 +++ .../profile_inactive.imageset/Contents.json | 12 ++++++++++++ .../profile_inactive.svg | 3 +++ Core/Core/SwiftGen/Assets.swift | 9 ++++++--- OpenEdX/View/MainScreenView.swift | 18 +++++++++++++++--- 17 files changed, 82 insertions(+), 47 deletions(-) rename Core/Core/Assets.xcassets/NavigationBar/{learn.imageset => discover_active.imageset}/Contents.json (53%) create mode 100644 Core/Core/Assets.xcassets/NavigationBar/discover_active.imageset/discover_active.svg create mode 100644 Core/Core/Assets.xcassets/NavigationBar/discover_inactive.imageset/Contents.json create mode 100644 Core/Core/Assets.xcassets/NavigationBar/discover_inactive.imageset/discover_inactive.svg delete mode 100644 Core/Core/Assets.xcassets/NavigationBar/discovery.imageset/Frame-6.svg delete mode 100644 Core/Core/Assets.xcassets/NavigationBar/learn.imageset/learn filled.svg rename Core/Core/Assets.xcassets/NavigationBar/{discovery.imageset => learn_active.imageset}/Contents.json (75%) create mode 100644 Core/Core/Assets.xcassets/NavigationBar/learn_active.imageset/learn_active.svg rename Core/Core/Assets.xcassets/NavigationBar/{profile.imageset => learn_inactive.imageset}/Contents.json (75%) create mode 100644 Core/Core/Assets.xcassets/NavigationBar/learn_inactive.imageset/learn_inactive.svg delete mode 100644 Core/Core/Assets.xcassets/NavigationBar/profile.imageset/Frame-8.svg create mode 100644 Core/Core/Assets.xcassets/NavigationBar/profile_active.imageset/Contents.json create mode 100644 Core/Core/Assets.xcassets/NavigationBar/profile_active.imageset/profile_active.svg create mode 100644 Core/Core/Assets.xcassets/NavigationBar/profile_inactive.imageset/Contents.json create mode 100644 Core/Core/Assets.xcassets/NavigationBar/profile_inactive.imageset/profile_inactive.svg diff --git a/Core/Core/Assets.xcassets/NavigationBar/learn.imageset/Contents.json b/Core/Core/Assets.xcassets/NavigationBar/discover_active.imageset/Contents.json similarity index 53% rename from Core/Core/Assets.xcassets/NavigationBar/learn.imageset/Contents.json rename to Core/Core/Assets.xcassets/NavigationBar/discover_active.imageset/Contents.json index 718131171..a18c95de3 100644 --- a/Core/Core/Assets.xcassets/NavigationBar/learn.imageset/Contents.json +++ b/Core/Core/Assets.xcassets/NavigationBar/discover_active.imageset/Contents.json @@ -1,15 +1,12 @@ { "images" : [ { - "filename" : "learn filled.svg", + "filename" : "discover_active.svg", "idiom" : "universal" } ], "info" : { "author" : "xcode", "version" : 1 - }, - "properties" : { - "template-rendering-intent" : "template" } } diff --git a/Core/Core/Assets.xcassets/NavigationBar/discover_active.imageset/discover_active.svg b/Core/Core/Assets.xcassets/NavigationBar/discover_active.imageset/discover_active.svg new file mode 100644 index 000000000..f34db6140 --- /dev/null +++ b/Core/Core/Assets.xcassets/NavigationBar/discover_active.imageset/discover_active.svg @@ -0,0 +1,3 @@ + + + diff --git a/Core/Core/Assets.xcassets/NavigationBar/discover_inactive.imageset/Contents.json b/Core/Core/Assets.xcassets/NavigationBar/discover_inactive.imageset/Contents.json new file mode 100644 index 000000000..ebbbb5a65 --- /dev/null +++ b/Core/Core/Assets.xcassets/NavigationBar/discover_inactive.imageset/Contents.json @@ -0,0 +1,13 @@ +{ + "images" : [ + + { + "filename" : "discover_inactive.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Core/Core/Assets.xcassets/NavigationBar/discover_inactive.imageset/discover_inactive.svg b/Core/Core/Assets.xcassets/NavigationBar/discover_inactive.imageset/discover_inactive.svg new file mode 100644 index 000000000..9fbbb06c4 --- /dev/null +++ b/Core/Core/Assets.xcassets/NavigationBar/discover_inactive.imageset/discover_inactive.svg @@ -0,0 +1,3 @@ + + + diff --git a/Core/Core/Assets.xcassets/NavigationBar/discovery.imageset/Frame-6.svg b/Core/Core/Assets.xcassets/NavigationBar/discovery.imageset/Frame-6.svg deleted file mode 100644 index ab2e20696..000000000 --- a/Core/Core/Assets.xcassets/NavigationBar/discovery.imageset/Frame-6.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/Core/Core/Assets.xcassets/NavigationBar/learn.imageset/learn filled.svg b/Core/Core/Assets.xcassets/NavigationBar/learn.imageset/learn filled.svg deleted file mode 100644 index c961205bc..000000000 --- a/Core/Core/Assets.xcassets/NavigationBar/learn.imageset/learn filled.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/Core/Core/Assets.xcassets/NavigationBar/discovery.imageset/Contents.json b/Core/Core/Assets.xcassets/NavigationBar/learn_active.imageset/Contents.json similarity index 75% rename from Core/Core/Assets.xcassets/NavigationBar/discovery.imageset/Contents.json rename to Core/Core/Assets.xcassets/NavigationBar/learn_active.imageset/Contents.json index 29d880f86..7bd563b5f 100644 --- a/Core/Core/Assets.xcassets/NavigationBar/discovery.imageset/Contents.json +++ b/Core/Core/Assets.xcassets/NavigationBar/learn_active.imageset/Contents.json @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "Frame-6.svg", + "filename" : "learn_active.svg", "idiom" : "universal" } ], diff --git a/Core/Core/Assets.xcassets/NavigationBar/learn_active.imageset/learn_active.svg b/Core/Core/Assets.xcassets/NavigationBar/learn_active.imageset/learn_active.svg new file mode 100644 index 000000000..366c2aa88 --- /dev/null +++ b/Core/Core/Assets.xcassets/NavigationBar/learn_active.imageset/learn_active.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Core/Core/Assets.xcassets/NavigationBar/profile.imageset/Contents.json b/Core/Core/Assets.xcassets/NavigationBar/learn_inactive.imageset/Contents.json similarity index 75% rename from Core/Core/Assets.xcassets/NavigationBar/profile.imageset/Contents.json rename to Core/Core/Assets.xcassets/NavigationBar/learn_inactive.imageset/Contents.json index 535296614..fd526768b 100644 --- a/Core/Core/Assets.xcassets/NavigationBar/profile.imageset/Contents.json +++ b/Core/Core/Assets.xcassets/NavigationBar/learn_inactive.imageset/Contents.json @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "Frame-8.svg", + "filename" : "learn_inactive.svg", "idiom" : "universal" } ], diff --git a/Core/Core/Assets.xcassets/NavigationBar/learn_inactive.imageset/learn_inactive.svg b/Core/Core/Assets.xcassets/NavigationBar/learn_inactive.imageset/learn_inactive.svg new file mode 100644 index 000000000..154a3f285 --- /dev/null +++ b/Core/Core/Assets.xcassets/NavigationBar/learn_inactive.imageset/learn_inactive.svg @@ -0,0 +1,3 @@ + + + diff --git a/Core/Core/Assets.xcassets/NavigationBar/profile.imageset/Frame-8.svg b/Core/Core/Assets.xcassets/NavigationBar/profile.imageset/Frame-8.svg deleted file mode 100644 index f1a26b728..000000000 --- a/Core/Core/Assets.xcassets/NavigationBar/profile.imageset/Frame-8.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/Core/Core/Assets.xcassets/NavigationBar/profile_active.imageset/Contents.json b/Core/Core/Assets.xcassets/NavigationBar/profile_active.imageset/Contents.json new file mode 100644 index 000000000..6ba923c1e --- /dev/null +++ b/Core/Core/Assets.xcassets/NavigationBar/profile_active.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "profile_active.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Core/Core/Assets.xcassets/NavigationBar/profile_active.imageset/profile_active.svg b/Core/Core/Assets.xcassets/NavigationBar/profile_active.imageset/profile_active.svg new file mode 100644 index 000000000..0cb94d64e --- /dev/null +++ b/Core/Core/Assets.xcassets/NavigationBar/profile_active.imageset/profile_active.svg @@ -0,0 +1,3 @@ + + + diff --git a/Core/Core/Assets.xcassets/NavigationBar/profile_inactive.imageset/Contents.json b/Core/Core/Assets.xcassets/NavigationBar/profile_inactive.imageset/Contents.json new file mode 100644 index 000000000..f4857629a --- /dev/null +++ b/Core/Core/Assets.xcassets/NavigationBar/profile_inactive.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "profile_inactive.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Core/Core/Assets.xcassets/NavigationBar/profile_inactive.imageset/profile_inactive.svg b/Core/Core/Assets.xcassets/NavigationBar/profile_inactive.imageset/profile_inactive.svg new file mode 100644 index 000000000..48abd9656 --- /dev/null +++ b/Core/Core/Assets.xcassets/NavigationBar/profile_inactive.imageset/profile_inactive.svg @@ -0,0 +1,3 @@ + + + diff --git a/Core/Core/SwiftGen/Assets.swift b/Core/Core/SwiftGen/Assets.swift index 14c34ddcf..965ddcb2f 100644 --- a/Core/Core/SwiftGen/Assets.swift +++ b/Core/Core/SwiftGen/Assets.swift @@ -76,9 +76,12 @@ 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 discovery = ImageAsset(name: "discovery") - public static let learn = ImageAsset(name: "learn") - public static let profile = ImageAsset(name: "profile") + public static let discoverActive = ImageAsset(name: "discover_active") + public static let discoverInactive = ImageAsset(name: "discover_inactive") + public static let learnActive = ImageAsset(name: "learn_active") + public static let learnInactive = ImageAsset(name: "learn_inactive") + public static let profileActive = ImageAsset(name: "profile_active") + public static let profileInactive = ImageAsset(name: "profile_inactive") public static let programs = ImageAsset(name: "programs") public static let addPhoto = ImageAsset(name: "addPhoto") public static let bgDelete = ImageAsset(name: "bg_delete") diff --git a/OpenEdX/View/MainScreenView.swift b/OpenEdX/View/MainScreenView.swift index 0331f9c47..fc4b5190b 100644 --- a/OpenEdX/View/MainScreenView.swift +++ b/OpenEdX/View/MainScreenView.swift @@ -96,7 +96,11 @@ struct MainScreenView: View { registerBanner } .tabItem { - CoreAssets.learn.swiftUIImage.renderingMode(.template) + if viewModel.selection == .dashboard { + CoreAssets.learnActive.swiftUIImage.renderingMode(.template) + } else { + CoreAssets.learnInactive.swiftUIImage.renderingMode(.template) + } Text(CoreLocalization.Mainscreen.learn) } .tag(MainTab.dashboard) @@ -126,7 +130,11 @@ struct MainScreenView: View { } } .tabItem { - CoreAssets.discovery.swiftUIImage.renderingMode(.template) + if viewModel.selection == .discovery { + CoreAssets.discoverActive.swiftUIImage.renderingMode(.template) + } else { + CoreAssets.discoverInactive.swiftUIImage.renderingMode(.template) + } Text(CoreLocalization.Mainscreen.discovery) } .tag(MainTab.discovery) @@ -139,7 +147,11 @@ struct MainScreenView: View { ) } .tabItem { - CoreAssets.profile.swiftUIImage.renderingMode(.template) + if viewModel.selection == .profile { + CoreAssets.profileActive.swiftUIImage.renderingMode(.template) + } else { + CoreAssets.profileInactive.swiftUIImage.renderingMode(.template) + } Text(CoreLocalization.Mainscreen.profile) } .tag(MainTab.profile)