Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CIS-1554] Make SendButton animation overridable #1781

Merged

Conversation

nuno-vieira
Copy link
Member

@nuno-vieira nuno-vieira commented Feb 4, 2022

🔗 Issue Link

CIS-1554

🎯 Goal

Currently, the animation of SendButton is done on the didSet observer of the SendButton.isEnabled, the problem with this is that the didSet implementation is not overridable. We need to extract the animation to a different function so that the customer can override it.

🛠 Implementation

Extract the animation to a different function so that the customer can override it.

🎨 Changes

N/A

🧪 Testing

N/A

☑️ Checklist

  • I have signed the Stream CLA (required)
  • This change follows zero ⚠️ policy (required)
  • Changelog is updated with client-facing changes

@nuno-vieira nuno-vieira requested a review from a team as a code owner February 4, 2022 17:35
@nuno-vieira nuno-vieira changed the title [CIS-1554] Make SendButton animation overridable [CIS-1554] Make SendButton animation overridable Feb 4, 2022
@codecov
Copy link

codecov bot commented Feb 4, 2022

Codecov Report

Merging #1781 (2cb88c7) into develop (292c84d) will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1781      +/-   ##
===========================================
- Coverage    85.41%   85.39%   -0.03%     
===========================================
  Files          234      234              
  Lines        11261    11261              
===========================================
- Hits          9619     9616       -3     
- Misses        1642     1645       +3     
Flag Coverage Δ
llc-tests 85.39% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
Sources/StreamChat/Utils/Logger/Logger.swift 56.28% <0.00%> (-1.80%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 292c84d...2cb88c7. Read the comment docs.

@@ -28,4 +24,13 @@ open class SendButton: _Button, AppearanceProvider {
let disabledStateImage = appearance.images.sendArrow.tinted(with: buttonColor)
setImage(disabledStateImage, for: .disabled)
}

/// The animation when the `isEnabled` state changes.
open func isEnabledChangeAnimation() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make more sense for this public function to pass in the isEnabled param? Approving anyway more of a small suggestion :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see.. yes it kinda makes sense 👍

@nuno-vieira nuno-vieira merged commit f5decf0 into develop Feb 7, 2022
@nuno-vieira nuno-vieira deleted the fix/CIS-1554-Make-SendButton-animation-overridable branch February 7, 2022 13:55
nuno-vieira added a commit that referenced this pull request Feb 9, 2022
* Make SendButton animation overridable

* Update CHANGELOG.md

* Feedback changes
@nuno-vieira nuno-vieira mentioned this pull request Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants