Skip to content

Commit

Permalink
Merge pull request #657 from Syn-McJ/release/8.1.0
Browse files Browse the repository at this point in the history
8.1.0 release
  • Loading branch information
Syn-McJ authored Jun 13, 2024
2 parents 7656d69 + ca61265 commit 8080db4
Show file tree
Hide file tree
Showing 193 changed files with 11,471 additions and 6,859 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ TODO.md
*/GoogleService-Info.plist
*/Topper-Info.plist
*/Coinbase-Info.plist
*/ZenLedger-Info.plist
7 changes: 3 additions & 4 deletions DashPay/Presentation/Home/Cells/DWFilterHeaderView.xib
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22684"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand All @@ -30,7 +29,7 @@
<color key="textColor" name="DarkTitleColor"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" semanticContentAttribute="forceRightToLeft" verticalCompressionResistancePriority="1000" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="4tg-cy-qVc" customClass="DashButton" customModule="dashwallet" customModuleProvider="target">
<button opaque="NO" contentMode="scaleToFill" semanticContentAttribute="forceRightToLeft" verticalCompressionResistancePriority="1000" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="4tg-cy-qVc" customClass="DWDashButton" customModule="dashwallet" customModuleProvider="target">
<rect key="frame" x="319" y="8" width="12" height="53"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleCaption2"/>
<color key="tintColor" name="DashBlueColor"/>
Expand Down
196 changes: 196 additions & 0 deletions DashPay/Presentation/Home/Views/DPVotingResultView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
//
// Created by Andrei Ashikhmin
// Copyright © 2023 Dash Core Group. All rights reserved.
//
// Licensed under the MIT License (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://opensource.org/licenses/MIT
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

import Foundation

enum DPVotingState {
case approved
case notApproved
}

@objc
class DPVotingResultView: UIView {
var state: DPVotingState = .approved {
didSet {
change(state: self.state)
}
}

var onAction: (() -> ())?
var onClose: (() -> ())?

private let closeButton: UIButton = {
let button = UIButton(type: .system)
let symbolConfiguration = UIImage.SymbolConfiguration(scale: .small)
let symbolImage = UIImage(systemName: "xmark", withConfiguration: symbolConfiguration)
button.setImage(symbolImage, for: .normal)
button.tintColor = .dw_tabbarInactiveButton()
button.translatesAutoresizingMaskIntoConstraints = false

return button
}()

private let actionButton: UIButton = {
let button = ActionButton()
let attributes: [NSAttributedString.Key: Any] = [
.font: UIFont.dw_mediumFont(ofSize: 13)
]
button.setAttributedTitle(NSAttributedString(string: NSLocalizedString("Create Username", comment: ""), attributes: attributes), for: .normal)
button.translatesAutoresizingMaskIntoConstraints = false
button.isHidden = true

return button
}()

private let image: UIImageView = {
let image = UIImageView(image: UIImage(named: "pay_user_accessory"))
image.translatesAutoresizingMaskIntoConstraints = false

return image
}()

private let contentView: UIView = {
let view = UIView()
view.translatesAutoresizingMaskIntoConstraints = false
view.backgroundColor = .dw_background()
view.layer.cornerRadius = 8.0
view.layer.masksToBounds = true

return view
}()

private let titleLabel: UILabel = {
let label = UILabel()
label.translatesAutoresizingMaskIntoConstraints = false
label.textColor = .dw_label()
label.numberOfLines = 0
label.font = .dw_mediumFont(ofSize: 13)
label.text = NSLocalizedString("Join DashPay", comment: "")

return label
}()

private let subtitleLabel: UILabel = {
let label = UILabel()
label.translatesAutoresizingMaskIntoConstraints = false
label.textColor = .dw_secondaryText()
label.numberOfLines = 0
label.font = .dw_regularFont(ofSize: 12)
label.text = NSLocalizedString("Create a username, add your friends.", comment: "")

return label
}()

private var actionButtonHeightConstraint: NSLayoutConstraint!
private var actionButtonMarginConstraint: NSLayoutConstraint!

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

override init(frame: CGRect) {
super.init(frame: frame)

backgroundColor = UIColor.clear
layoutMargins = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 16)

let shadowView = ShadowView(frame: .zero)
shadowView.translatesAutoresizingMaskIntoConstraints = false
shadowView.insetsLayoutMarginsFromSafeArea = true
addSubview(shadowView)

shadowView.addSubview(contentView)
contentView.addSubview(titleLabel)
contentView.addSubview(subtitleLabel)
contentView.addSubview(image)
contentView.addSubview(closeButton)
closeButton.addAction(.touchUpInside) { [weak self] _ in
self?.onClose?()
}
contentView.addSubview(actionButton)
actionButton.addAction(.touchUpInside) { [weak self] _ in
self?.onAction?()
}

titleLabel.setContentCompressionResistancePriority(.required - 1, for: .horizontal)
subtitleLabel.setContentCompressionResistancePriority(.required - 2, for: .horizontal)
titleLabel.setContentCompressionResistancePriority(.required - 1, for: .vertical)
subtitleLabel.setContentCompressionResistancePriority(.required - 2, for: .vertical)

actionButtonHeightConstraint = actionButton.heightAnchor.constraint(equalToConstant: 30)
actionButtonMarginConstraint = contentView.bottomAnchor.constraint(equalTo: actionButton.bottomAnchor, constant: 15)

NSLayoutConstraint.activate([
shadowView.leadingAnchor.constraint(equalTo: layoutMarginsGuide.leadingAnchor),
shadowView.topAnchor.constraint(equalTo: topAnchor),
layoutMarginsGuide.trailingAnchor.constraint(equalTo: shadowView.trailingAnchor),
bottomAnchor.constraint(equalTo: shadowView.bottomAnchor),

contentView.leadingAnchor.constraint(equalTo: shadowView.leadingAnchor),
contentView.topAnchor.constraint(equalTo: shadowView.topAnchor),
contentView.trailingAnchor.constraint(equalTo: closeButton.trailingAnchor),

shadowView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor),
shadowView.bottomAnchor.constraint(equalTo: contentView.bottomAnchor),

titleLabel.topAnchor.constraint(equalTo: contentView.topAnchor, constant: 16),
titleLabel.leadingAnchor.constraint(equalTo: image.trailingAnchor, constant: 15),
titleLabel.trailingAnchor.constraint(equalTo: closeButton.leadingAnchor),

subtitleLabel.topAnchor.constraint(equalTo: titleLabel.bottomAnchor, constant: 4.0),
subtitleLabel.leadingAnchor.constraint(equalTo: image.trailingAnchor, constant: 15),
subtitleLabel.trailingAnchor.constraint(equalTo: closeButton.leadingAnchor),

image.widthAnchor.constraint(equalToConstant: 32.0),
image.heightAnchor.constraint(equalToConstant: 32.0),
image.topAnchor.constraint(equalTo: titleLabel.topAnchor),
image.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: 15),

closeButton.heightAnchor.constraint(equalToConstant: 40),
closeButton.widthAnchor.constraint(equalToConstant: 40),
closeButton.topAnchor.constraint(equalTo: topAnchor),
closeButton.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -15),

actionButtonHeightConstraint,
actionButton.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: 15),
actionButton.trailingAnchor.constraint(equalTo: contentView.trailingAnchor, constant: -15),
actionButton.topAnchor.constraint(equalTo: subtitleLabel.bottomAnchor, constant: 15),
actionButtonMarginConstraint
])

change(state: self.state)
}

private func change(state: DPVotingState) {
actionButton.isHidden = state != .notApproved


if state == .notApproved {
image.image = UIImage(named: "dashpay.welcome.disabled")
titleLabel.text = NSLocalizedString("Requested username was not approved", comment: "")
subtitleLabel.text = NSLocalizedString("You can create a different username without paying again", comment: "")
actionButtonHeightConstraint.constant = 30
actionButtonMarginConstraint.constant = 15
} else {
image.image = UIImage(named: "dashpay.welcome")
titleLabel.text = NSLocalizedString("Your username was approved", comment: "")
subtitleLabel.text = NSLocalizedString("Update your profile and start adding contacts", comment: "")
actionButtonHeightConstraint.constant = 0
actionButtonMarginConstraint.constant = 0
}
}
}
105 changes: 105 additions & 0 deletions DashPay/Presentation/Home/Views/DPWelcomeView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
//
// Created by Andrew Podkovyrin
// Copyright © 2020 Dash Core Group. All rights reserved.
//
// Licensed under the MIT License (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://opensource.org/licenses/MIT
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

import UIKit

@objc
class DPWelcomeView: DWBasePressableControl {
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

override init(frame: CGRect) {
let titleLabel = UILabel()
let subtitleLabel = UILabel()
let arrowImageView = UIImageView(image: UIImage(named: "pay_user_accessory"))

super.init(frame: frame)

backgroundColor = UIColor.clear
layoutMargins = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 16)

let shadowView = ShadowView(frame: .zero)
shadowView.translatesAutoresizingMaskIntoConstraints = false
shadowView.insetsLayoutMarginsFromSafeArea = true
shadowView.isUserInteractionEnabled = false
addSubview(shadowView)

let contentView = UIView()
contentView.translatesAutoresizingMaskIntoConstraints = false
contentView.backgroundColor = .dw_background()
contentView.layer.cornerRadius = 8.0
contentView.layer.masksToBounds = true
contentView.isUserInteractionEnabled = false
shadowView.addSubview(contentView)

titleLabel.translatesAutoresizingMaskIntoConstraints = false
titleLabel.textColor = UIColor.dw_darkTitle()
titleLabel.numberOfLines = 0
titleLabel.adjustsFontForContentSizeCategory = true
titleLabel.font = .dw_font(forTextStyle: .subheadline)
titleLabel.text = NSLocalizedString("Join DashPay", comment: "")
titleLabel.isUserInteractionEnabled = false
contentView.addSubview(titleLabel)

subtitleLabel.translatesAutoresizingMaskIntoConstraints = false
subtitleLabel.textColor = .dw_tertiaryText()
subtitleLabel.numberOfLines = 0
subtitleLabel.adjustsFontForContentSizeCategory = true
subtitleLabel.font = .dw_font(forTextStyle: .footnote)
subtitleLabel.text = NSLocalizedString("Create a username, add your friends.", comment: "")
subtitleLabel.isUserInteractionEnabled = false
contentView.addSubview(subtitleLabel)

arrowImageView.translatesAutoresizingMaskIntoConstraints = false
arrowImageView.isUserInteractionEnabled = false
contentView.addSubview(arrowImageView)

titleLabel.setContentCompressionResistancePriority(.required - 1, for: .horizontal)
subtitleLabel.setContentCompressionResistancePriority(.required - 2, for: .horizontal)
titleLabel.setContentCompressionResistancePriority(.required - 1, for: .vertical)
subtitleLabel.setContentCompressionResistancePriority(.required - 2, for: .vertical)

let guide = layoutMarginsGuide
NSLayoutConstraint.activate([
shadowView.leadingAnchor.constraint(equalTo: guide.leadingAnchor),
shadowView.topAnchor.constraint(equalTo: topAnchor),
guide.trailingAnchor.constraint(equalTo: shadowView.trailingAnchor),
bottomAnchor.constraint(equalTo: shadowView.bottomAnchor),

contentView.leadingAnchor.constraint(equalTo: shadowView.leadingAnchor),
contentView.topAnchor.constraint(equalTo: shadowView.topAnchor),
shadowView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor),
shadowView.bottomAnchor.constraint(equalTo: contentView.bottomAnchor),

titleLabel.topAnchor.constraint(equalTo: contentView.topAnchor, constant: 16),
titleLabel.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: 12),

subtitleLabel.topAnchor.constraint(equalTo: titleLabel.bottomAnchor, constant: 2.0),
subtitleLabel.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: 12),
contentView.bottomAnchor.constraint(equalTo: subtitleLabel.bottomAnchor, constant: 16),

arrowImageView.leadingAnchor.constraint(equalTo: subtitleLabel.trailingAnchor, constant: 12),
arrowImageView.leadingAnchor.constraint(equalTo: titleLabel.trailingAnchor, constant: 12),
arrowImageView.centerYAnchor.constraint(equalTo: contentView.centerYAnchor),
contentView.trailingAnchor.constraint(equalTo: arrowImageView.trailingAnchor, constant: 12),

arrowImageView.widthAnchor.constraint(equalToConstant: 32.0),
arrowImageView.heightAnchor.constraint(equalToConstant: 32.0),
])
}
}
Loading

0 comments on commit 8080db4

Please sign in to comment.