removed vertical layout & max width constraint
This commit is contained in:
parent
8f320a9363
commit
ee41a6555e
@ -54,7 +54,8 @@ open class Notification: View {
|
||||
}
|
||||
|
||||
/// Enum used to describe the orientation of Notification.
|
||||
public enum Layout: String, CaseIterable {
|
||||
/// Only horizontal orientation is supported for iPhone & iPad devices only.
|
||||
private enum Layout: String, CaseIterable {
|
||||
case vertical, horizontal
|
||||
}
|
||||
|
||||
@ -176,7 +177,8 @@ open class Notification: View {
|
||||
private var _layout: Layout = .vertical
|
||||
|
||||
/// Determines the orientation of buttons and text in the Notification.
|
||||
open var layout: Layout {
|
||||
/// Only horizontal orientation is supported for iPhone & iPad devices only.
|
||||
private var layout: Layout {
|
||||
set {
|
||||
if !UIDevice.isIPad, newValue == .horizontal { return }
|
||||
_layout = newValue
|
||||
@ -398,18 +400,18 @@ open class Notification: View {
|
||||
}
|
||||
|
||||
private func setConstraints() {
|
||||
maxWidthConstraint?.deactivate()
|
||||
labelViewAndButtonViewConstraint?.deactivate()
|
||||
labelViewBottomConstraint?.deactivate()
|
||||
buttonGroupCenterYConstraint?.deactivate()
|
||||
buttonGroupBottomConstraint?.deactivate()
|
||||
maxWidthConstraint?.constant = maxViewWidth
|
||||
maxWidthConstraint?.isActive = UIDevice.isIPad
|
||||
labelViewAndButtonViewConstraint?.isActive = layout == .vertical && !buttonGroup.buttons.isEmpty
|
||||
labelViewBottomConstraint?.isActive = layout == .horizontal || buttonGroup.buttons.isEmpty
|
||||
buttonGroupCenterYConstraint?.isActive = layout == .horizontal
|
||||
buttonGroupBottomConstraint?.isActive = layout == .vertical
|
||||
typeIconWidthConstraint?.constant = typeIcon.size.dimensions.width
|
||||
closeIconWidthConstraint?.constant = closeButton.size.dimensions.width
|
||||
//iPad 12.9 inches is more than the configured maxViewWidth(1232), verified with designer on the same. Suggested to remove max width constraint
|
||||
//maxWidthConstraint?.constant = maxViewWidth
|
||||
//maxWidthConstraint?.isActive = UIDevice.isIPad
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user