[ios] Discovery local experts additional.

This commit is contained in:
VladiMihaylenko 2017-12-07 15:49:17 +03:00 committed by Ilya Grechuhin
parent 8a4a604ad6
commit 4bde1a859c
5 changed files with 36 additions and 2 deletions

View file

@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "img_localsdefault.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "img_localsdefault@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "img_localsdefault@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View file

@ -14,6 +14,16 @@ final class DiscoveryLocalExpertCell: UICollectionViewCell {
typealias Tap = () -> ()
private var tap: Tap!
override var isHighlighted: Bool {
didSet {
UIView.animate(withDuration: kDefaultAnimationDuration,
delay: 0,
options: [.allowUserInteraction, .beginFromCurrentState],
animations: { self.alpha = self.isHighlighted ? 0.3 : 1 },
completion: nil)
}
}
@objc func config(avatarURL: String,
name: String,
ratingValue: String,
@ -22,10 +32,11 @@ final class DiscoveryLocalExpertCell: UICollectionViewCell {
currency: String,
tap: @escaping Tap) {
if avatarURL.count > 0 {
avatar.af_setImage(withURL: URL(string: avatarURL)!, imageTransition: .crossDissolve(kDefaultAnimationDuration))
avatar.af_setImage(withURL: URL(string: avatarURL)!, placeholderImage: #imageLiteral(resourceName: "img_localsdefault"), imageTransition: .crossDissolve(kDefaultAnimationDuration))
} else {
avatar.image = nil
avatar.image = #imageLiteral(resourceName: "img_localsdefault")
}
self.name.text = name
rating.value = ratingValue
rating.type = ratingType