Merge branch 'mbruce/bugfix' into 'develop'
Bug fixes See merge request BPHV_MIPS/vds_ios!298
This commit is contained in:
commit
973c45adbd
@ -1593,7 +1593,7 @@
|
|||||||
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
|
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
|
||||||
CODE_SIGN_IDENTITY = "";
|
CODE_SIGN_IDENTITY = "";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 72;
|
CURRENT_PROJECT_VERSION = 73;
|
||||||
DEFINES_MODULE = YES;
|
DEFINES_MODULE = YES;
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = "";
|
||||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||||
@ -1631,7 +1631,7 @@
|
|||||||
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
|
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
|
||||||
CODE_SIGN_IDENTITY = "";
|
CODE_SIGN_IDENTITY = "";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 72;
|
CURRENT_PROJECT_VERSION = 73;
|
||||||
DEFINES_MODULE = YES;
|
DEFINES_MODULE = YES;
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = "";
|
||||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||||
|
|||||||
@ -87,9 +87,6 @@ open class SelectorBase: Control, SelectorControlable, ParentViewProtocol {
|
|||||||
|
|
||||||
open var selectorColorConfiguration = ControlColorConfiguration() { didSet { setNeedsUpdate() } }
|
open var selectorColorConfiguration = ControlColorConfiguration() { didSet { setNeedsUpdate() } }
|
||||||
|
|
||||||
/// The natural size for the receiving view, considering only properties of the view itself.
|
|
||||||
open override var intrinsicContentSize: CGSize { size }
|
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Private Properties
|
// MARK: - Private Properties
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
@ -109,6 +106,16 @@ open class SelectorBase: Control, SelectorControlable, ParentViewProtocol {
|
|||||||
super.setup()
|
super.setup()
|
||||||
isAccessibilityElement = true
|
isAccessibilityElement = true
|
||||||
accessibilityTraits = .button
|
accessibilityTraits = .button
|
||||||
|
|
||||||
|
let layoutGuide = UILayoutGuide()
|
||||||
|
addLayoutGuide(layoutGuide)
|
||||||
|
layoutGuide
|
||||||
|
.pinTop(0)
|
||||||
|
.pinLeading(0)
|
||||||
|
.pinTrailing(0, .defaultHigh)
|
||||||
|
.pinBottom(0, .defaultHigh)
|
||||||
|
.width(size.width)
|
||||||
|
.height(size.height)
|
||||||
}
|
}
|
||||||
|
|
||||||
open override func setDefaults() {
|
open override func setDefaults() {
|
||||||
|
|||||||
@ -272,6 +272,7 @@ open class Carousel: View {
|
|||||||
super.updateView()
|
super.updateView()
|
||||||
updateScrollbar()
|
updateScrollbar()
|
||||||
updateCarousel()
|
updateCarousel()
|
||||||
|
collectionView.collectionViewLayout.invalidateLayout()
|
||||||
collectionView.reloadData()
|
collectionView.reloadData()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -516,10 +517,15 @@ extension Carousel: UICollectionViewDelegate, UICollectionViewDataSource, UIColl
|
|||||||
|
|
||||||
public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
|
public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
|
||||||
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: CarouselSlotCell.identifier, for: indexPath) as? CarouselSlotCell else { return UICollectionViewCell() }
|
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: CarouselSlotCell.identifier, for: indexPath) as? CarouselSlotCell else { return UICollectionViewCell() }
|
||||||
cell.contentView.subviews.forEach { $0.removeFromSuperview() }
|
|
||||||
let component = views[indexPath.row]
|
let component = views[indexPath.row]
|
||||||
cell.update(with: component, slotAlignment: slotAlignment, surface: surface)
|
cell.update(with: component, slotAlignment: slotAlignment, surface: surface)
|
||||||
cell.layoutIfNeeded()
|
cell.layoutIfNeeded()
|
||||||
|
//component.setNeedsLayout()
|
||||||
|
if hasDebugBorder {
|
||||||
|
cell.addDebugBorder()
|
||||||
|
} else {
|
||||||
|
cell.removeDebugBorder()
|
||||||
|
}
|
||||||
return cell
|
return cell
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -25,11 +25,6 @@ final class CarouselSlotCell: UICollectionViewCell {
|
|||||||
super.init(coder: coder)
|
super.init(coder: coder)
|
||||||
setUp()
|
setUp()
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
|
||||||
// MARK: - Private Properties
|
|
||||||
//--------------------------------------------------
|
|
||||||
private var surface: Surface = .light
|
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Private Methods
|
// MARK: - Private Methods
|
||||||
@ -42,7 +37,7 @@ final class CarouselSlotCell: UICollectionViewCell {
|
|||||||
|
|
||||||
/// Updating UI based on data along with surface.
|
/// Updating UI based on data along with surface.
|
||||||
func update(with component: UIView, slotAlignment: Carousel.CarouselSlotAlignmentModel?, surface: Surface) {
|
func update(with component: UIView, slotAlignment: Carousel.CarouselSlotAlignmentModel?, surface: Surface) {
|
||||||
self.surface = surface
|
contentView.subviews.forEach { $0.removeFromSuperview() }
|
||||||
contentView.addSubview(component)
|
contentView.addSubview(component)
|
||||||
if var surfacedView = component as? Surfaceable {
|
if var surfacedView = component as? Surfaceable {
|
||||||
surfacedView.surface = surface
|
surfacedView.surface = surface
|
||||||
|
|||||||
@ -18,6 +18,8 @@ open class Pagination: View {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Private Properties
|
// MARK: - Private Properties
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
private let pageChangedSubject = PassthroughSubject<Pagination, Never>()
|
||||||
|
|
||||||
///Maximum component width
|
///Maximum component width
|
||||||
private let maxWidth: CGFloat = 288.0
|
private let maxWidth: CGFloat = 288.0
|
||||||
///Collectionview width anchor
|
///Collectionview width anchor
|
||||||
@ -52,6 +54,8 @@ open class Pagination: View {
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
// MARK: - Public Properties
|
// MARK: - Public Properties
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
public var pageChangedPublisher: AnyPublisher<Pagination, Never> { pageChangedSubject.eraseToAnyPublisher() }
|
||||||
|
|
||||||
///Previous button to select previous page
|
///Previous button to select previous page
|
||||||
public let previousButton: PaginationButton = .init(type: .previous)
|
public let previousButton: PaginationButton = .init(type: .previous)
|
||||||
///Next button to select next page
|
///Next button to select next page
|
||||||
@ -145,6 +149,11 @@ open class Pagination: View {
|
|||||||
.sink { [weak self] value in
|
.sink { [weak self] value in
|
||||||
self?.collectionViewWidthAnchor?.constant = value //As cell width is dynamic i.e cell may contain 2 or 3 or 4 charcters. Make sure that all the visible cells are displayed.
|
self?.collectionViewWidthAnchor?.constant = value //As cell width is dynamic i.e cell may contain 2 or 3 or 4 charcters. Make sure that all the visible cells are displayed.
|
||||||
}.store(in: &subscribers)
|
}.store(in: &subscribers)
|
||||||
|
|
||||||
|
pageChangedPublisher.sink { [weak self] control in
|
||||||
|
guard let self else { return }
|
||||||
|
onPageDidSelect?(control.selectedPage)
|
||||||
|
}.store(in: &subscribers)
|
||||||
}
|
}
|
||||||
|
|
||||||
open override func setDefaults() {
|
open override func setDefaults() {
|
||||||
@ -195,6 +204,7 @@ open class Pagination: View {
|
|||||||
let isNextAction = sender == nextButton
|
let isNextAction = sender == nextButton
|
||||||
_selectedPageIndex = if isNextAction { _selectedPageIndex + 1 } else { _selectedPageIndex - 1 }
|
_selectedPageIndex = if isNextAction { _selectedPageIndex + 1 } else { _selectedPageIndex - 1 }
|
||||||
updateSelection()
|
updateSelection()
|
||||||
|
pageChangedSubject.send(self)
|
||||||
DispatchQueue.main.asyncAfter(deadline: .now() + 1) { [weak self] in
|
DispatchQueue.main.asyncAfter(deadline: .now() + 1) { [weak self] in
|
||||||
guard let self else { return }
|
guard let self else { return }
|
||||||
UIAccessibility.post(notification: .announcement, argument: paginationDescription)
|
UIAccessibility.post(notification: .announcement, argument: paginationDescription)
|
||||||
@ -249,7 +259,7 @@ extension Pagination: UICollectionViewDelegate, UICollectionViewDataSource, UICo
|
|||||||
guard _selectedPageIndex != indexPath.row else { return }
|
guard _selectedPageIndex != indexPath.row else { return }
|
||||||
_selectedPageIndex = indexPath.row
|
_selectedPageIndex = indexPath.row
|
||||||
updateSelection()
|
updateSelection()
|
||||||
onPageDidSelect?(selectedPage)
|
pageChangedSubject.send(self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user