From b348bdfdaba8ea41fcaada83ae33764e1de9c273 Mon Sep 17 00:00:00 2001 From: Damodaram <> Date: Tue, 14 Apr 2020 10:50:04 +0530 Subject: [PATCH] border related issues fixed --- MVMCoreUI/Atomic/Atoms/Selectors/RadioBox.swift | 6 ++++-- MVMCoreUI/Atomic/Atoms/Selectors/RadioBoxes.swift | 4 ++++ MVMCoreUI/Atomic/Atoms/Views/MFLoadImageView.swift | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/MVMCoreUI/Atomic/Atoms/Selectors/RadioBox.swift b/MVMCoreUI/Atomic/Atoms/Selectors/RadioBox.swift index da762dbb..458acfdf 100644 --- a/MVMCoreUI/Atomic/Atoms/Selectors/RadioBox.swift +++ b/MVMCoreUI/Atomic/Atoms/Selectors/RadioBox.swift @@ -39,7 +39,7 @@ open class RadioBox: Control { super.setupView() layer.delegate = self - layer.borderColor = UIColor.black.cgColor + layer.borderColor = UIColor.mfGet(forHex: "#747676").cgColor layer.borderWidth = 1 label.numberOfLines = 1 @@ -77,11 +77,12 @@ open class RadioBox: Control { // Draw the strikethrough strikeLayer?.removeFromSuperlayer() if isOutOfStock { - let line = getStrikeThrough(color: .black, thickness: 1) + let line = getStrikeThrough(color: isSelected ?.black:UIColor.mfGet(forHex: "#747676") , thickness: 1) layer.addSublayer(line) strikeLayer = line } + // Draw the border borderLayer?.removeFromSuperlayer() if isSelected { @@ -98,6 +99,7 @@ open class RadioBox: Control { if !isEnabled { let mask = getMaskLayer() layer.mask = mask + maskLayer = mask } } diff --git a/MVMCoreUI/Atomic/Atoms/Selectors/RadioBoxes.swift b/MVMCoreUI/Atomic/Atoms/Selectors/RadioBoxes.swift index 6fe66bc2..d3997323 100644 --- a/MVMCoreUI/Atomic/Atoms/Selectors/RadioBoxes.swift +++ b/MVMCoreUI/Atomic/Atoms/Selectors/RadioBoxes.swift @@ -111,6 +111,10 @@ extension RadioBoxes: UICollectionViewDataSource { open func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return boxes?.count ?? 0 } + public func collectionView(_ collectionView: UICollectionView, shouldSelectItemAt indexPath: IndexPath) -> Bool { + guard let molecule = boxes?[indexPath.row] else {return true } + return molecule.enabled + } open func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { guard let molecule = boxes?[indexPath.row], diff --git a/MVMCoreUI/Atomic/Atoms/Views/MFLoadImageView.swift b/MVMCoreUI/Atomic/Atoms/Views/MFLoadImageView.swift index 826759a7..b8b5321d 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/MFLoadImageView.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/MFLoadImageView.swift @@ -276,7 +276,7 @@ import UIKit let fallbackImageName = customFallbackImage ?? MVMCoreUIUtility.localizedImageName("fallback") if let format = format, format.lowercased().contains("gif") { // Gifs aren't supported by default and need special handling - MVMCoreCache.shared()?.getGif(imageName, useWidth: width != nil, widthForS7: width?.intValue ?? 0, useHeight: height != nil, heightForS7: height?.intValue ?? 0, format: format, localFallbackImageName: fallbackImageName, allowServerQueryParameters: allowServerParameters, localBundle: localBundle, completionHandler: finishedLoadingBlock) + MVMCoreCache.shared()?.getGif(imageName, useWidth: width != nil, widthForS7: width?.intValue ?? 0, useHeight: height != nil, heightForS7: height?.intValue ?? 0, format: format, localFallbackImageName: fallbackImageName, allowServerQueryParameters: allowServerParameters, completionHandler: finishedLoadingBlock) } else { MVMCoreCache.shared()?.getImage(imageName, useWidth: width != nil, widthForS7: width?.intValue ?? 0, useHeight: height != nil, heightForS7: height?.intValue ?? 0, format: format, localFallbackImageName: fallbackImageName, allowServerQueryParameters: allowServerParameters, localBundle: localBundle, completionHandler: finishedLoadingBlock) }