Fixes button titles flashing when scrolling into view

This commit is contained in:
Riley Testut
2023-12-08 18:30:30 -06:00
parent f538fd30d5
commit 1a3039767e
3 changed files with 93 additions and 86 deletions

View File

@@ -566,7 +566,10 @@ extension FeaturedViewController
content.imageProperties.maximumSize = CGSize(width: 26, height: 26) content.imageProperties.maximumSize = CGSize(width: 26, height: 26)
content.imageProperties.cornerRadius = 13 content.imageProperties.cornerRadius = 13
UIView.performWithoutAnimation {
headerView.titleButton.setTitle(content.text, for: .normal) headerView.titleButton.setTitle(content.text, for: .normal)
headerView.titleButton.layoutIfNeeded()
}
headerView.iconButton.backgroundColor = storeApp.source?.effectiveTintColor?.adjustedForDisplay headerView.iconButton.backgroundColor = storeApp.source?.effectiveTintColor?.adjustedForDisplay
headerView.iconButton.setImage(nil, for: .normal) headerView.iconButton.setImage(nil, for: .normal)

View File

@@ -254,6 +254,7 @@ extension AppBannerView
buttonAction = .open buttonAction = .open
} }
UIView.performWithoutAnimation {
switch buttonAction switch buttonAction
{ {
case .open: case .open:
@@ -330,6 +331,7 @@ extension AppBannerView
// Ensure PillButton is correct size before assigning progress. // Ensure PillButton is correct size before assigning progress.
self.layoutIfNeeded() self.layoutIfNeeded()
}
if let progress = AppManager.shared.installationProgress(for: app), progress.fractionCompleted < 1.0 if let progress = AppManager.shared.installationProgress(for: app), progress.fractionCompleted < 1.0
{ {

View File

@@ -199,6 +199,7 @@ private extension SourcesViewController
let numberOfApps = source.apps.filter { StoreApp.visibleAppsPredicate.evaluate(with: $0) }.count let numberOfApps = source.apps.filter { StoreApp.visibleAppsPredicate.evaluate(with: $0) }.count
UIView.performWithoutAnimation {
if let error = source.error if let error = source.error
{ {
let image = UIImage(systemName: "exclamationmark")?.withTintColor(.white, renderingMode: .alwaysOriginal) let image = UIImage(systemName: "exclamationmark")?.withTintColor(.white, renderingMode: .alwaysOriginal)
@@ -225,6 +226,7 @@ private extension SourcesViewController
cell.bannerView.button.addAction(action, for: .primaryActionTriggered) cell.bannerView.button.addAction(action, for: .primaryActionTriggered)
cell.bannerView.button.removeAction(identifiedBy: .showError, for: .primaryActionTriggered) cell.bannerView.button.removeAction(identifiedBy: .showError, for: .primaryActionTriggered)
} }
}
let dateText: String let dateText: String
if let lastUpdatedDate = source.lastUpdatedDate if let lastUpdatedDate = source.lastUpdatedDate