-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
My first commit #360
Merged
Merged
My first commit #360
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ class KeyboardViewController: UIInputViewController { | |
@IBOutlet var stackView2: UIStackView! | ||
@IBOutlet var stackView3: UIStackView! | ||
|
||
|
||
private var tipView: ToolTipView? | ||
|
||
/// Changes the height of `stackViewNum` depending on device type and size. | ||
|
@@ -1591,6 +1592,18 @@ class KeyboardViewController: UIInputViewController { | |
} catch {} | ||
} | ||
|
||
//Check if ipad device meets the criteria for expanded keyboard | ||
if DeviceType.isPad { | ||
//Check if device has home button, this will be used later to determine if we should use expanded keypad or not. | ||
if #available(iOS 13.0, *), (keyboardView.safeAreaInsets.bottom <= 0 && UIScreen.main.bounds.width > 768) { | ||
usingExpandedKeyboard = true; | ||
} | ||
else | ||
{ | ||
usingExpandedKeyboard = false; | ||
} | ||
} | ||
|
||
setKeyboard() | ||
setCommaAndPeriodKeysConditionally() | ||
setCommandBackground() | ||
|
@@ -1620,7 +1633,8 @@ class KeyboardViewController: UIInputViewController { | |
} | ||
} else { | ||
letterKeyWidth = (UIScreen.main.bounds.width - 6) / CGFloat(letterKeys[0].count) * 0.9 | ||
numSymKeyWidth = (UIScreen.main.bounds.width - 6) / CGFloat(numberKeys[0].count) * 0.9 | ||
//If we are using expanded keys the numberKeys array is empty, we use symbolKeys | ||
numSymKeyWidth = (UIScreen.main.bounds.width - 6) / CGFloat( (usingExpandedKeyboard) == true ? symbolKeys[0].count: numberKeys[0].count) * 0.9 | ||
} | ||
|
||
// Derive keyboard given current states and set widths. | ||
|
@@ -1910,7 +1924,7 @@ class KeyboardViewController: UIInputViewController { | |
} else { | ||
widthOfSpacing = ( | ||
(UIScreen.main.bounds.width - 6.0) | ||
- (CGFloat(numberKeys[0].count) * numSymKeyWidth) | ||
- (CGFloat((usingExpandedKeyboard) == true ? symbolKeys[0].count : numberKeys[0].count) * numSymKeyWidth) | ||
) / (CGFloat(letterKeys[0].count) | ||
- 1.0 | ||
) | ||
|
@@ -2454,7 +2468,8 @@ class KeyboardViewController: UIInputViewController { | |
capsLockPossible = true | ||
|
||
case "123", ".?123": | ||
changeKeyboardToNumberKeys() | ||
(usingExpandedKeyboard) == true ? changeKeyboardToSymbolKeys() : changeKeyboardToNumberKeys() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice :) |
||
|
||
|
||
case "#+=": | ||
changeKeyboardToSymbolKeys() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor note on comments, @henrikth93: when it's a full line we try to do complete sentences where we'll have a period at the end :) No stress whatsoever though!