Merge branch 'release/9_1_0' of https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui into bugfix/carousel_issues
* 'release/9_1_0' of https://gitlab.verizon.com/BPHV_MIPS/mvm_core_ui: error checks threading fix Revert "Merge branch 'bugfix/carousel_issues' into 'develop'" # Conflicts: # MVMCoreUI/Atomic/Organisms/Carousel/Carousel.swift
This commit is contained in:
commit
64e11e8f7a
@ -88,14 +88,18 @@ import UIKit
|
|||||||
}
|
}
|
||||||
|
|
||||||
@objc public override func dismissFieldInput(_ sender: Any?) {
|
@objc public override func dismissFieldInput(_ sender: Any?) {
|
||||||
performDropdownAction()
|
if !textField.isFirstResponder {
|
||||||
|
performDropdownAction()
|
||||||
|
}
|
||||||
super.dismissFieldInput(sender)
|
super.dismissFieldInput(sender)
|
||||||
}
|
}
|
||||||
|
|
||||||
func performDropdownAction() {
|
func performDropdownAction() {
|
||||||
if let baseDropdownEntryFieldModel = baseDropdownEntryFieldModel, let actionModel = baseDropdownEntryFieldModel.action {
|
guard let baseDropdownEntryFieldModel = baseDropdownEntryFieldModel,
|
||||||
let additionalDataWithSource = additionalData.dictionaryAdding(key: KeySourceModel, value: baseDropdownEntryFieldModel)
|
let actionModel = baseDropdownEntryFieldModel.action
|
||||||
MVMCoreActionHandler.shared()?.asyncHandleAction(with: actionModel, additionalData: additionalDataWithSource, delegateObject: delegateObject)
|
else { return }
|
||||||
}
|
|
||||||
|
let additionalDataWithSource = additionalData.dictionaryAdding(key: KeySourceModel, value: baseDropdownEntryFieldModel)
|
||||||
|
MVMCoreActionHandler.shared()?.asyncHandleAction(with: actionModel, additionalData: additionalDataWithSource, delegateObject: delegateObject)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -234,7 +234,6 @@ open class BarsIndicatorView: CarouselIndicator {
|
|||||||
super.reset()
|
super.reset()
|
||||||
barReferences.forEach { $0.removeFromSuperview() }
|
barReferences.forEach { $0.removeFromSuperview() }
|
||||||
barReferences = []
|
barReferences = []
|
||||||
currentIndex = 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override func updateUI(previousIndex: Int, newIndex: Int, totalCount: Int, isAnimated: Bool) {
|
public override func updateUI(previousIndex: Int, newIndex: Int, totalCount: Int, isAnimated: Bool) {
|
||||||
|
|||||||
@ -248,10 +248,4 @@ open class CarouselIndicator: Control, CarouselPageControlProtocol {
|
|||||||
bottomConstraint?.constant = constant
|
bottomConstraint?.constant = constant
|
||||||
topConstraint?.constant = constant
|
topConstraint?.constant = constant
|
||||||
}
|
}
|
||||||
|
|
||||||
open override func reset() {
|
|
||||||
super.reset()
|
|
||||||
currentIndex = 0
|
|
||||||
previousIndex = 0
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -41,7 +41,7 @@ open class Carousel: View {
|
|||||||
open var numberOfPages = 0
|
open var numberOfPages = 0
|
||||||
|
|
||||||
/// The models for the molecules.
|
/// The models for the molecules.
|
||||||
public var molecules: [MoleculeModelProtocol & CarouselItemModelProtocol & CollectionItemModelProtocol]?
|
public var molecules: [MoleculeModelProtocol & CarouselItemModelProtocol]?
|
||||||
|
|
||||||
/// The horizontal alignment of the cell in the collection view. Only noticeable if the itemWidthPercent is less than 100%.
|
/// The horizontal alignment of the cell in the collection view. Only noticeable if the itemWidthPercent is less than 100%.
|
||||||
public var itemAlignment = UICollectionView.ScrollPosition.left
|
public var itemAlignment = UICollectionView.ScrollPosition.left
|
||||||
@ -177,7 +177,6 @@ open class Carousel: View {
|
|||||||
if let selectedIndex = carouselModel.selectedIndex {
|
if let selectedIndex = carouselModel.selectedIndex {
|
||||||
let adjustedIndex = loop ? selectedIndex + 2 : selectedIndex
|
let adjustedIndex = loop ? selectedIndex + 2 : selectedIndex
|
||||||
collectionView.selectItem(at: IndexPath(row: adjustedIndex, section: 0), animated: false, scrollPosition: [])
|
collectionView.selectItem(at: IndexPath(row: adjustedIndex, section: 0), animated: false, scrollPosition: [])
|
||||||
goTo(adjustedIndex, animated: false)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -213,7 +212,7 @@ open class Carousel: View {
|
|||||||
pagingView?.reset()
|
pagingView?.reset()
|
||||||
collectionView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
|
collectionView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
var pagingMoleculeName: String?
|
var pagingMoleculeName: String?
|
||||||
|
|
||||||
/// Sets up the paging molecule
|
/// Sets up the paging molecule
|
||||||
|
|||||||
@ -20,7 +20,7 @@ import UIKit
|
|||||||
}
|
}
|
||||||
|
|
||||||
public var backgroundColor: Color?
|
public var backgroundColor: Color?
|
||||||
public var molecules: [MoleculeModelProtocol & CarouselItemModelProtocol & CollectionItemModelProtocol]
|
public var molecules: [MoleculeModelProtocol & CarouselItemModelProtocol]
|
||||||
public var index: Int = 0
|
public var index: Int = 0
|
||||||
public var spacing: CGFloat?
|
public var spacing: CGFloat?
|
||||||
public var border: Bool?
|
public var border: Bool?
|
||||||
@ -41,7 +41,7 @@ import UIKit
|
|||||||
public var selectable = false
|
public var selectable = false
|
||||||
public var selectedIndex: Int?
|
public var selectedIndex: Int?
|
||||||
|
|
||||||
public init(molecules: [MoleculeModelProtocol & CarouselItemModelProtocol & CollectionItemModelProtocol]) {
|
public init(molecules: [MoleculeModelProtocol & CarouselItemModelProtocol]) {
|
||||||
self.molecules = molecules
|
self.molecules = molecules
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1053,7 +1053,11 @@ CGFloat const PanelAnimationDuration = 0.2;
|
|||||||
}
|
}
|
||||||
|
|
||||||
+ (CGFloat)getApplicationViewWidth {
|
+ (CGFloat)getApplicationViewWidth {
|
||||||
return CGRectGetWidth([self getBounds:[MVMCoreUISession sharedGlobal].splitViewController.view.superview]);
|
__block CGFloat width;
|
||||||
|
[MVMCoreDispatchUtility performSyncBlockOnMainThread:^{
|
||||||
|
width = CGRectGetWidth([self getBounds:[MVMCoreUISession sharedGlobal].splitViewController.view.superview]);
|
||||||
|
}];
|
||||||
|
return width;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (CGFloat)getApplicationViewMaxSize {
|
+ (CGFloat)getApplicationViewMaxSize {
|
||||||
|
|||||||
@ -270,7 +270,9 @@ import UIKit
|
|||||||
bottomBar?.frame = CGRect(x: 0, y: bounds.height - size, width: bounds.width, height: size)
|
bottomBar?.frame = CGRect(x: 0, y: bounds.height - size, width: bounds.width, height: size)
|
||||||
|
|
||||||
if updateMoleculeLayout || heightChanged {
|
if updateMoleculeLayout || heightChanged {
|
||||||
delegateObject?.moleculeDelegate?.moleculeLayoutUpdated(self)
|
DispatchQueue.main.async { [self] in
|
||||||
|
delegateObject?.moleculeDelegate?.moleculeLayoutUpdated(self)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setNeedsDisplay()
|
setNeedsDisplay()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user