Revert "fix: navbar overlapping with system navbar"

This reverts commit c5ba5ed311ef509bc1660cfbfae0b3665b74a1ee.
This commit is contained in:
NoCrypt 2024-08-08 13:29:23 +07:00
parent b3268e8299
commit 67b3e79c9c
5 changed files with 10 additions and 15 deletions

View file

@ -41,7 +41,7 @@
"capacitor-plugin-safe-area": "^3.0.3", "capacitor-plugin-safe-area": "^3.0.3",
"capacitor-volume-control": "^0.0.1", "capacitor-volume-control": "^0.0.1",
"common": "workspace:*", "common": "workspace:*",
"cordova-plugin-navigationbar-color": "^0.1.0", "cordova-plugin-navigationbar": "^1.0.31",
"cordova-plugin-pip": "^0.0.2", "cordova-plugin-pip": "^0.0.2",
"cordova-plugin-screen-orientation": "^3.0.4", "cordova-plugin-screen-orientation": "^3.0.4",
"es6-promise-plugin": "^4.2.2" "es6-promise-plugin": "^4.2.2"

View file

@ -1,4 +1,4 @@
/* globals NavigationBar, PictureInPicture */ /* globals navigationbar, PictureInPicture */
import { StatusBar, Style } from '@capacitor/status-bar' import { StatusBar, Style } from '@capacitor/status-bar'
import { SafeArea } from 'capacitor-plugin-safe-area' import { SafeArea } from 'capacitor-plugin-safe-area'
import { App } from '@capacitor/app' import { App } from '@capacitor/app'
@ -88,8 +88,7 @@ updateInsets()
StatusBar.setStyle({ style: Style.Dark }) StatusBar.setStyle({ style: Style.Dark })
StatusBar.setOverlaysWebView({ overlay: true }) StatusBar.setOverlaysWebView({ overlay: true })
// @ts-ignore navigationbar.setUp(true)
NavigationBar.setUp(true)
// cordova screen orientation plugin is also used, and it patches global screen.orientation.lock // cordova screen orientation plugin is also used, and it patches global screen.orientation.lock

View file

@ -2,7 +2,6 @@ import { append, element } from 'svelte/internal'
import { writable } from 'simple-store-svelte' import { writable } from 'simple-store-svelte'
import { settings } from './settings' import { settings } from './settings'
import { get } from 'svelte/store' import { get } from 'svelte/store'
import { SUPPORTS } from '@/modules/support.js'
const style = element('style') const style = element('style')
style.id = 'customThemes' style.id = 'customThemes'
@ -47,6 +46,5 @@ export function updateTheme(value) {
} else { } else {
value += NORMAL value += NORMAL
} }
if (SUPPORTS.isAndroid) window.NavigationBar.backgroundColorByHexString(get(settings).amoledTheme ? "#000000" : "#17191D")
style.textContent = `:root{${value.replace(/{|}/g, '')}}` style.textContent = `:root{${value.replace(/{|}/g, '')}}`
} }

View file

@ -108,11 +108,9 @@
isFullscreen = !!document.fullscreenElement isFullscreen = !!document.fullscreenElement
if (document.fullscreenElement) { if (document.fullscreenElement) {
window.Capacitor.Plugins.StatusBar.hide() window.Capacitor.Plugins.StatusBar.hide()
window.NavigationBar.hide()
screen.orientation.lock('landscape') screen.orientation.lock('landscape')
} else { } else {
window.Capacitor.Plugins.StatusBar.show() window.Capacitor.Plugins.StatusBar.show()
window.NavigationBar.show()
screen.orientation.unlock() screen.orientation.unlock()
} }
}) })

View file

@ -108,9 +108,9 @@ importers:
common: common:
specifier: workspace:* specifier: workspace:*
version: link:../common version: link:../common
cordova-plugin-navigationbar-color: cordova-plugin-navigationbar:
specifier: ^0.1.0 specifier: ^1.0.31
version: 0.1.0 version: 1.0.31
cordova-plugin-pip: cordova-plugin-pip:
specifier: ^0.0.2 specifier: ^0.0.2
version: 0.0.2 version: 0.0.2
@ -1913,9 +1913,9 @@ packages:
peerDependencies: peerDependencies:
webpack: ^5.1.0 webpack: ^5.1.0
cordova-plugin-navigationbar-color@0.1.0: cordova-plugin-navigationbar@1.0.31:
resolution: {integrity: sha512-O/JfdLerNc0Jcq/4nTvsW45IzojtJT0Biayl8ZKSAKtQv6U7tOLUZ1/k+dRGZnBNoQyNc5gC9Lbn6A573v9UhA==} resolution: {integrity: sha512-xt9tx5Aprf052OvuG2JohjRkkU/6U6XQ8mXOx93HaHFz6cCZI1+B0pl/uoyU/FkJsP41QIw1upnMdzgav11ifw==}
engines: {cordovaDependencies: {0.1.0: {cordova: '>=3.0.0'}, 3.0.0: {cordova: '>100'}}} engines: {'0': {name: cordova, version: '>=3.0.0'}}
cordova-plugin-pip@0.0.2: cordova-plugin-pip@0.0.2:
resolution: {integrity: sha512-Wy9aK7rQX3kif6+kUl7RwTG/+arixvW5Sphyr0bPxsVrkVIliseW/S/JhO7BVX25/HGU0lGMvQe8a134yvI9iQ==} resolution: {integrity: sha512-Wy9aK7rQX3kif6+kUl7RwTG/+arixvW5Sphyr0bPxsVrkVIliseW/S/JhO7BVX25/HGU0lGMvQe8a134yvI9iQ==}
@ -7744,7 +7744,7 @@ snapshots:
serialize-javascript: 6.0.2 serialize-javascript: 6.0.2
webpack: 5.91.0(webpack-cli@5.1.4) webpack: 5.91.0(webpack-cli@5.1.4)
cordova-plugin-navigationbar-color@0.1.0: {} cordova-plugin-navigationbar@1.0.31: {}
cordova-plugin-pip@0.0.2: {} cordova-plugin-pip@0.0.2: {}