divvun / giellakbd-ios

Open source reimplementation of iOS keyboard with localisation support
Apache License 2.0
29 stars 5 forks source link

9" iPad issues #224

Closed snomos closed 10 months ago

snomos commented 11 months ago

image

snomos commented 11 months ago

For comparison, here's the Apple keyboard for Nynorsk:

image

And our north Sámi keyboard:

image

dylanhand commented 11 months ago

@snomos It looks like this is because some keyboards are defined to have 4 rows on 9" iPads instead of 3 (like Apple's).

For example: https://github.com/giellalt/keyboard-mdf/blob/main/mdf.kbdgen/layouts/mdf.yaml#L57-L63C99

If you want some divvun keyboards to have 4 rows instead of the standard 3, they are necessarily going to be taller and cover more of the screen than Apple's keyboards.

Was it intended to define some of these keyboards as having 4 rows on 9" iPads?

If intentional, I can look into making the keys a bit smaller in height so slightly less of the screen is covered. However this will probably only save about 50px if we want key size to stay consistent with Apple's.

snomos commented 11 months ago

The fourth row is intentional, the languages in question have pretty large alphabets. But even the north Sami keyboard (three rows) takes one more text line than a similar Apple keyboard, cf the screen shots above.

First make the key size and spacing similar to that of Apple's, and if the keyboard height still is too big we could reduce the key height iff the keyboard has four rows.

dylanhand commented 11 months ago

TL;DR:

The reason the Divvun 3-row keyboard is taller than Apple's is that we unfortunately have no way to put our spelling suggestion bar to the right of the undo/redo buttons like Apple does, so this portion of the keyboard is twice as tall to accommodate both.

The alternative to making room for our spelling suggestion bar by making the whole keyboard taller is to instead shrink all the keys to make room for it. The advantage is that it will be the same height as Apple's. The drawback is that key size will no longer be consistent with Apple's which may be off-putting for users used to the built-in keyboard.

When put side-by-side, our 3-row keyboard is just barely taller at the top of the third row of keys, approx 4-6px. So while our keys aren't exactly the same size as Apple's they're close enough that changing them won't be very noticeable.

CleanShot 2023-10-16 at 14 15 26@2x

Our 4-row keyboard however does seem a little stretched, so I can look into what's causing that. It looks like fixing key height of the 4-row keyboard will buy us about 20 pixels.

CleanShot 2023-10-16 at 14 19 15@2x

snomos commented 11 months ago

3-row keyboard: it is the totality of three differences compared to Apple's:

All this makes our keyboards look quite different from Apple's. Less balanced, less well proportioned.

IIRC this now only happens on the 9" iPad in landscape mode. Your earlier changes fixed all of this in other cases.

dylanhand commented 11 months ago

I pushed a build that shrinks 5+ row keyboards on 9" iPads by 50px. The result is our keys are slighly smaller than Apple's but I think it's not so much that it'll be off-putting. Have a look and let me know what you think. I haven't yet fixed the font size and other things - want to get the height right first.

Here's a screenshot that shows how the updated keyboard compares to Apple's and the original Divvun keyboard:

CleanShot-2023-10-17-at-16 13 432x
snomos commented 11 months ago

Much better!

dylanhand commented 11 months ago

Great! Will work on fonts and spacing next and we can always tweak the height if needed.

snomos commented 11 months ago

Font size looks great now, as well as overall keyboard height. But key size and spacing between keys is still quite different from Apple's, at least on my 9" iPad.

snomos commented 11 months ago

Here's what it looks like on my iPad (north Sámi to the left, Apple Norwegian to the right, build 162):

image

dylanhand commented 10 months ago

Just pushed a build that increases horizontal spacing on 9" iPads to match that of Apple's and adds a little more corner radius to match Apple's as well.

snomos commented 10 months ago

I think it looks great now. I consider the key size and spacing fixed. Cf the following screenshot with SMA to the left and NNO to the right:

image

For comparison, the full version of SMA:

image

And the full version of NNO:

image

dylanhand commented 10 months ago

Great :)

The last item remaining is height. The height of the keyboard is currently the same except for the extra space required for the spelling suggestion bar. Our options are:

  1. Keep as is now. Keys are similar height to Apple's but our keyboard is slightly taller due to spelling suggestion bar.
  2. Make height exactly the same as Apple's. This will result in keys being shorter than Apple's to make room for spelling suggestion bar.
snomos commented 10 months ago

There is a third variant: make the height something between 1. and 2. in your list. That is, make the keys shorter, but not as much, maybe half of what option 2. would give. That would probably keep the proportions ok, and at the same time give us some more vertical space.

But maybe try option 2. first, ie make the total height about the same as Apple's, and see how bad or good that is.

dylanhand commented 10 months ago

Here's a screenshot of option 2 - having the keyboard the same height as Apple's but with scrunched keys:

IMG_0160

Here it is next to Apple's:

IMG_0162

snomos commented 10 months ago

Option 2 looks good! We'll try that one, and let more people test 🙂

dylanhand commented 10 months ago

Ok I just pushed a build with those changes. I also adjusted the space of the key and alt key label so they don't overlap. You'll see that keys are quite a bit smaller than the native keyboards, but take it for a spin and let me know what you think.

snomos commented 10 months ago

So far the adjusted height feels and looks like an improvement. One thing is still not fixed regarding keyboard height: the four row ones. Cf the following screenshot, with SMS to the left, and SMA to the right:

image

dylanhand commented 10 months ago

Here's a slightly shorter 4-row keyboard. Is this more what you had in mind? If not please let me know how you'd like it to look.

IMG_0165

snomos commented 10 months ago

It does not look much shorter, on the contrary: if you imagine removing the suggestion line, the top of the keyboard should be along the top of the Apple keyboard to the right. But there is more to remove on the left than just the suggestions.

Another test: The top of the third row from the bottom (the one starting with 'a') on the Apple keyboard hits the mid of the keys on the fourth row to the left in the screen shot four comments back. In your latest screen shot above it does not.

All in all, it does not look shorter 🙂

dylanhand commented 10 months ago

Ok, I understand how you'd like it to look. I purposely didn't remove that much because, since this keyboard has an extra row, that will make keys quite small. Will shorten even more and push a build soon.

snomos commented 10 months ago

Mm, it is all about finding the correct balance between key height and overall keyboard height 🙂

dylanhand commented 10 months ago

It's been updated so the top of the keys meet the top of the keys on Apple's keyboard. Pushing a build now.

IMG_417FBD2E80E5-1

snomos commented 10 months ago

Thanks for the update @dylanhand, this hits the right balance between key size and keyboard height for the keyboards with an extra row 🙂

dylanhand commented 10 months ago

Great! This can be closed then?

snomos commented 10 months ago

Yes, this can be closed.