-
Notifications
You must be signed in to change notification settings - Fork 79
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
#362 Changed the expanded keyboard for more languages #397
#362 Changed the expanded keyboard for more languages #397
Conversation
Added shift keys and changed some sizing. I am not able to test it for all languages for some reason. Will work more on this
Added Italia back to the setting and made it take effect if we are NOT using expanded keyboard
Thank you for the pull request!The Scribe team will do our best to address your contribution as soon as we can. The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :) If you're not already a member of our public Matrix community, please consider joining! We'd suggest using Element as your Matrix client, and definitely join the General and iOS rooms once you're in. It'd be great to have you! Maintainer checklist
|
scalarCapsLockKeyWidth = (disableAccentCharacters && keyboardState != .symbols) ? 2.0 : 1.2 | ||
scalarSpecialKeysWidth = (disableAccentCharacters && keyboardState != .symbols) ? 2.2 : 1.0 | ||
scalarReturnKeyWidth = (disableAccentCharacters && keyboardState != .symbols) ? 1.7 : 1.3 | ||
//scalarReturnKeyWidth = 1.3 | ||
scalarShiftKeyWidth = 1.8 | ||
case "German", "Swedish": | ||
scalarCapsLockKeyWidth = 1.8 | ||
scalarReturnKeyWidth = 1.3 | ||
scalarSpecialKeysWidth = (disableAccentCharacters && keyboardState != .symbols) ? 2.2 : 1.0 | ||
scalarReturnKeyWidth = (disableAccentCharacters && keyboardState != .symbols) ? 2.2 : 1.0 | ||
case "French": | ||
scalarCapsLockKeyWidth = 1.2 | ||
scalarReturnKeyWidth = (disableAccentCharacters && keyboardState != .symbols) ? 1.4 : 1.0 | ||
scalarShiftKeyWidth = 1.8 | ||
case "Italian": | ||
scalarSpecialKeysWidth = (disableAccentCharacters && keyboardState != .symbols) ? 2.2 : 1.0 | ||
scalarReturnKeyWidth = (disableAccentCharacters && keyboardState != .symbols) ? 1.5 : 1.0 | ||
scalarCapsLockKeyWidth = 1.3 | ||
scalarShiftKeyWidth = 1.8 | ||
default: | ||
scalarSpecialKeysWidth = (disableAccentCharacters && keyboardState != .symbols) ? 2.2 : 1.0 | ||
scalarReturnKeyWidth = (disableAccentCharacters && keyboardState != .symbols) ? 2.2 : 1.0 | ||
} | ||
//scalarSpecialKeysWidth = (disableAccentCharacters && keyboardState != .symbols) ? 2.2 : 1.0 | ||
//scalarReturnKeyWidth = (disableAccentCharacters && keyboardState != .symbols) ? 2.2 : 1.0 |
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.
nit - Would it make sense to already check (disableAccentCharacters && keyboardState != .symbols)
just once before and then simply use the boolean result in the switch
statement? The boolean statements for the ternary operators here are simply repeated really.
OR..
(can most definitely be a TODO for later but..) would it be possible to abstract the logic for the values to the specific language somewhere else? So that only something like the below is possible with no switch
statement needed?
scalarCapsLockKeyWidth = currentLanguage.scalarCapsLockKeyWidth
scalarReturnKeyWidth = currentLanguage.scalarReturnKeyWidth
scalarSpecialKeysWidth = currentLanguage.scalarSpecialKeysWidth
scalarReturnKeyWidth = currentLanguage.scalarReturnKeyWidth
Scribe-iOS isn't my domain, so let me know if I'm talking crazy 😆
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.
Either sounds good to me! What are your thoughts on this, @henrikth93?
And all of Scribe is your domain, @wkyoshida 😊🤗
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.
I think Will's idea of abstracting it is good, and that is something I can try and solve. @wkyoshida I am not sure I understand what you mean regarding the ternary operators, but do you mean that just checking the statement once would be less consuming? To tell the truth, my understanding of ternary operators and what they do under the hood is lacking.
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.
@wkyoshida @andrewtavis I think the logic for setting the values could be moved to interfacevariables maybe
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.
Hey! 👋
I am not sure I understand what you mean regarding the ternary operators, but do you mean that just checking the statement once would be less consuming?
Oh no, not really 😄 I just meant that since the boolean statements for them is the same, could just write it once, store the result in a variable, then consult the variable in each ternary. It's really just more of a visual suggestion to declutter the code a bit to make it more visually clean - that's all.
Also, regarding the abstraction - I'm good with leaving it for another PR, so no stress (unless you'd really like to tackle it here already, then by all means 😄)
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.
Happy to move that to a new PR/issue or have it be committed here. @henrikth93, let me know which one you'd prefer and I'll get to the review soon if we're leaving as is 😊
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.
Let us move that to a new issue! :)
Using a boolean instead of the expression directly
af9e726 removes the code that was commented out and also adds a char to Spanish and Swedish in one row as they had less than the others. Big thing that I'm realizing is that the Russian keyboard is automatically crashing at this point, but then this is the case on main as well 🤦♂️ I'll take a look at it. @henrikth93, as a final commit for this, do you want to change it so that the right shift key takes up the whole of the extra space as is done on the system German keyboard? See below: I think that this would be the easiest way of figuring this all out 😊 |
Added right shift variables
…om/henrikth93/Scribe-iOS into henrikth93-orientation-reload-keys
Looking into this now and making a checklist for myself to confirm that the UI is ready for things:
|
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.
Approved and on to the next issue! 🥳🚀
63d5ce1 has all kinds of changes coming through:
- I simplified how expanded keyboards are laid out such that we always have the same number of keys per row for all languages
- Just felt it was easier than going in and adding all the padding
- We can do this later if there's a demand
- This included some general resizing of the special keys
- There was a bug that brome the Russian keyboard where
ussianKeyboardConstants.symbolKeysPadExpanded
was assigned toletterKeys
rather thansymbolKeys
- I made the height of expanded keyboards a bit larger
- The vertical space between the keys on expanded keyboards was decreased
- I removed the menu option for putting a period and a comma on the letter keys if the user is on an iPad
- Lots of keys were added across all keyboards 😊
Thanks so much for your dedication in working on this, @henrikth93! Really so great to have this finalized 🙌
Contributor checklist
Description
Related issue