fix(mobile): increase font sizes and other mobile-centric improvements (#1907)

This commit is contained in:
Mo
2022-11-01 11:41:40 -05:00
committed by GitHub
parent f54b017f53
commit 994f824757
72 changed files with 543 additions and 283 deletions

View File

@@ -38,7 +38,7 @@ import {
import { MobileWebReceiver, NativeMobileEventListener } from '../NativeMobileWeb/MobileWebReceiver'
import { AndroidBackHandler } from '@/NativeMobileWeb/AndroidBackHandler'
import { PrefDefaults } from '@/Constants/PrefDefaults'
import { setViewportHeightWithFallback } from '@/setViewportHeightWithFallback'
import { setCustomViewportHeight, setViewportHeightWithFallback } from '@/setViewportHeightWithFallback'
import { WebServices } from './WebServices'
export type WebEventObserver = (event: WebAppEvent, data?: unknown) => void
@@ -293,6 +293,15 @@ export class WebApplication extends SNApplication implements WebApplicationInter
void this.getThemeService().handleMobileColorSchemeChangeEvent()
}
handleMobileKeyboardWillChangeFrameEvent(frame: { height: number; contentHeight: number }): void {
setCustomViewportHeight(String(frame.contentHeight), 'px', true)
this.notifyWebEvent(WebAppEvent.MobileKeyboardWillChangeFrame, frame)
}
handleMobileKeyboardDidChangeFrameEvent(frame: { height: number; contentHeight: number }): void {
this.notifyWebEvent(WebAppEvent.MobileKeyboardDidChangeFrame, frame)
}
private async lockApplicationAfterMobileEventIfApplicable(): Promise<void> {
const isLocked = await this.isLocked()
if (isLocked) {