border related issues fixed

This commit is contained in:
Damodaram 2020-04-14 10:50:04 +05:30
parent d000715518
commit b348bdfdab
3 changed files with 9 additions and 3 deletions

View File

@ -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
}
}

View File

@ -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],

View File

@ -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)
}