Files
termix-mobile/app/utils/responsive.ts
T
Luke Gustafson 2fef85c35c v1.3.0 (#7)
* fix: ipad keyboard issue + paste key not wokring and disabled auto correct

* fix: ipad keyboard issues

* fix: ipad styling issues, emoji/voice dictation support, android keyboard issues

* fix: ipad styling issues

* feat: add debuging to fix ipad keyboard margins

* fix: handle physical keyboard special keys in terminal (#6)

* feat: add iPadOS build workflow without EAS dependency (#4)

* fix: handle physical keyboard special keys in terminal

Tab, Escape, and arrow keys from physical keyboards were filtered out
by the key.length === 1 check. Add explicit handling like Enter/Backspace.

* feat: add iOS native Shift+Tab support via UIKeyCommand

Add Expo native module that uses UIKeyCommand + method swizzling
to intercept Shift+Tab on iOS hardware keyboards and forward
the backtab escape sequence (\x1b[Z]) to the active terminal.

---------

Co-authored-by: swing <bestswngs@gmail.com>
Co-authored-by: Luke Gustafson <88517757+LukeGus@users.noreply.github.com>

* feat: improve ipad ui logic and improve external keyboard handling

* feat: fix arrow keys and modifier keys on hardware keybords

* fix: fix arrow keys and modifier keys on hardware keybords

* feat: add voice over support and improved terminal background conneciton

* feat: add missing files

* feat: add host key verification support

* fix: dictation issues + android IME multi character input issues on android

* fix: none auth hosts

* chore: clean

* chore: update readme

---------

Co-authored-by: ZacharyZcR <zacharyzcr1984@gmail.com>
Co-authored-by: swing <bestswngs@gmail.com>
2026-02-19 00:48:49 -06:00

46 lines
1.0 KiB
TypeScript

export function getColumnCount(
width: number,
isLandscape: boolean,
itemMinWidth: number = 300,
): number {
if (!isLandscape) return 1;
const columns = Math.floor(width / itemMinWidth);
return Math.max(2, Math.min(columns, 3));
}
export function getResponsivePadding(
isLandscape: boolean,
portraitPadding: number = 24,
): number {
return isLandscape ? portraitPadding * 0.67 : portraitPadding;
}
export function getResponsiveFontSize(
isLandscape: boolean,
baseFontSize: number,
): number {
return isLandscape ? baseFontSize * 0.9 : baseFontSize;
}
export function getMaxKeyboardHeight(
screenHeight: number,
isLandscape: boolean,
isIPad: boolean = false,
): number {
if (!isLandscape) return screenHeight;
const cap = isIPad ? 0.6 : 0.4;
return screenHeight * cap;
}
export function getTabBarHeight(isLandscape: boolean): number {
return isLandscape ? 50 : 60;
}
export function getButtonSize(
isLandscape: boolean,
portraitSize: number = 44,
): number {
return isLandscape ? portraitSize * 0.82 : portraitSize;
}