Skip to content

Commit

Permalink
- update library to support animated webp
Browse files Browse the repository at this point in the history
- update imageViews to better support A-webp
- add error message to media cell when unable to play content
  • Loading branch information
simonmcl committed Jan 23, 2024
1 parent daf1e81 commit 520ee2f
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"location" : "https://github.com/kukai-wallet/kukai-core-swift",
"state" : {
"branch" : "develop",
"revision" : "6a7d1f937117de5d88b9a936e74c64084a56be2b"
"revision" : "f3205473ddd59a6cfc7107c106e73dd9fe830247"
}
},
{
Expand Down
1 change: 1 addition & 0 deletions Kukai Mobile/Localization/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,4 @@
"error-wc2-unrecoverable"="An unknown error occured with the connection. This operation can't continue. Please check the other application and try agian";
"error-wc2-cant-continue"="Unable to continue with this request due to system error";
"error-beacon-not-supported"="Beacon QRCodes are not supported, only Wallet Connect. Please make sure you are using the kukai option. If you are, please contact the dApp support team and ask them to update their beacon version";
"error-collectible-media-generic"="Unable to play media at this time, please try again later";
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
//

import UIKit
import SDWebImage

class CollectiblesCollectionItemLargeWithTextCell: UICollectionViewCell, UITableViewCellImageDownloading {

@IBOutlet weak var iconView: UIImageView!
@IBOutlet weak var iconView: SDAnimatedImageView!
@IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak var quantityView: UIView!
@IBOutlet weak var quantityLabel: UILabel!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ class CollectibleDetailAVCell: UICollectionViewCell {
case .failed:
self?.mediaActivityView.stopAnimating()
self?.mediaActivityView.isHidden = true
self?.parentViewController()?.windowError(withTitle: "error".localized(), description: "error-collectible-media-generic".localized())
Logger.app.error("AVPlayer - Error: \(String(describing: item.error)), Message: \(String(describing: item.error?.localizedDescription))")

case .unknown:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@

import UIKit
import KukaiCoreSwift
import SDWebImage

class CollectibleDetailImageCell: UICollectionViewCell {

@IBOutlet weak var activityIndicator: UIActivityIndicatorView!
@IBOutlet weak var imageView: UIImageView!
@IBOutlet weak var imageView: SDAnimatedImageView!
@IBOutlet weak var aspectRatioConstraint: NSLayoutConstraint!

public var setup = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class CollectiblesCollectionCell: UICollectionViewCell, UITableViewCellImageDown
func setupImages(imageURLs: [URL?]) {

// Images 1-4 display if urls present

emptyStyle(forImageView: collectionImage1)
if imageURLs.count > 0 {
MediaProxyService.load(url: imageURLs[0], to: collectionImage1, withCacheType: .temporary, fallback: UIImage.unknownGroup()) { [weak self] imageSize in
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?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="22505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_12" orientation="portrait" appearance="dark"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
Expand Down Expand Up @@ -45,7 +45,7 @@
<stackView opaque="NO" contentMode="scaleToFill" distribution="equalSpacing" translatesAutoresizingMaskIntoConstraints="NO" id="x9w-7P-wqQ">
<rect key="frame" x="34" y="38" width="312" height="54"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="oVn-03-8AL">
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="oVn-03-8AL" customClass="SDAnimatedImageView">
<rect key="frame" x="0.0" y="0.0" width="54" height="54"/>
<constraints>
<constraint firstAttribute="height" constant="54" id="b5Q-HK-VQH"/>
Expand All @@ -58,7 +58,7 @@
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="qY9-6u-j5M">
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="qY9-6u-j5M" customClass="SDAnimatedImageView">
<rect key="frame" x="64.666666666666671" y="0.0" width="54" height="54"/>
<constraints>
<constraint firstAttribute="width" constant="54" id="68M-9B-iup"/>
Expand All @@ -71,7 +71,7 @@
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="gp8-aW-hwb">
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="gp8-aW-hwb" customClass="SDAnimatedImageView">
<rect key="frame" x="129" y="0.0" width="54" height="54"/>
<constraints>
<constraint firstAttribute="height" constant="54" id="NBa-rr-ebF"/>
Expand All @@ -84,7 +84,7 @@
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="S5j-UX-nSW">
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="S5j-UX-nSW" customClass="SDAnimatedImageView">
<rect key="frame" x="193.66666666666666" y="0.0" width="54" height="54"/>
<constraints>
<constraint firstAttribute="height" constant="54" id="fsp-4v-jzE"/>
Expand All @@ -100,7 +100,7 @@
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="pza-1s-sun">
<rect key="frame" x="258" y="0.0" width="54" height="54"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="WYm-E6-XuL">
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="WYm-E6-XuL" customClass="SDAnimatedImageView">
<rect key="frame" x="0.0" y="0.0" width="54" height="54"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="maskToBounds" value="YES"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
//

import UIKit
import SDWebImage

class CollectiblesCollectionLargeCell: UICollectionViewCell {

@IBOutlet weak var iconView: UIImageView!
@IBOutlet weak var iconView: SDAnimatedImageView!
@IBOutlet weak var titleLabel: UILabel!
@IBOutlet var quantityView: UIView!
@IBOutlet var quantityLabel: UILabel!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
//

import UIKit
import SDWebImage

class CollectiblesCollectionSinglePageCell: UICollectionViewCell {

@IBOutlet weak var iconView: UIImageView!
@IBOutlet weak var iconView: SDAnimatedImageView!
@IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak var subTitleLabel: UILabel!
@IBOutlet weak var buttonView: UIView!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
//

import UIKit
import SDWebImage

class SearchResultCell: UICollectionViewCell {

@IBOutlet weak var iconView: UIImageView!
@IBOutlet weak var iconView: SDAnimatedImageView!
@IBOutlet weak var titleLabel: UILabel!
@IBOutlet weak var quantityView: UIView!
@IBOutlet weak var quantityLabel: UILabel!
Expand Down

0 comments on commit 520ee2f

Please sign in to comment.