forked from organicmaps/organicmaps
[ios] Discovery local experts additional.
This commit is contained in:
parent
8a4a604ad6
commit
4bde1a859c
5 changed files with 36 additions and 2 deletions
23
iphone/Maps/Images.xcassets/Discovery/img_localsdefault.imageset/Contents.json
vendored
Normal file
23
iphone/Maps/Images.xcassets/Discovery/img_localsdefault.imageset/Contents.json
vendored
Normal 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"
|
||||
}
|
||||
}
|
BIN
iphone/Maps/Images.xcassets/Discovery/img_localsdefault.imageset/img_localsdefault.png
vendored
Normal file
BIN
iphone/Maps/Images.xcassets/Discovery/img_localsdefault.imageset/img_localsdefault.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
BIN
iphone/Maps/Images.xcassets/Discovery/img_localsdefault.imageset/img_localsdefault@2x.png
vendored
Normal file
BIN
iphone/Maps/Images.xcassets/Discovery/img_localsdefault.imageset/img_localsdefault@2x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.3 KiB |
BIN
iphone/Maps/Images.xcassets/Discovery/img_localsdefault.imageset/img_localsdefault@3x.png
vendored
Normal file
BIN
iphone/Maps/Images.xcassets/Discovery/img_localsdefault.imageset/img_localsdefault@3x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue