Skip to content

Show the toolbar text input and the extra keys at the same time - #5265

Open
kedimuzafer wants to merge 1 commit into
termux:masterfrom
kedimuzafer:toolbar-rework
Open

Show the toolbar text input and the extra keys at the same time#5265
kedimuzafer wants to merge 1 commit into
termux:masterfrom
kedimuzafer:toolbar-rework

Conversation

@kedimuzafer

Copy link
Copy Markdown

The terminal toolbar is a two page ViewPager: page 0 holds the extra keys, page 1 the text input.
Switching pages means swiping horizontally — but the text input consumes horizontal touches to move
the caret, so the pager only sees the swipe once the caret has reached the start of the text. With a
long line in the field, getting back to the extra keys means first scrolling the caret all the way
back. Paste a paragraph in there and it is a real chore.

This stacks both views in a vertical LinearLayout so they are visible together, with the text input
directly above the extra keys.

toolbar

TEXTBAR special key. Toggles the input row and moves focus with it, alongside the existing
KEYBOARD, DRAWER, PASTE and SCROLL keys, so its position is up to the user's extra-keys
property. It renders as .

Text input. Multi line and monospace, with hairline separators instead of the EditText
underline, which does not sit well in a terminal. Enter sends, so no send button competes for
horizontal space.

Colour scheme. The toolbar takes background and foreground from the terminal's own scheme. Key
labels were a fixed white before, so they were invisible against a light scheme — that is fixed as a
side effect.

Label sizing. Labels are sized from the row height, so lowering terminal-toolbar-height shrinks
the text with the row instead of leaving oversized labels crammed into a thin row.

Key grid. A hairline grid is drawn between keys in the same scheme derived colour.

Notes for review

I am aware this removes an existing interaction, so I understand if you would rather have it behind a
property — say the word and I will put the old paged behaviour back as the default with this as an
opt-in, or split the parts up. The colour scheme and label sizing fixes stand on their own if you
only want those.

isTerminalToolbarTextInputViewSelected() and isTerminalViewSelected() keep their meaning: the
former now reports whether the input row is visible rather than which page is current.

Tested on an Android 16 device (arm64) and an API 31 emulator (x86_64): toggling, sending, focus
handling, light and dark schemes, and terminal-toolbar-height between 0.4 and 3.

The terminal toolbar is a two page ViewPager: page 0 holds the extra keys, page
1 the text input. Switching pages means swiping horizontally, but the text input
consumes horizontal touches to move the caret, so it only sees the swipe once
the caret has reached the start of the text. With a long line in the field,
getting back to the extra keys means first scrolling all the way back.

Both views are now stacked in a vertical LinearLayout and visible together, with
the text input directly above the extra keys.

- A TEXTBAR special key toggles the input row and moves focus with it, alongside
  the existing KEYBOARD, DRAWER, PASTE and SCROLL keys, so its position is up to
  the user's extra-keys property.
- The input is multi line and monospace, with hairline separators instead of the
  EditText underline, which does not fit a terminal. Enter sends, so no send
  button competes for horizontal space.
- The toolbar takes its colours from the terminal's colour scheme. Key labels
  were a fixed white before, so they were invisible against a light scheme.
- Key labels are sized from the row height, so lowering the
  terminal-toolbar-height property shrinks the text with the row rather than
  leaving oversized labels in a thin row.
- A hairline grid is drawn between the keys, in the same scheme derived colour.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

1 participant