Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 14 additions & 4 deletions DashWallet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,8 @@
753261B22CBC157F003CDE00 /* GetStartedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 753261B12CBC157F003CDE00 /* GetStartedViewController.swift */; };
75387B4A2E0400C300BCCC72 /* MerchantDenominations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75387B492E0400C300BCCC72 /* MerchantDenominations.swift */; };
75387B4B2E0400C300BCCC72 /* MerchantDenominations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75387B492E0400C300BCCC72 /* MerchantDenominations.swift */; };
753CD8792E2E218800BCF070 /* mixing_anim.json in Resources */ = {isa = PBXBuildFile; fileRef = 753CD8782E2E218800BCF070 /* mixing_anim.json */; };
753CD87A2E2E218800BCF070 /* mixing_anim.json in Resources */ = {isa = PBXBuildFile; fileRef = 753CD8782E2E218800BCF070 /* mixing_anim.json */; };
753E46E82DE1E24300A3FF2A /* CTXSpendModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 753E46E72DE1E24300A3FF2A /* CTXSpendModels.swift */; };
753E46E92DE1E24300A3FF2A /* CTXSpendModels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 753E46E72DE1E24300A3FF2A /* CTXSpendModels.swift */; };
753F75342DD0D42300D40DFE /* DashSpendPayScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 753F75332DD0D41900D40DFE /* DashSpendPayScreen.swift */; };
Expand Down Expand Up @@ -2472,6 +2474,7 @@
753261AF2CBC11BF003CDE00 /* WelcomeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WelcomeViewController.swift; sourceTree = "<group>"; };
753261B12CBC157F003CDE00 /* GetStartedViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GetStartedViewController.swift; sourceTree = "<group>"; };
75387B492E0400C300BCCC72 /* MerchantDenominations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MerchantDenominations.swift; sourceTree = "<group>"; };
753CD8782E2E218800BCF070 /* mixing_anim.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = mixing_anim.json; sourceTree = "<group>"; };
753E46E72DE1E24300A3FF2A /* CTXSpendModels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CTXSpendModels.swift; sourceTree = "<group>"; };
753F75332DD0D41900D40DFE /* DashSpendPayScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DashSpendPayScreen.swift; sourceTree = "<group>"; };
753F75362DD0D75F00D40DFE /* DashSpendPayViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DashSpendPayViewModel.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -3891,6 +3894,7 @@
children = (
2A4430F122CBD57A009BAF7F /* AppAssets.xcassets */,
75E83CF51B5F997A0038FB70 /* coinflip.aiff */,
753CD8782E2E218800BCF070 /* mixing_anim.json */,
);
path = Resources;
sourceTree = "<group>";
Expand Down Expand Up @@ -7959,6 +7963,7 @@
474C720F298A1A3E00475CA6 /* TxDetailTaxCategoryCell.xib in Resources */,
2ADC722923B5547000D9DD37 /* Localizable.stringsdict in Resources */,
75E2F3C82AA4CF1900C3B458 /* Topper-Info.plist in Resources */,
753CD8792E2E218800BCF070 /* mixing_anim.json in Resources */,
2A2CD71822F99CAE008C7BC9 /* ShortcutsView.xib in Resources */,
474C7213298A1EFC00475CA6 /* TxDetailInfoCell.xib in Resources */,
2A9FFE942230FF4700956D5F /* UpholdOTPStoryboard.storyboard in Resources */,
Expand Down Expand Up @@ -8075,6 +8080,7 @@
C9D2C92E2A320AA000D15901 /* ImportWalletInfo.storyboard in Resources */,
C9D2C92F2A320AA000D15901 /* ReceiveContentView.xib in Resources */,
C9D2C9302A320AA000D15901 /* VerifySeedPhrase.storyboard in Resources */,
753CD87A2E2E218800BCF070 /* mixing_anim.json in Resources */,
758CE59D2BC566DE0062AF53 /* PrivacyInfo.xcprivacy in Resources */,
753FDBEC2AECF4CC0005EEC3 /* VotingHeaderView.xib in Resources */,
C9D2C9312A320AA000D15901 /* DWSecurityStatusView.xib in Resources */,
Expand Down Expand Up @@ -8392,6 +8398,7 @@
"${PODS_CONFIGURATION_BUILD_DIR}/SDWebImageSwiftUI/SDWebImageSwiftUI.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/SQLite.swift/SQLite.swift.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/gRPC/gRPCCertificates.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/lottie-ios/LottiePrivacyInfo.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/TOCropViewController/TOCropViewControllerBundle.bundle",
);
name = "[CP] Copy Pods Resources";
Expand All @@ -8406,6 +8413,7 @@
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SDWebImageSwiftUI.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SQLite.swift.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/gRPCCertificates.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/LottiePrivacyInfo.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/TOCropViewControllerBundle.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -8466,6 +8474,7 @@
"${PODS_CONFIGURATION_BUILD_DIR}/SDWebImageSwiftUI/SDWebImageSwiftUI.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/SQLite.swift/SQLite.swift.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/gRPC/gRPCCertificates.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/lottie-ios/LottiePrivacyInfo.bundle",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
Expand All @@ -8479,6 +8488,7 @@
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SDWebImageSwiftUI.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SQLite.swift.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/gRPCCertificates.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/LottiePrivacyInfo.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand Down Expand Up @@ -10407,7 +10417,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 8.4.0;
MARKETING_VERSION = 8.4.1;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -10547,7 +10557,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 8.4.0;
MARKETING_VERSION = 8.4.1;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -11535,7 +11545,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 8.4.0;
MARKETING_VERSION = 8.4.1;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down Expand Up @@ -11846,7 +11856,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 8.4.0;
MARKETING_VERSION = 8.4.1;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
Expand Down
1 change: 1 addition & 0 deletions DashWallet/Resources/mixing_anim.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -362,11 +362,11 @@ - (void)userProfileContactActionsCell:(DWUserProfileContactActionsCell *)cell se
#pragma mark - DWFilterHeaderViewDelegate

- (void)filterHeaderView:(DWFilterHeaderView *)view filterButtonAction:(UIView *)sender {
[self
showTxFilterWithDisplayModeCallback:^(DWHomeTxDisplayMode mode) {
self.displayMode = mode;
}
shouldShowRewards:NO];
[TransactionFilterDialogPresenter presentFrom:self
selectedFilter:self.displayMode
onFilterSelected:^(DWHomeTxDisplayMode mode) {
self.displayMode = mode;
}];
}

- (void)filterHeaderView:(DWFilterHeaderView *)view infoButtonAction:(UIView *)sender {
Expand Down Expand Up @@ -498,6 +498,8 @@ - (NSString *)titleForFilterButton {
NSAssert(NO, @"Not implemented here");
return nil;
}

return nil;
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -307,3 +307,22 @@ extension VotingFiltersViewController.DataSource {
return identifier
}
}

// MARK: - FilterItemResetCell

class FilterItemResetCell: UITableViewCell {
@IBOutlet var resetLabel: UILabel!

var isEnabled = true {
didSet {
resetLabel.textColor = isEnabled ? .dw_red() : .dw_secondaryText()
}
}

override func awakeFromNib() {
super.awakeFromNib()

resetLabel.isUserInteractionEnabled = false
resetLabel.text = NSLocalizedString("Reset Filters", comment: "Explore Dash")
}
}
67 changes: 40 additions & 27 deletions DashWallet/Sources/UI/Home/Views/Cells/CoinJoinProgressView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,44 @@
//

import SwiftUI
import Lottie

struct CoinJoinProgressView: View {
@State var state: MixingStatus
@State var progress: Double
@State var mixed: Double
@State var total: Double
var showBalance: Bool

var body: some View {
HStack(spacing: 12) {
ZStack {
Circle()
.fill(Color.dashBlue.opacity(0.1))
.frame(width: 38, height: 38)

Image("image.coinjoin.menu")
.resizable()
.scaledToFit()
.frame(width: 20, height: 20)
if state == .mixing {
LottieView(animation: .named("mixing_anim"))
.looping()
.frame(width: 34, height: 34)
} else {
LottieView(animation: .named("mixing_anim"))
.currentProgress(1)
.frame(width: 34, height: 34)
}

VStack(alignment: .leading, spacing: 4) {
CoinJoinProgressInfo(state: state, progress: progress, mixed: mixed, total: total, textColor: .primaryText, font: .subheadline)
.padding(.leading, -6)
CoinJoinProgressInfo(
state: state,
progress: progress,
mixed: mixed,
total: total,
showBalance: showBalance,
textColor: .primaryText,
font: .subheadline
).padding(.leading, -4)

SwiftUI.ProgressView(value: progress)
.progressViewStyle(LinearProgressViewStyle(tint: .dashBlue))
.frame(height: 6)
.padding(.top, 2)
}
.padding(.leading, 5)
}
.padding(12)
.background(Color.secondaryBackground)
Expand All @@ -56,17 +66,12 @@ struct CoinJoinProgressInfo: View {
@State var progress: Double
@State var mixed: Double
@State var total: Double
var showBalance: Bool
var textColor: Color
var font: Font

var body: some View {
HStack(spacing: 0) {
if state == .mixing {
SwiftUI.ProgressView()
.progressViewStyle(CircularProgressViewStyle(tint: .dashBlue))
.scaleEffect(0.5)
}

Text(state.localizedValue)
.foregroundColor(textColor)
.font(font)
Expand All @@ -81,20 +86,28 @@ struct CoinJoinProgressInfo: View {
}

Spacer()
Text("\(mixed, format: .number.precision(.fractionLength(0...3))) of \(total, format: .number.precision(.fractionLength(0...3)))")
.foregroundColor(textColor)
.font(font)
Image("icon_dash_currency")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: font.pointSize, height: font.pointSize)
.padding(.leading, 2)
.foregroundColor(textColor)

if showBalance {
Text("\(mixed, format: .number.precision(.fractionLength(0...3))) of \(total, format: .number.precision(.fractionLength(0...3)))")
.foregroundColor(textColor)
.font(font)

Image("icon_dash_currency")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: font.pointSize, height: font.pointSize)
.padding(.leading, 2)
.foregroundColor(textColor)
} else {
Text("****")
.foregroundColor(textColor)
.font(font)
}
}
}
}
}

#Preview {
CoinJoinProgressView(state: .mixing, progress: 0.45, mixed: 0.123, total: 0.321)
CoinJoinProgressView(state: .mixing, progress: 0.45, mixed: 0.123, total: 0.321, showBalance: true)
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final class BalanceModel: ObservableObject {

@Published private(set) var state = SyncingActivityMonitor.shared.state
@Published private(set) var value: UInt64 = 0
@Published private(set) var isBalanceHidden: Bool {
@Published var isBalanceHidden: Bool {
didSet {
DWGlobalOptions.sharedInstance().balanceHidden = isBalanceHidden
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ enum HomeBalanceViewState: Int {
// MARK: - HomeBalanceView

struct HomeBalanceView: View {
@StateObject private var viewModel = BalanceModel()
@ObservedObject var viewModel: BalanceModel
@State private var opacity: Double = 0.3
var onLongPress: () -> Void

Expand Down
10 changes: 6 additions & 4 deletions DashWallet/Sources/UI/Home/Views/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,10 @@ struct HomeViewContent<Content: View>: View {
@State private var skipToCreateUsername: Bool = false
@State private var giftCardTxId: Data? = nil

@StateObject var viewModel: HomeViewModel
@ObservedObject var viewModel: HomeViewModel
@ObservedObject private var balanceModel = BalanceModel()
#if DASHPAY
@StateObject var joinDPViewModel: JoinDashPayViewModel
@ObservedObject var joinDPViewModel: JoinDashPayViewModel
#endif
weak var delegate: HomeViewDelegate?
weak var shortcutsDelegate: ShortcutsActionDelegate?
Expand All @@ -202,7 +203,7 @@ struct HomeViewContent<Content: View>: View {
.padding(EdgeInsets(top: -topOverscrollSize, leading: 0, bottom: 0, trailing: 0))

LazyVStack(pinnedViews: [.sectionHeaders]) {
HomeBalanceView {
HomeBalanceView(viewModel: balanceModel) {
let action = ShortcutAction(type: .localCurrency)
shortcutsDelegate?.shortcutsView(didSelectAction: action, sender: nil)
}
Expand All @@ -220,7 +221,8 @@ struct HomeViewContent<Content: View>: View {
state: viewModel.coinJoinItem.state,
progress: viewModel.coinJoinItem.progress,
mixed: viewModel.coinJoinItem.mixed,
total: viewModel.coinJoinItem.total
total: viewModel.coinJoinItem.total,
showBalance: !balanceModel.isBalanceHidden
)
.padding(.horizontal, 15)
.id(viewModel.coinJoinItem.id)
Expand Down
14 changes: 14 additions & 0 deletions DashWallet/Sources/UI/Home/Views/TransactionFilterDialog.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
import SwiftUI
import UIKit

@objc
class TransactionFilterDialogPresenter: NSObject {
@objc static func present(from viewController: UIViewController, selectedFilter: HomeTxDisplayMode, onFilterSelected: @escaping (HomeTxDisplayMode) -> Void) {
let dialog = TransactionFilterDialog(
selectedFilter: selectedFilter,
onFilterSelected: onFilterSelected
)

let hostingController = UIHostingController(rootView: dialog)
hostingController.setDetent(350)
viewController.present(hostingController, animated: true)
}
}

struct TransactionFilterDialog: View {
@Environment(\.presentationMode) private var presentationMode
let selectedFilter: HomeTxDisplayMode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ struct SettingsMenuContent: View {
@ViewBuilder
private func CoinJoinSubtitle(_ cjItem: CoinJoinMenuItemModel) -> some View {
if cjItem.isOn {
CoinJoinProgressInfo(state: cjItem.state, progress: cjItem.progress, mixed: cjItem.mixed, total: cjItem.total, textColor: .tertiaryText, font: .caption)
CoinJoinProgressInfo(state: cjItem.state, progress: cjItem.progress, mixed: cjItem.mixed, total: cjItem.total, showBalance: !viewModel.isBalanceHidden, textColor: .tertiaryText, font: .caption)
.padding(.top, 2)
} else {
Text(NSLocalizedString("Turned off", comment: "CoinJoin"))
Expand Down
4 changes: 4 additions & 0 deletions DashWallet/Sources/UI/Menu/Settings/SettingsViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ class SettingsViewModel: ObservableObject {
@Published var items: [MenuItemModel] = []
@Published private(set) var navigationDestination: SettingsNavDest = .none

var isBalanceHidden: Bool {
DWGlobalOptions.sharedInstance().balanceHidden
}

init(model: DWSettingsMenuModel) {
self.model = model
refreshMenuItems()
Expand Down
2 changes: 2 additions & 0 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ target 'dashwallet' do
pod 'SDWebImageSwiftUI', '3.1.3', :modular_headers => true
pod 'Moya', '~> 15.0'
pod 'SwiftJWT', '3.6.200'
pod 'lottie-ios', '4.5.2'
# Debugging purposes
# pod 'Reveal-SDK', :configurations => ['Debug']

Expand All @@ -44,6 +45,7 @@ target 'dashpay' do
pod 'Moya', '~> 15.0'
pod 'SwiftJWT', '3.6.200'
pod 'TOCropViewController', '2.6.1'
pod 'lottie-ios', '4.5.2'

# Debugging purposes
# pod 'Reveal-SDK', :configurations => ['Debug']
Expand Down
Loading