alignment updates
This commit is contained in:
parent
7926a8579c
commit
f610264327
@ -136,7 +136,7 @@ open class CaretButton: MFCustomButton, MVMCoreUIMoleculeViewProtocol, MVMCoreUI
|
||||
return true
|
||||
}
|
||||
|
||||
open func alignment() -> UIStackView.Alignment {
|
||||
open func horizontalAlignment() -> UIStackView.Alignment {
|
||||
return UIStackView.Alignment.leading;
|
||||
}
|
||||
|
||||
|
||||
@ -156,7 +156,7 @@
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (UIStackViewAlignment)alignment {
|
||||
- (UIStackViewAlignment)horizontalAlignment {
|
||||
return UIStackViewAlignmentLeading;
|
||||
}
|
||||
|
||||
|
||||
@ -131,7 +131,7 @@ extension CaretView: MVMCoreUIViewConstrainingProtocol {
|
||||
return true
|
||||
}
|
||||
|
||||
open func alignment() -> UIStackView.Alignment {
|
||||
open func horizontalAlignment() -> UIStackView.Alignment {
|
||||
return UIStackView.Alignment.leading;
|
||||
}
|
||||
}
|
||||
|
||||
@ -165,7 +165,7 @@ extension CheckboxWithLabelView {
|
||||
layoutIfNeeded()
|
||||
}
|
||||
|
||||
override open func alignment() -> UIStackView.Alignment {
|
||||
override open func horizontalAlignment() -> UIStackView.Alignment {
|
||||
return .leading
|
||||
}
|
||||
|
||||
|
||||
@ -598,7 +598,7 @@ extension Label {
|
||||
return true
|
||||
}
|
||||
|
||||
public func alignment() -> UIStackView.Alignment {
|
||||
public func horizontalAlignment() -> UIStackView.Alignment {
|
||||
return .leading
|
||||
}
|
||||
|
||||
|
||||
@ -193,7 +193,7 @@ const CGFloat SwitchShakeIntensity = 2;
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (UIStackViewAlignment)alignment {
|
||||
- (UIStackViewAlignment)horizontalAlignment {
|
||||
return UIStackViewAlignmentTrailing;
|
||||
}
|
||||
|
||||
|
||||
@ -217,7 +217,7 @@ public extension Container {
|
||||
}
|
||||
|
||||
if let verticalAlignmentString = json?.optionalStringForKey("verticalAlignment"), let alignment = ContainerHelper.getAlignment(for: verticalAlignmentString) ?? (view as? MVMCoreUIViewConstrainingProtocol)?.verticalAlignment?() {
|
||||
containerHelper.alignHorizontal(alignment)
|
||||
containerHelper.alignVertical(alignment)
|
||||
} else if let alignment = (view as? MVMCoreUIViewConstrainingProtocol)?.verticalAlignment?() {
|
||||
containerHelper.alignVertical(alignment)
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ static const CGFloat CheckBoxHeightWidth = 18.0;
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (UIStackViewAlignment)alignment {
|
||||
- (UIStackViewAlignment)horizontalAlignment {
|
||||
return UIStackViewAlignmentLeading;
|
||||
}
|
||||
|
||||
|
||||
@ -135,26 +135,24 @@ open class MoleculeStackView: Container {
|
||||
|
||||
// Adds the molecules and sets the json.
|
||||
for (index, map) in molecules.enumerated() {
|
||||
if let moleculeJSON = map.optionalDictionaryForKey(KeyMolecule) {
|
||||
var view: UIView?
|
||||
var stackItemModel: StackItemModel
|
||||
if let item = items?[index] {
|
||||
stackItemModel = item
|
||||
item.update(with: map)
|
||||
view = item.view
|
||||
(view as? MVMCoreUIMoleculeViewProtocol)?.setWithJSON(moleculeJSON, delegateObject: delegateObject, additionalData: nil)
|
||||
addStackItem(item, lastItem: index == molecules.count - 1)
|
||||
} else {
|
||||
let stackItem = StackItem()
|
||||
stackItem.setWithJSON(map, delegateObject: delegateObject, additionalData: additionalData)
|
||||
view = stackItem
|
||||
stackItemModel = StackItemModel(with: stackItem, json: map)
|
||||
addStackItem(stackItemModel, lastItem: index == molecules.count - 1)
|
||||
}
|
||||
|
||||
stackItemModel.useHorizontalMargins = moleculesShouldSetHorizontalMargins
|
||||
stackItemModel.useVerticalMargins = moleculesShouldSetVerticalMargins
|
||||
var view: UIView?
|
||||
var stackItemModel: StackItemModel
|
||||
if let item = items?[index] {
|
||||
stackItemModel = item
|
||||
item.update(with: map)
|
||||
view = item.view
|
||||
(view as? MVMCoreUIMoleculeViewProtocol)?.setWithJSON(map, delegateObject: delegateObject, additionalData: nil)
|
||||
addStackItem(item, lastItem: index == molecules.count - 1)
|
||||
} else {
|
||||
let stackItem = StackItem()
|
||||
stackItem.setWithJSON(map, delegateObject: delegateObject, additionalData: additionalData)
|
||||
view = stackItem
|
||||
stackItemModel = StackItemModel(with: stackItem, json: map)
|
||||
addStackItem(stackItemModel, lastItem: index == molecules.count - 1)
|
||||
}
|
||||
|
||||
stackItemModel.useHorizontalMargins = moleculesShouldSetHorizontalMargins
|
||||
stackItemModel.useVerticalMargins = moleculesShouldSetVerticalMargins
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user