Skip to content

Commit

Permalink
Merge pull request #2443 from CruGlobal/develop
Browse files Browse the repository at this point in the history
Merge develop into master for new QA release
  • Loading branch information
levieggertcru authored Feb 7, 2025
2 parents fc4d977 + 31ee50c commit bc8b788
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import GodToolsToolParser
class MultiplatformContent {

let content: [Content]
let contentInsets: UIEdgeInsets
let contentInsets: UIEdgeInsets?
let scrollIsEnabled: Bool

init(content: [Content], contentInsets: UIEdgeInsets, scrollIsEnabled: Bool) {
init(content: [Content], contentInsets: UIEdgeInsets?, scrollIsEnabled: Bool) {

self.content = content
self.contentInsets = contentInsets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ extension ContentPage: MobileContentRenderableModel {
func getRenderableChildModels() -> [AnyObject] {

var childModels: [AnyObject] = Array()


let contentPageHorizontalInsets: CGFloat = 16

let multiplatformContent: MultiplatformContent = MultiplatformContent(
content: content,
contentInsets: .zero,
contentInsets: UIEdgeInsets(top: 0, left: contentPageHorizontalInsets, bottom: 0, right: contentPageHorizontalInsets),
scrollIsEnabled: true
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class MobileContentPageViewFactory: MobileContentPageViewFactoryType {
mobileContentAnalytics: mobileContentAnalytics
)

let view = MobileContentParagraphView(viewModel: viewModel, scrollIsEnabled: false)
let view = MobileContentParagraphView(viewModel: viewModel)

return view
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class MobileContentFlowView: MobileContentStackView {

self.viewModel = viewModel

super.init(viewModel: viewModel, contentInsets: .zero, scrollIsEnabled: false)
super.init(viewModel: viewModel, contentInsets: nil, scrollIsEnabled: false)
}

required init?(coder: NSCoder) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class MobileContentFlowItemView: MobileContentStackView, MobileContentFlowRowIte

self.viewModel = viewModel

super.init(viewModel: viewModel, contentInsets: .zero, scrollIsEnabled: false)
super.init(viewModel: viewModel, contentInsets: nil, scrollIsEnabled: false)

setupBinding()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class MobileContentFormView: MobileContentStackView {

self.viewModel = viewModel

super.init(viewModel: viewModel, contentInsets: .zero, scrollIsEnabled: false)
super.init(viewModel: viewModel, contentInsets: nil, scrollIsEnabled: false)

setupLayout()
setupBinding()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class MobileContentMultiSelectView: MobileContentStackView {
self.itemSpacing = itemSpacing
self.isSingleColumn = isSingleColumn

super.init(viewModel: viewModel, contentInsets: .zero, scrollIsEnabled: false, itemSpacing: Self.multiSelectOptionSpacing)
super.init(viewModel: viewModel, contentInsets: nil, scrollIsEnabled: false, itemSpacing: Self.multiSelectOptionSpacing)

setupLayout()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,13 @@
import UIKit

class MobileContentContentPageView: MobileContentPageView {

private static let horizontalPadding: CGFloat = 16


private let viewModel: MobileContentContentPageViewModel
private let contentInsets: UIEdgeInsets

private var contentStackView: MobileContentStackView?

init(viewModel: MobileContentContentPageViewModel) {

self.viewModel = viewModel
self.contentInsets = UIEdgeInsets(top: 0, left: Self.horizontalPadding, bottom: 0, right: Self.horizontalPadding)

super.init(viewModel: viewModel, nibName: nil)
}
Expand Down Expand Up @@ -68,8 +63,7 @@ extension MobileContentContentPageView {

contentStackView.translatesAutoresizingMaskIntoConstraints = false
contentStackView.constrainEdgesToView(view: self)
contentStackView.configureLayout(contentInsets: contentInsets, scrollIsEnabled: true)


self.contentStackView = contentStackView
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ class MobileContentParagraphView: MobileContentStackView {

private let viewModel: MobileContentParagraphViewModel

init(viewModel: MobileContentParagraphViewModel, scrollIsEnabled: Bool) {
init(viewModel: MobileContentParagraphViewModel) {

self.viewModel = viewModel

super.init(
viewModel: viewModel,
contentInsets: UIEdgeInsets(top: Self.topPadding, left: 0, bottom: Self.bottomPadding, right: 0),
scrollIsEnabled: scrollIsEnabled
scrollIsEnabled: false
)

setupBinding()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class MobileContentStackView: MobileContentView {
private var isObservingBoundsChanges: Bool = false
private var lastRenderedParentBounds: CGRect?

init(viewModel: MobileContentViewModel, contentInsets: UIEdgeInsets, scrollIsEnabled: Bool, itemSpacing: CGFloat? = nil) {
init(viewModel: MobileContentViewModel, contentInsets: UIEdgeInsets?, scrollIsEnabled: Bool, itemSpacing: CGFloat? = nil) {

super.init(viewModel: viewModel, frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.size.width, height: 0))

Expand Down Expand Up @@ -141,6 +141,10 @@ class MobileContentStackView: MobileContentView {
return scrollView?.contentSize ?? childrenParentView.frame.size
}

func getContentInsets() -> UIEdgeInsets {
return contentInsets
}

func setScrollViewContentSize(size: CGSize) {
scrollView?.contentSize = size
}
Expand Down Expand Up @@ -363,7 +367,7 @@ extension MobileContentStackView {

extension MobileContentStackView {

func configureLayout(contentInsets: UIEdgeInsets?, scrollIsEnabled: Bool?, itemSpacing: CGFloat? = nil) {
private func configureLayout(contentInsets: UIEdgeInsets?, scrollIsEnabled: Bool?, itemSpacing: CGFloat? = nil) {

removeBoundsChangeObserverOnChildrenParentView()

Expand Down Expand Up @@ -525,7 +529,7 @@ extension MobileContentStackView {
extension MobileContentStackView {

private func addChildView(childView: MobileContentView) {

let childContentView: UIView = childView

childrenParentView.addSubview(childContentView)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class MobileContentTabView: MobileContentStackView {

self.viewModel = viewModel

super.init(viewModel: viewModel, contentInsets: .zero, scrollIsEnabled: false)
super.init(viewModel: viewModel, contentInsets: nil, scrollIsEnabled: false)

setupLayout()
setupBinding()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class TractPageHeroView: MobileContentStackView {

self.viewModel = viewModel

super.init(viewModel: viewModel, contentInsets: .zero, scrollIsEnabled: true)
super.init(viewModel: viewModel, contentInsets: nil, scrollIsEnabled: true)
}

required init?(coder: NSCoder) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class TractPageModalView: MobileContentView, NibBased {
init(viewModel: TractPageModalViewModel) {

self.viewModel = viewModel
self.contentStackView = MobileContentStackView(viewModel: viewModel, contentInsets: .zero, scrollIsEnabled: true)
self.contentStackView = MobileContentStackView(viewModel: viewModel, contentInsets: nil, scrollIsEnabled: true)

super.init(viewModel: viewModel, frame: UIScreen.main.bounds)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class TrainingPageView: MobileContentView, NibBased {
init(viewModel: TrainingPageViewModel) {

self.viewModel = viewModel
self.contentStackView = MobileContentStackView(viewModel: viewModel, contentInsets: .zero, scrollIsEnabled: true)
self.contentStackView = MobileContentStackView(viewModel: viewModel, contentInsets: nil, scrollIsEnabled: true)

super.init(viewModel: viewModel, frame: UIScreen.main.bounds)

Expand Down

0 comments on commit bc8b788

Please sign in to comment.