Skip to content

Added Arabic keyboard layout - #13

Open
k-alnuaimi wants to merge 1 commit into
lightphone:mainfrom
k-alnuaimi:feat/arabic-layout
Open

Added Arabic keyboard layout#13
k-alnuaimi wants to merge 1 commit into
lightphone:mainfrom
k-alnuaimi:feat/arabic-layout

Conversation

@k-alnuaimi

Copy link
Copy Markdown

Adds a standard Arabic layout alongside the English ones, plus the plumbing an RTL, caseless language needs:

  • Layout gains a layoutDirection, applied by Lp3Keyboard. The Arabic letter rows and backspace render right-to-left; digits, paired symbols and the utility row stay left-to-right.
  • Lp3BaseViewModel holds the shared viewmodel logic, with the number, symbol and emoji layers and long-press alternates as parameters. EnBaseViewModel keeps its signature and fills in the EnShared ones.
  • Rows 1 and 2 are the standard Arabic rows truncated to 10 keys, so those 20 keys keep their usual positions. The letters that fall off the ends join row 3, which has 8 keys since Arabic needs no shift. Hamza forms, ة and ى are on long-press.
  • Number layer keeps Western digits with Arabic punctuation (، ؛ ؟).
  • back_lp3 and return_lp3 are autoMirrored, and MultiLabelKey pins its label to LTR so "#+=" doesn't render reversed.

The sample app's text field now follows the active layout's direction.

Adds a standard Arabic layout alongside the English ones, plus the
plumbing an RTL, caseless language needs:

- Layout gains a layoutDirection, applied by Lp3Keyboard. The Arabic
  letter rows and backspace render right-to-left; digits, paired
  symbols and the utility row stay left-to-right.
- Lp3BaseViewModel holds the shared viewmodel logic, with the number,
  symbol and emoji layers and long-press alternates as parameters.
  EnBaseViewModel keeps its signature and fills in the EnShared ones.
- Rows 1 and 2 are the standard Arabic rows truncated to 10 keys, so
  those 20 keys keep their usual positions. The letters that fall off
  the ends join row 3, which has 8 keys since Arabic needs no shift.
  Hamza forms, ة and ى are on long-press.
- Number layer keeps Western digits with Arabic punctuation (، ؛ ؟).
- back_lp3 and return_lp3 are autoMirrored, and MultiLabelKey pins its
  label to LTR so "#+=" doesn't render reversed.

The sample app's text field now follows the active layout's direction.
@dupontgu

Copy link
Copy Markdown
Contributor

thank you for this!! Gonna take a look Friday/early next week

@dupontgu dupontgu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again for doing this. Technically I think it's perfect, but I got some feedback from a user that the keys were in the opposite order from right to left than they would expect. Does that ring true? I don't think it would be a difficult change. Here's the implementation from this PR vs. a Gboard screenshot:

Image Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants