Skip to content

Commit

Permalink
Updated avatar view appearance.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanvorobei committed Feb 15, 2022
1 parent 63ebe9b commit b9f9c29
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 19 deletions.
2 changes: 1 addition & 1 deletion NativeUIKit.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = 'NativeUIKit'
s.version = '1.3.7'
s.version = '1.3.8'
s.summary = 'Mimicrated views and controls to native Apple appearance.'
s.homepage = 'https://github.com/ivanvorobei/NativeUIKit'
s.source = { :git => 'https://github.com/ivanvorobei/NativeUIKit.git', :tag => s.version }
Expand Down
15 changes: 3 additions & 12 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,9 @@ let package = Package(
)
],
dependencies: [
.package(
name: "SparrowKit",
url: "https://github.com/ivanvorobei/SparrowKit", .upToNextMajor(from: "3.5.6")
),
.package(
name: "SPPerspective",
url: "https://github.com/ivanvorobei/SPPerspective", .upToNextMajor(from: "1.4.1")
),
.package(
name: "SPDiffable",
url: "https://github.com/ivanvorobei/SPDiffable", .upToNextMajor(from: "4.0.6")
)
.package(url: "https://github.com/ivanvorobei/SparrowKit", .upToNextMajor(from: "3.5.6")),
.package(url: "https://github.com/ivanvorobei/SPPerspective", .upToNextMajor(from: "1.4.1")),
.package(url: "https://github.com/ivanvorobei/SPDiffable", .upToNextMajor(from: "4.0.6"))
],
targets: [
.target(
Expand Down
41 changes: 35 additions & 6 deletions Sources/NativeUIKit/Views/NativeAvatarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,41 @@ open class NativeAvatarView: SPView {
}
}

open var placeholderImage = UIImage.system("person.crop.circle.fill", font: .systemFont(ofSize: 80, weight: .medium))
open var placeholderColorise = SPDimmedButton.Colorise.init(content: .init(light: .systemGray3, dark: .systemGray2), background: .clear)
open var indicatorAddImage = UIImage.system("plus", font: .preferredFont(forTextStyle: .title3, weight: .bold))
open var indicatorAddColorise = SPDimmedButton.Colorise.init(content: .white, background: .systemGreen)
open var indicatorEditImage = UIImage.system("pencil", font: .preferredFont(forTextStyle: .title3, weight: .bold))
open var indicatorEditColorise = SPDimmedButton.Colorise.init(content: .white, background: .systemBlue)
open var placeholderImage = UIImage.system("person.crop.circle.fill", font: .systemFont(ofSize: 80, weight: .medium)) {
didSet {
placeholderButton.setImage(placeholderImage)
}
}

open var placeholderColorise = SPDimmedButton.Colorise.init(content: .init(light: .systemGray3, dark: .systemGray2), background: .clear) {
didSet {
placeholderButton.applyDefaultAppearance(with: placeholderColorise)
}
}

open var indicatorAddImage = UIImage.system("plus", font: .preferredFont(forTextStyle: .title3, weight: .bold)) {
didSet {
updateEditAppearance()
}
}

open var indicatorAddColorise = SPDimmedButton.Colorise.init(content: .white, background: .systemGreen) {
didSet {
updateEditAppearance()
}
}

open var indicatorEditImage = UIImage.system("pencil", font: .preferredFont(forTextStyle: .title3, weight: .bold)) {
didSet {
updateEditAppearance()
}
}

open var indicatorEditColorise = SPDimmedButton.Colorise.init(content: .white, background: .systemBlue) {
didSet {
updateEditAppearance()
}
}

// MARK: - Init

Expand Down

0 comments on commit b9f9c29

Please sign in to comment.