mirror of
https://gitee.com/openharmony/applications_permission_manager
synced 2024-11-27 05:00:33 +00:00
折叠屏监听优化
Signed-off-by: fanchenxuan <fanchenxuan@huawei.com>
This commit is contained in:
parent
b08079fcbd
commit
9e5a2e06eb
@ -20,6 +20,7 @@ import { GlobalContext } from '../common/utils/globalContext';
|
|||||||
|
|
||||||
const TAG = 'PermissionManager_Log:';
|
const TAG = 'PermissionManager_Log:';
|
||||||
const BG_COLOR = '#00000000';
|
const BG_COLOR = '#00000000';
|
||||||
|
const DELAY = 100;
|
||||||
|
|
||||||
export default class SecurityExtensionAbility extends extension {
|
export default class SecurityExtensionAbility extends extension {
|
||||||
/**
|
/**
|
||||||
@ -99,9 +100,11 @@ export default class SecurityExtensionAbility extends extension {
|
|||||||
try {
|
try {
|
||||||
display.on('foldStatusChange', (data) => {
|
display.on('foldStatusChange', (data) => {
|
||||||
console.info(TAG + `monitor foldStatusChange: ${JSON.stringify(data)}`);
|
console.info(TAG + `monitor foldStatusChange: ${JSON.stringify(data)}`);
|
||||||
let dis = display.getDefaultDisplaySync();
|
setTimeout(() => {
|
||||||
win.resize(dis.width, dis.height);
|
let dis = display.getDefaultDisplaySync();
|
||||||
win.moveWindowTo(0, 0);
|
win.resize(dis.width, dis.height);
|
||||||
|
win.moveWindowTo(0, 0);
|
||||||
|
}, DELAY);
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(TAG + `monitor foldStatusChange failed: ${JSON.stringify(err)}`);
|
console.error(TAG + `monitor foldStatusChange failed: ${JSON.stringify(err)}`);
|
||||||
|
Loading…
Reference in New Issue
Block a user