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

Base/asset price chart #1402

Open
wants to merge 92 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
149095b
create module
svojsu Feb 17, 2025
632da02
remove tests
svojsu Feb 17, 2025
34339b1
add DGCharts
svojsu Feb 17, 2025
7a91d3b
base layout configuration
svojsu Feb 17, 2025
fc45b34
format and layout fix
svojsu Feb 18, 2025
69a2fff
configure with stubbed data
svojsu Feb 19, 2025
429e8fc
chart interaction and updates logic
svojsu Feb 19, 2025
3860c4b
appearance fixes
svojsu Feb 19, 2025
6e05033
period control
svojsu Feb 19, 2025
c57cb46
available periods and period selection
svojsu Feb 20, 2025
6cb8ac7
add dependency factories for correct balance and price presentation
svojsu Feb 20, 2025
d95423c
show actual price and format it according to locale
svojsu Feb 20, 2025
b9f33ce
implement loading state
svojsu Feb 20, 2025
3931180
fix forced loading state
svojsu Feb 20, 2025
6eafb59
price change tracking when interacting with chart
svojsu Feb 20, 2025
5cc2298
separate colors for chart and change text
svojsu Feb 20, 2025
0c44c20
fix chart state erasing on text updates
svojsu Feb 20, 2025
4b49759
highlighter and price layout fix
svojsu Feb 20, 2025
6a46e6f
icon for price change view
svojsu Feb 20, 2025
8c03f55
pre-review clean up
svojsu Feb 20, 2025
bbd9cfc
naming fix
svojsu Feb 20, 2025
87cb7ff
remove wireframe
svojsu Feb 20, 2025
0da18e3
unify coingecko api usage
svojsu Feb 20, 2025
85e68f1
interactor implementation
svojsu Feb 20, 2025
d7df0ae
PriceChartDataOperationFactory implementation
svojsu Feb 20, 2025
b454d7e
use novasama-tech api
svojsu Feb 20, 2025
90cc7c8
clean interactor on deinit
svojsu Feb 20, 2025
878e407
fix crash
svojsu Feb 20, 2025
c93d736
clear only callstore on interactor deinit
svojsu Feb 21, 2025
f622cf8
Merge branch 'feature/fetch-chart-data' into fix/crash-on-seek-chart-…
svojsu Feb 21, 2025
9c1b210
add formatted date of last entry
svojsu Feb 21, 2025
7cd1e0c
fix warnings
svojsu Feb 21, 2025
a1cc7a9
Merge pull request #1396 from novasamatech/feature/basic-price-chart
svojsu Feb 21, 2025
e1d9daf
add indexed entries for faster dataset splitting
svojsu Feb 21, 2025
f2750dc
protect from float division by zero
svojsu Feb 21, 2025
dc48830
Merge pull request #1398 from novasamatech/feature/fetch-chart-data
svojsu Feb 21, 2025
13c0c60
Merge pull request #1399 from novasamatech/fix/crash-on-seek-chart-fe…
svojsu Feb 21, 2025
5cc01d6
fix warning
svojsu Feb 21, 2025
b471c05
fix implicit self capturing
svojsu Feb 21, 2025
5bdac94
Merge pull request #1400 from novasamatech/feature/selected-entry-date
svojsu Feb 21, 2025
eacd68f
update price according to selected entry
svojsu Feb 21, 2025
a258159
[wip] price provider update
ERussel Feb 24, 2025
a02a350
expandable widget implementation
svojsu Feb 24, 2025
ed8af65
arrow button rotation
svojsu Feb 25, 2025
f1e24c0
pre-review clean up
svojsu Feb 25, 2025
3eadfcd
height constants fix
svojsu Feb 25, 2025
abbdf61
[wip] formatting
ERussel Feb 25, 2025
9506439
review fix
svojsu Feb 25, 2025
f368984
Add observable instead of combine primitives and fix api
svojsu Feb 26, 2025
0aadee0
review fix
svojsu Feb 26, 2025
5082fc7
review fix
svojsu Feb 26, 2025
92c256c
use PriceLocalStorageSubscriber protocol
svojsu Feb 26, 2025
dfa1621
Merge pull request #1409 from novasamatech/feature/balance-widget-update
svojsu Feb 26, 2025
d3b5c4c
Merge pull request #1404 from novasamatech/fix/update-current-price-w…
svojsu Feb 26, 2025
acba969
Merge pull request #1401 from novasamatech/fix/optimize-data-sets-spl…
svojsu Feb 26, 2025
b505f7b
Merge branch 'develop' into base/asset-price-chart
svojsu Feb 26, 2025
994182e
Merge branch 'base/asset-price-chart' into fix/price-provider
svojsu Feb 26, 2025
9dd7b5d
review fix
svojsu Feb 27, 2025
5795d6f
Merge pull request #1410 from novasamatech/fix/price-provider
svojsu Feb 27, 2025
a37ba1c
send state on price ids observable subscription
svojsu Feb 28, 2025
4c13635
use unsigned percent formatter for price change
svojsu Feb 28, 2025
45f9cc2
don't reset chart data on entry selection
svojsu Mar 3, 2025
cb9ae17
disable highlighting on tab
svojsu Mar 3, 2025
c96e019
Merge branch 'develop' into base/asset-price-chart
svojsu Mar 3, 2025
d13152a
Merge branch 'base/asset-price-chart' into fix/asset-price-chart-fixes
svojsu Mar 3, 2025
26067de
Merge pull request #1416 from novasamatech/fix/asset-price-chart-fixes
svojsu Mar 4, 2025
613a2d9
Merge branch 'develop' into base/asset-price-chart
svojsu Mar 4, 2025
b6e900d
add localised strings
leohar Mar 4, 2025
dc4db11
introduce HapticEngine
svojsu Mar 4, 2025
b425559
chart haptic integration
svojsu Mar 4, 2025
5f583ec
handle application events to relaunch engine
svojsu Mar 4, 2025
eefaecf
cleanup
svojsu Mar 4, 2025
573d8bf
Merge pull request #1419 from novasamatech/localise-assets-price-chart
svojsu Mar 4, 2025
f67dda0
float division by zero check
svojsu Mar 4, 2025
0a47ca9
code clean
svojsu Mar 4, 2025
db49a40
select entry with long press gesture
svojsu Mar 4, 2025
3bc123e
distribute entries proportional to available width
svojsu Mar 4, 2025
16725e4
segregate interfaces and implementations for easier and more intuitiv…
svojsu Mar 5, 2025
6846ad6
review fixes
svojsu Mar 5, 2025
331d9a0
animated draggable layout origin change on balance widget interaction
svojsu Mar 5, 2025
0b97630
don't use compactHeight
svojsu Mar 5, 2025
ad3eb1e
distribution logic change
svojsu Mar 5, 2025
9baf8f3
fix length order
svojsu Mar 5, 2025
aa5b25a
fix constant
svojsu Mar 5, 2025
e3fb730
review fixes
svojsu Mar 5, 2025
ffe7840
Merge branch 'feature/price-chart-haptic' into feature/price-chart-en…
svojsu Mar 5, 2025
22a3782
fix valueCounter change on play
svojsu Mar 6, 2025
1062e07
Merge pull request #1423 from novasamatech/fix/asset-operations-histo…
svojsu Mar 6, 2025
b84311b
Merge pull request #1422 from novasamatech/feature/price-chart-entries
svojsu Mar 6, 2025
da4cde1
Merge pull request #1420 from novasamatech/feature/price-chart-haptic
svojsu Mar 6, 2025
8ffe52d
period localizations
svojsu Mar 6, 2025
c6fbaf8
Merge branch 'develop' into base/asset-price-chart
svojsu Mar 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ platform :ios, '14.0'
abstract_target 'novawalletAll' do
use_frameworks!

pod 'DGCharts', '~> 5.1.0'
pod 'DSF_QRCode', '~> 18.0.0'
pod 'SubstrateSdk', :git => 'https://github.com/nova-wallet/substrate-sdk-ios.git', :tag => '3.5.0'
pod 'SwiftLint'
Expand Down
8 changes: 7 additions & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,9 @@ PODS:
- Cuckoo (1.7.1):
- Cuckoo/Swift (= 1.7.1)
- Cuckoo/Swift (1.7.1)
- DGCharts (5.1.0):
- DGCharts/Core (= 5.1.0)
- DGCharts/Core (5.1.0)
- DSF_QRCode (18.0.0):
- SwiftImageReadWrite (~> 1.6.1)
- SwiftQRCodeGenerator (~> 2.0.2)
Expand Down Expand Up @@ -1533,6 +1536,7 @@ PODS:
DEPENDENCIES:
- CDMarkdownKit (from `https://github.com/nova-wallet/CDMarkdownKit.git`, tag `2.5.2`)
- Cuckoo
- DGCharts (~> 5.1.0)
- DSF_QRCode (~> 18.0.0)
- EthereumSignTypedDataUtil (from `https://github.com/ERussel/EthereumSignTypedDataUtil.git`, tag `0.1.3`)
- FirebaseAppCheck (~> 11.3.0)
Expand Down Expand Up @@ -1573,6 +1577,7 @@ SPEC REPOS:
- BoringSSL-GRPC
- CryptoSwift
- Cuckoo
- DGCharts
- DSF_QRCode
- FirebaseAppCheck
- FirebaseAppCheckInterop
Expand Down Expand Up @@ -1713,6 +1718,7 @@ SPEC CHECKSUMS:
CDMarkdownKit: ed78cf1a5c57dbe362054633a0f802f0534531ff
CryptoSwift: c4f2debceb38bf44c80659afe009f71e23e4a082
Cuckoo: 9e258d68137c411df47c6390f72901d5276b4f03
DGCharts: 1c6daf585b6cfc78807af44ea690d357c410627f
DSF_QRCode: 3fe0acc968ce8588a9b1dabb9557a364472f5aaf
EthereumSignTypedDataUtil: ae4e33b21e51ee046a86a65b02843090b8bbd3f9
FirebaseAppCheck: db69ee8842189d7a86366b79941da15934f99b75
Expand Down Expand Up @@ -1771,6 +1777,6 @@ SPEC CHECKSUMS:
ZMarkupParser: a92d31ba40695b790f1da5fec98c3d4505341aff
ZNSTextAttachment: 1ddd53660a8d3c42dbb716bf6866ffce22c44181

PODFILE CHECKSUM: f6a15f672eb764d421692c18845c883c76c9fd0d
PODFILE CHECKSUM: 226bc799a8e133e7b3e05c70495be3cc402f8c18

COCOAPODS: 1.15.2
258 changes: 235 additions & 23 deletions novawallet.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions novawallet/Assets.xcassets/colors/line/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "0.160",
"blue" : "0xC7",
"green" : "0x9E",
"red" : "0x99"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x50",
"green" : "0x34",
"red" : "0xE5"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x68",
"green" : "0x49",
"red" : "0x45"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x64",
"green" : "0xC8",
"red" : "0x2F"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "0.160",
"blue" : "0x50",
"green" : "0x34",
"red" : "0xE5"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "0.160",
"blue" : "0x50",
"green" : "0xE6",
"red" : "0x00"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
6 changes: 6 additions & 0 deletions novawallet/Assets.xcassets/iconsFullArrow/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "iconFullArrowDown.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "iconFullArrowUp.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.

This file was deleted.

21 changes: 21 additions & 0 deletions novawallet/Common/Extension/Foundation/Array+Distribute.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import Foundation

extension Array {
func distributed(intoChunks chunkCount: Int) -> [[Element]] {
guard chunkCount > 0 else { return [] }
guard chunkCount < count else { return map { [$0] } }

let extraElements = count % chunkCount

let baseChunkLen = count / chunkCount
let maxChunkLen = (count / chunkCount) + 1

return (0 ..< chunkCount).map { chunkIndex in
let offset = Swift.min(chunkIndex, extraElements) * maxChunkLen + Swift.max(0, chunkIndex - extraElements) * baseChunkLen

let chunkLen = chunkIndex < extraElements ? maxChunkLen : baseChunkLen

return Array(self[offset ..< (offset + chunkLen)])
}
}
}
9 changes: 9 additions & 0 deletions novawallet/Common/Extension/Foundation/Calendar+Helpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,12 @@ extension Calendar {
return interval.end.addingTimeInterval(-1)
}
}

extension Date {
func sameYear(as date: Date) -> Bool {
let currentYear = Calendar.current.component(.year, from: self)
let dateYear = Calendar.current.component(.year, from: date)

return currentYear == dateYear
}
}
28 changes: 28 additions & 0 deletions novawallet/Common/Extension/Foundation/DateFormatter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,34 @@ extension DateFormatter {
.withThisYear(dateFormatter: dateFormatter.localizableResource())
.build(defaultFormat: "dd MMMM yyyy")
}

static var chartEntryDate: LocalizableResource<DateFormatter> {
LocalizableResource { locale in
let format = DateFormatter.dateFormat(
fromTemplate: "d MMM' at 'HH:mm",
options: 0,
locale: locale
)
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = format
dateFormatter.locale = locale
return dateFormatter
}
}

static var chartEntryWithYear: LocalizableResource<DateFormatter> {
LocalizableResource { locale in
let format = DateFormatter.dateFormat(
fromTemplate: "d MMM' at 'HH:mm, yyyy",
options: 0,
locale: locale
)
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = format
dateFormatter.locale = locale
return dateFormatter
}
}
}

extension DateComponentsFormatter {
Expand Down
1 change: 1 addition & 0 deletions novawallet/Common/Extension/UIKit/UIFont+Style.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ extension UIFont {
static var regularSubheadline: UIFont { R.font.publicSansRegular(size: 15)! }
static var semiBoldSubheadline: UIFont { R.font.publicSansSemiBold(size: 15)! }
static var regularBody: UIFont { R.font.publicSansRegular(size: 17)! }
static var monospaceNumbers: UIFont { R.font.publicSansRegular(size: 9)! }

static var largeTitle: UIFont { R.font.publicSansBold(size: 34)! }
static var boldTitle1: UIFont { R.font.publicSansBold(size: 28)! }
Expand Down
Loading