fix: code review notes

This commit is contained in:
Nikita Semenov 2023-03-17 11:46:44 +03:00
parent f3ed27e83f
commit 4ccebe8e8b
2 changed files with 9 additions and 9 deletions

View File

@ -175,6 +175,14 @@ open class BasePlaceholderView<ImageView: UIView>: BaseInitializableView {
controlsStackView.configureUIView(appearance: appearance.controlsViewAppearance)
}
open func configureLayoutForKeyboard(_ notification: Notification, isKeyboardHidden: Bool) {
let multiplier = isKeyboardHidden ? 1.0 : -1.0
if let height = getKeyboardHeight(notification) {
controlsViewConstraints?.bottomConstraint?.constant = multiplier * height / 2
}
}
// MARK: - Private methods
private func configureImageViewLayout(layout: WrappedViewLayout) {
@ -224,14 +232,6 @@ open class BasePlaceholderView<ImageView: UIView>: BaseInitializableView {
trailingConstraint: constraints.trailingConstraint)
}
private func configureLayoutForKeyboard(_ notification: Notification, isKeyboardHidden: Bool) {
let multiplier = isKeyboardHidden ? 1.0 : -1.0
if let height = getKeyboardHeight(notification) {
controlsViewConstraints?.bottomConstraint?.constant = multiplier * height / 2
}
}
private func getKeyboardHeight(_ notification: Notification) -> CGFloat? {
guard let userInfo = notification.userInfo else {
return nil

View File

@ -51,7 +51,7 @@ public final class DefaultPlaceholderView: BasePlaceholderView<UIImageView>, App
}
if size.height.isFinite, size.height > .zero {
imageViewConstraints?.widthConstraint?.constant = size.height
imageViewConstraints?.heightConstraint?.constant = size.height
}
if size.width.isFinite, size.width > .zero {