fix: android monospace font (#1735)
This commit is contained in:
@@ -26,7 +26,7 @@ declare global {
|
|||||||
}
|
}
|
||||||
|
|
||||||
import { IsWebPlatform, WebAppVersion } from '@/Constants/Version'
|
import { IsWebPlatform, WebAppVersion } from '@/Constants/Version'
|
||||||
import { DesktopManagerInterface, Environment, SNLog } from '@standardnotes/snjs'
|
import { DesktopManagerInterface, Environment, Platform, SNLog } from '@standardnotes/snjs'
|
||||||
import ApplicationGroupView from './Components/ApplicationGroupView/ApplicationGroupView'
|
import ApplicationGroupView from './Components/ApplicationGroupView/ApplicationGroupView'
|
||||||
import { WebDevice } from './Application/Device/WebDevice'
|
import { WebDevice } from './Application/Device/WebDevice'
|
||||||
import { StartApplication } from './Application/Device/StartApplication'
|
import { StartApplication } from './Application/Device/StartApplication'
|
||||||
@@ -48,6 +48,15 @@ const setViewportHeight = () => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const setDefaultMonospaceFont = (platform?: Platform) => {
|
||||||
|
if (platform === Platform.Android) {
|
||||||
|
document.documentElement.style.setProperty(
|
||||||
|
'--sn-stylekit-monospace-font',
|
||||||
|
'"Roboto Mono", "Droid Sans Mono", monospace',
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const startApplication: StartApplication = async function startApplication(
|
const startApplication: StartApplication = async function startApplication(
|
||||||
defaultSyncServerHost: string,
|
defaultSyncServerHost: string,
|
||||||
device: WebOrDesktopDevice,
|
device: WebOrDesktopDevice,
|
||||||
@@ -77,12 +86,15 @@ const startApplication: StartApplication = async function startApplication(
|
|||||||
root = createRoot(appendedRootNode)
|
root = createRoot(appendedRootNode)
|
||||||
|
|
||||||
disableIosTextFieldZoom()
|
disableIosTextFieldZoom()
|
||||||
|
|
||||||
setViewportHeight()
|
setViewportHeight()
|
||||||
window.addEventListener('orientationchange', setViewportHeight)
|
window.addEventListener('orientationchange', setViewportHeight)
|
||||||
if (device.environment === Environment.Desktop) {
|
if (device.environment === Environment.Desktop) {
|
||||||
window.addEventListener('resize', setViewportHeight)
|
window.addEventListener('resize', setViewportHeight)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setDefaultMonospaceFont(device.platform)
|
||||||
|
|
||||||
root.render(
|
root.render(
|
||||||
<ApplicationGroupView
|
<ApplicationGroupView
|
||||||
key={getKey()}
|
key={getKey()}
|
||||||
|
|||||||
@@ -8,10 +8,13 @@ import {
|
|||||||
NamespacedRootKeyInKeychain,
|
NamespacedRootKeyInKeychain,
|
||||||
extendArray,
|
extendArray,
|
||||||
WebOrDesktopDeviceInterface,
|
WebOrDesktopDeviceInterface,
|
||||||
|
Platform,
|
||||||
} from '@standardnotes/snjs'
|
} from '@standardnotes/snjs'
|
||||||
import { Database } from '../Database'
|
import { Database } from '../Database'
|
||||||
|
|
||||||
export abstract class WebOrDesktopDevice implements WebOrDesktopDeviceInterface {
|
export abstract class WebOrDesktopDevice implements WebOrDesktopDeviceInterface {
|
||||||
|
platform?: Platform
|
||||||
|
|
||||||
constructor(public appVersion: string) {}
|
constructor(public appVersion: string) {}
|
||||||
|
|
||||||
private databases: Database[] = []
|
private databases: Database[] = []
|
||||||
|
|||||||
Reference in New Issue
Block a user