Skip to content

Commit

Permalink
Use bright color for typing indicator in dark mode (#702)
Browse files Browse the repository at this point in the history
  • Loading branch information
laevandus authored Jan 2, 2025
1 parent b42e80c commit 3289fb3
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

# Upcoming

### 🔄 Changed
### 🐞 Fixed
- Use bright color for typing indicator animation in dark mode [#702](https://github.com/GetStream/stream-chat-swiftui/pull/702)

# [4.69.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.69.0)
_December 18, 2024_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ public struct TypingIndicatorView: View {
private let animationDuration: CGFloat = 0.75

public init() { /* Public init */ }

init(isTyping: Bool) {
_isTyping = State<Bool>(wrappedValue: isTyping)
}

public var body: some View {
HStack(spacing: 4) {
Expand Down Expand Up @@ -42,7 +46,8 @@ public struct TypingIndicatorView: View {

/// View that represents one circle of the typing indicator view.
private struct TypingIndicatorCircle: View {

@Injected(\.colors) var colors

private let circleWidth: CGFloat = 4
private let circleHeight: CGFloat = 4
private let yOffset: CGFloat = 1.5
Expand All @@ -53,6 +58,7 @@ private struct TypingIndicatorCircle: View {

var body: some View {
Circle()
.foregroundColor(Color(colors.text))
.frame(width: circleWidth, height: circleHeight)
.opacity(isTyping ? maxOpacity : minOpacity)
.offset(y: isTyping ? yOffset : -yOffset)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ class TypingIndicatorView_Tests: StreamChatTestCase {

func test_typingIndicatorView_snapshot() {
// Given
let view = TypingIndicatorView()
let view = TypingIndicatorView(isTyping: true)
.frame(width: 20, height: 16)

// Then
assertSnapshot(matching: view, as: .image(perceptualPrecision: precision))
AssertSnapshot(view, variants: .onlyUserInterfaceStyles, size: CGSize(width: 20, height: 16))
}
}
Binary file not shown.
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.

0 comments on commit 3289fb3

Please sign in to comment.