Skip to content

Commit

Permalink
fix(ios): eliminate circular logging reference in initKeyboardSize()
Browse files Browse the repository at this point in the history
  • Loading branch information
sgschantz committed Dec 7, 2024
1 parent b4fb78a commit 51d568a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ private class CustomInputView: UIInputView, UIInputViewAudioFeedback {
kbdWidthConstraint.priority = .defaultHigh
kbdWidthConstraint.isActive = true

let bannerHeight = InputViewController.topBarHeight
self.buildKeyboardHeightConstraints(bannerHeight: InputViewController.topBarHeight)
}

Expand Down Expand Up @@ -182,7 +181,7 @@ open class InputViewController: UIInputViewController, KeymanWebDelegate {
}

var expandedHeight: CGFloat {
return keymanWeb.keyboardHeight + InputViewController.topBarHeight
return keymanWeb.keyboardSize.height + InputViewController.topBarHeight
}

public convenience init() {
Expand Down Expand Up @@ -533,7 +532,7 @@ open class InputViewController: UIInputViewController, KeymanWebDelegate {
}

public var kmwHeight: CGFloat {
return keymanWeb.keyboardHeight
return keymanWeb.keyboardSize.height
}

func clearModel() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -696,9 +696,9 @@ extension KeymanWebViewController: KeymanWebDelegate {
// MARK: - Manage views
extension KeymanWebViewController {
// MARK: - Sizing
public var keyboardHeight: CGFloat {
return keyboardSize.height
}
// public var keyboardHeight: CGFloat {
// return keyboardSize.height
// }

@objc func menuKeyHeld(_ keymanWeb: KeymanWebViewController) {
self.delegate?.menuKeyHeld(self)
Expand Down Expand Up @@ -735,9 +735,9 @@ extension KeymanWebViewController {
return keyboardHeight;
}

var keyboardWidth: CGFloat {
return keyboardSize.width
}
// var keyboardWidth: CGFloat {
// return keyboardSize.width
// }

func initKeyboardSize() {
var width: CGFloat
Expand All @@ -747,11 +747,11 @@ extension KeymanWebViewController {

if Util.isSystemKeyboard {
height = constraintTargetHeight(isPortrait: InputViewController.isPortrait)
let message = "initKeyboardSize(), for system keyboard, keyboardHeight: \(keyboardHeight)"
let message = "initKeyboardSize(), for system keyboard, height: \(height)"
os_log("%{public}s", log:KeymanEngineLogger.ui, type: .info, message)
} else {
height = constraintTargetHeight(isPortrait: UIDevice.current.orientation.isPortrait)
let message = "initKeyboardSize(), for in-app keyboard, keyboardHeight: \(keyboardHeight)"
let message = "initKeyboardSize(), for in-app keyboard, height: \(height)"
os_log("%{public}s", log:KeymanEngineLogger.ui, type: .info, message)
}

Expand Down Expand Up @@ -784,6 +784,7 @@ extension KeymanWebViewController {
}
}

/*
@objc func resizeDelay() {
// + 1000 to work around iOS bug with resizing on landscape orientation. Technically we only
// need this for landscape but it doesn't hurt to do it with both. 1000 is a big number that
Expand All @@ -792,7 +793,8 @@ extension KeymanWebViewController {
let kbHeight = keyboardHeight
view.frame = CGRect(x: 0.0, y: 0.0, width: kbWidth, height: kbHeight + 1000)
}

*/

// Keyman interaction
func resizeKeyboard() {
fixLayout()
Expand Down

0 comments on commit 51d568a

Please sign in to comment.