mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
Fix: Janky Animation
This commit is contained in:
parent
7578ccae60
commit
8d7cc2ed58
3 changed files with 37 additions and 9 deletions
|
|
@ -99,9 +99,6 @@ struct TabSelectionView: View {
|
|||
)
|
||||
}
|
||||
}
|
||||
DispatchQueue.main.async {
|
||||
ensureValidSelection(with: tabsArray)
|
||||
}
|
||||
return tabsArray
|
||||
}
|
||||
var body: some View {
|
||||
|
|
@ -110,10 +107,12 @@ struct TabSelectionView: View {
|
|||
let isSelected = isSelected(tab)
|
||||
let activeAccent = tab.accentColor ?? .white
|
||||
TabButton(label: tab.label, icon: tab.icon, selected: isSelected) {
|
||||
if tab.view == .extensionExperience {
|
||||
coordinator.selectedExtensionExperienceID = tab.experienceID
|
||||
withAnimation(.smooth(duration: 0.3)) {
|
||||
if tab.view == .extensionExperience {
|
||||
coordinator.selectedExtensionExperienceID = tab.experienceID
|
||||
}
|
||||
coordinator.currentView = tab.view
|
||||
}
|
||||
coordinator.currentView = tab.view
|
||||
}
|
||||
.frame(height: 26)
|
||||
.foregroundStyle(isSelected ? activeAccent : .gray)
|
||||
|
|
@ -132,8 +131,10 @@ struct TabSelectionView: View {
|
|||
}
|
||||
}
|
||||
}
|
||||
.animation(.smooth, value: coordinator.currentView)
|
||||
.clipShape(Capsule())
|
||||
.onAppear {
|
||||
ensureValidSelection(with: tabs)
|
||||
}
|
||||
}
|
||||
|
||||
private var extensionTabsEnabled: Bool {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue