From ebdb3d934e2394df9c7ee0be6a8474a4457dd530 Mon Sep 17 00:00:00 2001 From: Sergei Balashov Date: Tue, 28 Jan 2025 21:43:25 +0000 Subject: [PATCH] IOS-9056 Update `animation` and `color` --- .../LoadableTokenBalanceView.swift | 22 ++++++++++- .../ControlShimmer.colorset/Contents.json | 38 +++++++++++++++++++ 2 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 Tangem/Resources/Assets/Colors.xcassets/Control/ControlShimmer.colorset/Contents.json diff --git a/Tangem/Common/UI/LoadableTokenBalanceView/LoadableTokenBalanceView.swift b/Tangem/Common/UI/LoadableTokenBalanceView/LoadableTokenBalanceView.swift index 6e89aba418..b20b947f1f 100644 --- a/Tangem/Common/UI/LoadableTokenBalanceView/LoadableTokenBalanceView.swift +++ b/Tangem/Common/UI/LoadableTokenBalanceView/LoadableTokenBalanceView.swift @@ -23,10 +23,10 @@ struct LoadableTokenBalanceView: View { switch state { case .loading(.some(let cached)): textView(cached) - .modifier(PulseEffect()) + .modifier(Shimmer()) case .loading(.none): RoundedRectangle(cornerRadius: loader.cornerRadius, style: .continuous) - .fill(Colors.Background.tertiary) + .fill(Colors.Control.shimmer) .frame(size: loader.size) .modifier(Shimmer()) case .failed(let text, .none): @@ -118,6 +118,8 @@ extension LoadableTokenBalanceView { ) } + Divider() + VStack(alignment: .trailing, spacing: 2) { LoadableTokenBalanceView( state: .loading(cached: .string("1 312 422,23 $")), @@ -134,6 +136,22 @@ extension LoadableTokenBalanceView { Divider() + VStack(alignment: .trailing, spacing: 2) { + LoadableTokenBalanceView( + state: .loading(cached: .none), + style: .init(font: Fonts.Regular.subheadline, textColor: Colors.Text.primary1), + loader: .init(size: .init(width: 40, height: 12)) + ) + + LoadableTokenBalanceView( + state: .loading(cached: .none), + style: .init(font: Fonts.Regular.caption1, textColor: Colors.Text.tertiary), + loader: .init(size: .init(width: 40, height: 12)) + ) + } + + Divider() + VStack(alignment: .trailing, spacing: 2) { LoadableTokenBalanceView( state: .loaded(text: .string("1 312 422,23 $")), diff --git a/Tangem/Resources/Assets/Colors.xcassets/Control/ControlShimmer.colorset/Contents.json b/Tangem/Resources/Assets/Colors.xcassets/Control/ControlShimmer.colorset/Contents.json new file mode 100644 index 0000000000..9091e5f1c1 --- /dev/null +++ b/Tangem/Resources/Assets/Colors.xcassets/Control/ControlShimmer.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0xEB", + "green" : "0xEB", + "red" : "0xEB" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0x49", + "green" : "0x49", + "red" : "0x49" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +}