Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
a0c26749
D
Docs
项目概览
OpenHarmony
/
Docs
大约 1 年 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
a0c26749
编写于
10月 27, 2022
作者:
W
wusongqing
提交者:
Gitee
10月 27, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
correct grammar errors in console.error and console.log
Signed-off-by:
N
wusongqing
<
wusongqing@huawei.com
>
上级
14a72706
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
64 addition
and
64 deletion
+64
-64
zh-cn/application-dev/reference/apis/js-apis-screen.md
zh-cn/application-dev/reference/apis/js-apis-screen.md
+64
-64
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-screen.md
浏览文件 @
a0c26749
...
@@ -42,10 +42,10 @@ getAllScreens(callback: AsyncCallback<Array<Screen>>): void
...
@@ -42,10 +42,10 @@ getAllScreens(callback: AsyncCallback<Array<Screen>>): void
let
screenClass
=
null
;
let
screenClass
=
null
;
screen
.
getAllScreens
((
err
,
data
)
=>
{
screen
.
getAllScreens
((
err
,
data
)
=>
{
if
(
err
.
code
)
{
if
(
err
.
code
)
{
console
.
error
(
'
Failed to get all screens
. Cause:
'
+
JSON
.
stringify
(
err
));
console
.
error
(
'
Failed to get all screens. Cause:
'
+
JSON
.
stringify
(
err
));
return
;
return
;
}
}
console
.
info
(
'
Succeeded in getting all screens
. Data:
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
Succeeded in getting all screens. Data:
'
+
JSON
.
stringify
(
data
));
screenClass
=
data
[
0
];
screenClass
=
data
[
0
];
});
});
```
```
...
@@ -79,9 +79,9 @@ let screenClass = null;
...
@@ -79,9 +79,9 @@ let screenClass = null;
let
promise
=
screen
.
getAllScreens
();
let
promise
=
screen
.
getAllScreens
();
promise
.
then
((
data
)
=>
{
promise
.
then
((
data
)
=>
{
screenClass
=
data
[
0
];
screenClass
=
data
[
0
];
console
.
log
(
'
Succeeded in getting all screens
. Data:
'
+
JSON
.
stringify
(
data
));
console
.
log
(
'
Succeeded in getting all screens. Data:
'
+
JSON
.
stringify
(
data
));
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
log
(
'
Failed to get all screens
. Cause:
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
Failed to get all screens. Cause:
'
+
JSON
.
stringify
(
err
));
});
});
```
```
...
@@ -105,7 +105,7 @@ on(eventType: 'connect' | 'disconnect' | 'change', callback: Callback<number&
...
@@ -105,7 +105,7 @@ on(eventType: 'connect' | 'disconnect' | 'change', callback: Callback<number&
```
js
```
js
try
{
try
{
let
callback
=
(
data
)
=>
{
let
callback
=
(
data
)
=>
{
console
.
info
(
'
Register
the callback for screen changes. Data:
'
+
JSON
.
stringify
(
data
))
console
.
info
(
'
Succeeded in registering
the callback for screen changes. Data:
'
+
JSON
.
stringify
(
data
))
};
};
screen
.
on
(
'
connect
'
,
callback
);
screen
.
on
(
'
connect
'
,
callback
);
}
catch
(
exception
)
{
}
catch
(
exception
)
{
...
@@ -133,7 +133,7 @@ off(eventType: 'connect' | 'disconnect' | 'change', callback?: Callback<numbe
...
@@ -133,7 +133,7 @@ off(eventType: 'connect' | 'disconnect' | 'change', callback?: Callback<numbe
```
js
```
js
try
{
try
{
let
callback
=
(
data
)
=>
{
let
callback
=
(
data
)
=>
{
console
.
info
(
'
Unregister
the callback for screen changes. Data:
'
+
JSON
.
stringify
(
data
))
console
.
info
(
'
Succeeded in unregistering
the callback for screen changes. Data:
'
+
JSON
.
stringify
(
data
))
};
};
screen
.
off
(
'
connect
'
,
callback
);
screen
.
off
(
'
connect
'
,
callback
);
}
catch
(
exception
)
{
}
catch
(
exception
)
{
...
@@ -171,14 +171,14 @@ try {
...
@@ -171,14 +171,14 @@ try {
let
groupId
=
null
;
let
groupId
=
null
;
screen
.
makeExpand
([{
screenId
:
0
,
startX
:
0
,
startY
:
0
},
{
screenId
:
1
,
startX
:
1080
,
startY
:
0
}],
(
err
,
data
)
=>
{
screen
.
makeExpand
([{
screenId
:
0
,
startX
:
0
,
startY
:
0
},
{
screenId
:
1
,
startX
:
1080
,
startY
:
0
}],
(
err
,
data
)
=>
{
if
(
err
.
code
)
{
if
(
err
.
code
)
{
console
.
error
(
'
Failed to
make screens as expand-
screen. Code:
'
+
JSON
.
stringify
(
err
));
console
.
error
(
'
Failed to
expand the
screen. Code:
'
+
JSON
.
stringify
(
err
));
return
;
return
;
}
}
groupId
=
data
;
groupId
=
data
;
console
.
info
(
'
Succeeded in
making screens as expand-
screen. Data:
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
Succeeded in
expanding the
screen. Data:
'
+
JSON
.
stringify
(
data
));
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
Failed to
make screens as expand-
screen. Code:
'
+
JSON
.
stringify
(
exception
));
console
.
error
(
'
Failed to
expand the
screen. Code:
'
+
JSON
.
stringify
(
exception
));
};
};
```
```
...
@@ -215,12 +215,12 @@ makeExpand(options:Array<ExpandOption>): Promise<number>
...
@@ -215,12 +215,12 @@ makeExpand(options:Array<ExpandOption>): Promise<number>
```
js
```
js
try
{
try
{
screen
.
makeExpand
([{
screenId
:
0
,
startX
:
0
,
startY
:
0
},
{
screenId
:
1
,
startX
:
1080
,
startY
:
0
}]).
then
((
data
)
=>
{
screen
.
makeExpand
([{
screenId
:
0
,
startX
:
0
,
startY
:
0
},
{
screenId
:
1
,
startX
:
1080
,
startY
:
0
}]).
then
((
data
)
=>
{
console
.
info
(
'
Succeeded in
making screens as expand-
screen. Data:
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
Succeeded in
expanding the
screen. Data:
'
+
JSON
.
stringify
(
data
));
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
error
(
'
Failed to
make screens as expand-
screen. Code:
'
+
JSON
.
stringify
(
err
));
console
.
error
(
'
Failed to
expand the
screen. Code:
'
+
JSON
.
stringify
(
err
));
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
Failed to
make screens as expand-
screen. Code:
'
+
JSON
.
stringify
(
exception
));
console
.
error
(
'
Failed to
expand the
screen. Code:
'
+
JSON
.
stringify
(
exception
));
};
};
```
```
...
@@ -256,13 +256,13 @@ let mirrorScreenIds = [1, 2, 3];
...
@@ -256,13 +256,13 @@ let mirrorScreenIds = [1, 2, 3];
try
{
try
{
screen
.
makeMirror
(
mainScreenId
,
mirrorScreenIds
,
(
err
,
data
)
=>
{
screen
.
makeMirror
(
mainScreenId
,
mirrorScreenIds
,
(
err
,
data
)
=>
{
if
(
err
.
code
)
{
if
(
err
.
code
)
{
console
.
error
(
'
Failed to
make screens as mirror-screen
. Code:
'
+
JSON
.
stringify
(
err
));
console
.
error
(
'
Failed to
set screen mirroring
. Code:
'
+
JSON
.
stringify
(
err
));
return
;
return
;
}
}
console
.
info
(
'
Succeeded in
making screens as mirror-screen
. Data:
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
Succeeded in
setting screen mirroring
. Data:
'
+
JSON
.
stringify
(
data
));
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
Failed to
make screens as mirror-screen
. Code:
'
+
JSON
.
stringify
(
exception
));
console
.
error
(
'
Failed to
set screen mirroring
. Code:
'
+
JSON
.
stringify
(
exception
));
};
};
```
```
...
@@ -302,12 +302,12 @@ let mainScreenId = 0;
...
@@ -302,12 +302,12 @@ let mainScreenId = 0;
let
mirrorScreenIds
=
[
1
,
2
,
3
];
let
mirrorScreenIds
=
[
1
,
2
,
3
];
try
{
try
{
screen
.
makeMirror
(
mainScreenId
,
mirrorScreenIds
).
then
((
data
)
=>
{
screen
.
makeMirror
(
mainScreenId
,
mirrorScreenIds
).
then
((
data
)
=>
{
console
.
info
(
'
Succeeded in
making screens as mirror-screen
. Data:
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
Succeeded in
setting screen mirroring
. Data:
'
+
JSON
.
stringify
(
data
));
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
error
(
'
Failed to
make screens as mirror-screen
. Code:
'
+
JSON
.
stringify
(
err
));
console
.
error
(
'
Failed to
set screen mirroring
. Code:
'
+
JSON
.
stringify
(
err
));
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
Failed to
make screens as mirror-screen
. Code:
'
+
JSON
.
stringify
(
exception
));
console
.
error
(
'
Failed to
set screen mirroring
. Code:
'
+
JSON
.
stringify
(
exception
));
};
};
```
```
...
@@ -349,14 +349,14 @@ try {
...
@@ -349,14 +349,14 @@ try {
surfaceId
:
''
surfaceId
:
''
},
(
err
,
data
)
=>
{
},
(
err
,
data
)
=>
{
if
(
err
.
code
)
{
if
(
err
.
code
)
{
console
.
error
(
'
Failed to create virtual screen. Code:
'
+
JSON
.
stringify
(
err
));
console
.
error
(
'
Failed to create
the
virtual screen. Code:
'
+
JSON
.
stringify
(
err
));
return
;
return
;
}
}
screenClass
=
data
;
screenClass
=
data
;
console
.
info
(
'
Succeeded in creating virtual screen. Data:
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
Succeeded in creating
the
virtual screen. Data:
'
+
JSON
.
stringify
(
data
));
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
Failed to create virtual screen. Code:
'
+
JSON
.
stringify
(
exception
));
console
.
error
(
'
Failed to create
the
virtual screen. Code:
'
+
JSON
.
stringify
(
exception
));
};
};
```
```
...
@@ -403,12 +403,12 @@ try {
...
@@ -403,12 +403,12 @@ try {
surfaceId
:
''
surfaceId
:
''
}).
then
((
data
)
=>
{
}).
then
((
data
)
=>
{
screenClass
=
data
;
screenClass
=
data
;
console
.
info
(
'
Succeeded in creating virtual screen. Data:
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
Succeeded in creating
the
virtual screen. Data:
'
+
JSON
.
stringify
(
data
));
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
error
(
'
Failed to create virtual screen. Code:
'
+
JSON
.
stringify
(
err
));
console
.
error
(
'
Failed to create
the
virtual screen. Code:
'
+
JSON
.
stringify
(
err
));
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
Failed to create virtual screen. Code:
'
+
JSON
.
stringify
(
exception
));
console
.
error
(
'
Failed to create
the
virtual screen. Code:
'
+
JSON
.
stringify
(
exception
));
};
};
```
```
...
@@ -442,13 +442,13 @@ let screenId = 1;
...
@@ -442,13 +442,13 @@ let screenId = 1;
try
{
try
{
screen
.
destroyVirtualScreen
(
screenId
,
(
err
,
data
)
=>
{
screen
.
destroyVirtualScreen
(
screenId
,
(
err
,
data
)
=>
{
if
(
err
.
code
)
{
if
(
err
.
code
)
{
console
.
error
(
'
Failed to destroy virtual screen. Code:
'
+
JSON
.
stringify
(
err
));
console
.
error
(
'
Failed to destroy
the
virtual screen. Code:
'
+
JSON
.
stringify
(
err
));
return
;
return
;
}
}
console
.
info
(
'
Succeeded in destroying virtual screen.
'
);
console
.
info
(
'
Succeeded in destroying
the
virtual screen.
'
);
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
Failed to destroy virtual screen. Code:
'
+
JSON
.
stringify
(
exception
));
console
.
error
(
'
Failed to destroy
the
virtual screen. Code:
'
+
JSON
.
stringify
(
exception
));
};
};
```
```
...
@@ -486,12 +486,12 @@ destroyVirtualScreen(screenId:number): Promise<void>
...
@@ -486,12 +486,12 @@ destroyVirtualScreen(screenId:number): Promise<void>
let
screenId
=
1
;
let
screenId
=
1
;
try
{
try
{
screen
.
destroyVirtualScreen
(
screenId
).
then
((
data
)
=>
{
screen
.
destroyVirtualScreen
(
screenId
).
then
((
data
)
=>
{
console
.
info
(
'
Succeeded in destroying virtual screen.
'
);
console
.
info
(
'
Succeeded in destroying
the
virtual screen.
'
);
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
error
(
'
Failed to destroy virtual screen. Code:
'
+
JSON
.
stringify
(
err
));
console
.
error
(
'
Failed to destroy
the
virtual screen. Code:
'
+
JSON
.
stringify
(
err
));
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
Failed to destroy virtual screen. Code:
'
+
JSON
.
stringify
(
exception
));
console
.
error
(
'
Failed to destroy
the
virtual screen. Code:
'
+
JSON
.
stringify
(
exception
));
};
};
```
```
...
@@ -529,13 +529,13 @@ let surfaceId = '2048';
...
@@ -529,13 +529,13 @@ let surfaceId = '2048';
try
{
try
{
screen
.
setVirtualScreenSurface
(
screenId
,
surfaceId
,
(
err
,
data
)
=>
{
screen
.
setVirtualScreenSurface
(
screenId
,
surfaceId
,
(
err
,
data
)
=>
{
if
(
err
.
code
)
{
if
(
err
.
code
)
{
console
.
error
(
'
Failed to
Set
surface for the virtual screen. Code:
'
+
JSON
.
stringify
(
err
));
console
.
error
(
'
Failed to
set the
surface for the virtual screen. Code:
'
+
JSON
.
stringify
(
err
));
return
;
return
;
}
}
console
.
info
(
'
Succeeded in setting surface for the virtual screen.
'
);
console
.
info
(
'
Succeeded in setting
the
surface for the virtual screen.
'
);
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
Failed to
Set
surface for the virtual screen. Code:
'
+
JSON
.
stringify
(
exception
));
console
.
error
(
'
Failed to
set the
surface for the virtual screen. Code:
'
+
JSON
.
stringify
(
exception
));
};
};
```
```
...
@@ -577,12 +577,12 @@ let screenId = 1;
...
@@ -577,12 +577,12 @@ let screenId = 1;
let
surfaceId
=
'
2048
'
;
let
surfaceId
=
'
2048
'
;
try
{
try
{
screen
.
setVirtualScreenSurface
(
screenId
,
surfaceId
).
then
((
data
)
=>
{
screen
.
setVirtualScreenSurface
(
screenId
,
surfaceId
).
then
((
data
)
=>
{
console
.
info
(
'
Succeeded in setting surface for the virtual screen.
'
);
console
.
info
(
'
Succeeded in setting
the
surface for the virtual screen.
'
);
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
error
(
'
Failed to
Set
surface for the virtual screen. Code:
'
+
JSON
.
stringify
(
err
));
console
.
error
(
'
Failed to
set the
surface for the virtual screen. Code:
'
+
JSON
.
stringify
(
err
));
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
Failed to
Set
surface for the virtual screen. Code:
'
+
JSON
.
stringify
(
exception
));
console
.
error
(
'
Failed to
set the
surface for the virtual screen. Code:
'
+
JSON
.
stringify
(
exception
));
};
};
```
```
...
@@ -604,9 +604,9 @@ isScreenRotationLocked(): Promise<boolean>
...
@@ -604,9 +604,9 @@ isScreenRotationLocked(): Promise<boolean>
```
js
```
js
screen
.
isScreenRotationLocked
().
then
((
isLocked
)
=>
{
screen
.
isScreenRotationLocked
().
then
((
isLocked
)
=>
{
console
.
info
(
'
Succeeded in getting screen rotation lock status. isLocked:
'
+
JSON
.
stringify
(
isLocked
));
console
.
info
(
'
Succeeded in getting
the
screen rotation lock status. isLocked:
'
+
JSON
.
stringify
(
isLocked
));
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
error
(
'
Failed to get screen rotation lock status. Cause:
'
+
JSON
.
stringify
(
err
));
console
.
error
(
'
Failed to get
the
screen rotation lock status. Cause:
'
+
JSON
.
stringify
(
err
));
});
});
```
```
...
@@ -629,10 +629,10 @@ isScreenRotationLocked(callback: AsyncCallback<boolean>): void
...
@@ -629,10 +629,10 @@ isScreenRotationLocked(callback: AsyncCallback<boolean>): void
```
js
```
js
screen
.
isScreenRotationLocked
((
err
,
isLocked
)
=>
{
screen
.
isScreenRotationLocked
((
err
,
isLocked
)
=>
{
if
(
err
.
code
)
{
if
(
err
.
code
)
{
console
.
error
(
'
Failed to get screen rotation lock status. Cause:
'
+
JSON
.
stringify
(
err
));
console
.
error
(
'
Failed to get
the
screen rotation lock status. Cause:
'
+
JSON
.
stringify
(
err
));
return
;
return
;
}
}
console
.
info
(
'
Succeeded in getting screen rotation lock status. isLocked:
'
+
JSON
.
stringify
(
isLocked
));
console
.
info
(
'
Succeeded in getting
the
screen rotation lock status. isLocked:
'
+
JSON
.
stringify
(
isLocked
));
});
});
```
```
...
@@ -662,12 +662,12 @@ setScreenRotationLocked(isLocked: boolean): Promise<void>
...
@@ -662,12 +662,12 @@ setScreenRotationLocked(isLocked: boolean): Promise<void>
let
isLocked
=
false
;
let
isLocked
=
false
;
try
{
try
{
screen
.
setScreenRotationLocked
(
isLocked
).
then
((
data
)
=>
{
screen
.
setScreenRotationLocked
(
isLocked
).
then
((
data
)
=>
{
console
.
info
(
'
Succeeded in
setting whether to lock screen rotation
'
);
console
.
info
(
'
Succeeded in
unlocking auto rotate
'
);
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
error
(
'
Failed to
set whether to lock screen rotation
. Code:
'
+
JSON
.
stringify
(
err
));
console
.
error
(
'
Failed to
unlock auto rotate
. Code:
'
+
JSON
.
stringify
(
err
));
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
Failed to
set whether to lock screen rotation
. Code:
'
+
JSON
.
stringify
(
exception
));
console
.
error
(
'
Failed to
unlock auto rotate
. Code:
'
+
JSON
.
stringify
(
exception
));
};
};
```
```
...
@@ -693,13 +693,13 @@ let isLocked = false;
...
@@ -693,13 +693,13 @@ let isLocked = false;
try
{
try
{
screen
.
setScreenRotationLocked
(
isLocked
,
(
err
,
data
)
=>
{
screen
.
setScreenRotationLocked
(
isLocked
,
(
err
,
data
)
=>
{
if
(
err
.
code
)
{
if
(
err
.
code
)
{
console
.
error
(
'
Failed to
set whether to lock screen rotation
. Cause:
'
+
JSON
.
stringify
(
err
));
console
.
error
(
'
Failed to
unlock auto rotate
. Cause:
'
+
JSON
.
stringify
(
err
));
return
;
return
;
}
}
console
.
info
(
'
Succeeded in
setting whether to lock screen rotation
.
'
);
console
.
info
(
'
Succeeded in
unlocking auto rotate
.
'
);
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
Failed to
set whether to lock screen rotation
. Code:
'
+
JSON
.
stringify
(
exception
));
console
.
error
(
'
Failed to
unlock auto rotate
. Code:
'
+
JSON
.
stringify
(
exception
));
};
};
```
```
...
@@ -772,13 +772,13 @@ setOrientation(orientation: Orientation, callback: AsyncCallback<void>): v
...
@@ -772,13 +772,13 @@ setOrientation(orientation: Orientation, callback: AsyncCallback<void>): v
try
{
try
{
screenClass
.
setOrientation
(
screen
.
Orientation
.
VERTICAL
,
(
err
,
data
)
=>
{
screenClass
.
setOrientation
(
screen
.
Orientation
.
VERTICAL
,
(
err
,
data
)
=>
{
if
(
err
.
code
)
{
if
(
err
.
code
)
{
console
.
error
(
'
Failed to set
Orientation VERTICAL
. Code:
'
+
JSON
.
stringify
(
err
));
console
.
error
(
'
Failed to set
the vertical orientation
. Code:
'
+
JSON
.
stringify
(
err
));
return
;
return
;
}
}
console
.
info
(
'
Succeeded in setting
Orientation VERTICAL
. data:
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
Succeeded in setting
the vertical orientation
. data:
'
+
JSON
.
stringify
(
data
));
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
Failed to set
Orientation VERTICAL
. Code:
'
+
JSON
.
stringify
(
exception
));
console
.
error
(
'
Failed to set
the vertical orientation
. Code:
'
+
JSON
.
stringify
(
exception
));
};
};
```
```
...
@@ -814,12 +814,12 @@ setOrientation(orientation: Orientation): Promise<void>
...
@@ -814,12 +814,12 @@ setOrientation(orientation: Orientation): Promise<void>
try
{
try
{
let
promise
=
screenClass
.
setOrientation
(
screen
.
Orientation
.
VERTICAL
);
let
promise
=
screenClass
.
setOrientation
(
screen
.
Orientation
.
VERTICAL
);
promise
.
then
((
data
)
=>
{
promise
.
then
((
data
)
=>
{
console
.
info
(
'
Succeeded in setting
Orientation VERTICAL
. Data:
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
Succeeded in setting
the vertical orientation
. Data:
'
+
JSON
.
stringify
(
data
));
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
error
(
'
Failed to set
Orientation VERTICAL
. Cause:
'
+
JSON
.
stringify
(
err
));
console
.
error
(
'
Failed to set
the vertical orientation
. Cause:
'
+
JSON
.
stringify
(
err
));
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
Failed to set
Orientation VERTICAL
. Code:
'
+
JSON
.
stringify
(
exception
));
console
.
error
(
'
Failed to set
the vertical orientation
. Code:
'
+
JSON
.
stringify
(
exception
));
};
};
```
```
...
@@ -851,13 +851,13 @@ let modeIndex = 0;
...
@@ -851,13 +851,13 @@ let modeIndex = 0;
try
{
try
{
screenClass
.
setScreenActiveMode
(
modeIndex
,
(
err
,
data
)
=>
{
screenClass
.
setScreenActiveMode
(
modeIndex
,
(
err
,
data
)
=>
{
if
(
err
.
code
)
{
if
(
err
.
code
)
{
console
.
error
(
'
Failed to set
ScreenActiveM
ode 0. Code:
'
+
JSON
.
stringify
(
err
));
console
.
error
(
'
Failed to set
screen active m
ode 0. Code:
'
+
JSON
.
stringify
(
err
));
return
;
return
;
}
}
console
.
info
(
'
Succeeded in setting
ScreenActiveM
ode 0. data:
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
Succeeded in setting
screen active m
ode 0. data:
'
+
JSON
.
stringify
(
data
));
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
Failed to set
ScreenActiveM
ode 0. Code:
'
+
JSON
.
stringify
(
exception
));
console
.
error
(
'
Failed to set
screen active m
ode 0. Code:
'
+
JSON
.
stringify
(
exception
));
};
};
```
```
...
@@ -894,12 +894,12 @@ let modeIndex = 0;
...
@@ -894,12 +894,12 @@ let modeIndex = 0;
try
{
try
{
let
promise
=
screenClass
.
setScreenActiveMode
(
modeIndex
);
let
promise
=
screenClass
.
setScreenActiveMode
(
modeIndex
);
promise
.
then
((
data
)
=>
{
promise
.
then
((
data
)
=>
{
console
.
info
(
'
Succeeded in setting
ScreenActiveM
ode 0. Data:
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
Succeeded in setting
screen active m
ode 0. Data:
'
+
JSON
.
stringify
(
data
));
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
error
(
'
Failed to set
ScreenActiveM
ode 0. Code:
'
+
JSON
.
stringify
(
err
));
console
.
error
(
'
Failed to set
screen active m
ode 0. Code:
'
+
JSON
.
stringify
(
err
));
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
Failed to set
ScreenActiveM
ode 0. Code:
'
+
JSON
.
stringify
(
exception
));
console
.
error
(
'
Failed to set
screen active m
ode 0. Code:
'
+
JSON
.
stringify
(
exception
));
};
};
```
```
...
@@ -931,13 +931,13 @@ let densityDpi = 320;
...
@@ -931,13 +931,13 @@ let densityDpi = 320;
try
{
try
{
screenClass
.
setDensityDpi
(
densityDpi
,
(
err
,
data
)
=>
{
screenClass
.
setDensityDpi
(
densityDpi
,
(
err
,
data
)
=>
{
if
(
err
.
code
)
{
if
(
err
.
code
)
{
console
.
error
(
'
Failed to set
DensityDpi
320. Code:
'
+
JSON
.
stringify
(
err
));
console
.
error
(
'
Failed to set
the pixel density of the screen to
320. Code:
'
+
JSON
.
stringify
(
err
));
return
;
return
;
}
}
console
.
info
(
'
Succeed in setting
DensityDpi
320. data:
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
Succeed in setting
the pixel density of the screen to
320. data:
'
+
JSON
.
stringify
(
data
));
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
Failed to set
DensityDpi
320. Code:
'
+
JSON
.
stringify
(
exception
));
console
.
error
(
'
Failed to set
the pixel density of the screen to
320. Code:
'
+
JSON
.
stringify
(
exception
));
};
};
```
```
...
@@ -974,12 +974,12 @@ let densityDpi = 320;
...
@@ -974,12 +974,12 @@ let densityDpi = 320;
try
{
try
{
let
promise
=
screenClass
.
setDensityDpi
(
densityDpi
);
let
promise
=
screenClass
.
setDensityDpi
(
densityDpi
);
promise
.
then
((
data
)
=>
{
promise
.
then
((
data
)
=>
{
console
.
info
(
'
Succeeded in setting
DensityDpi
320. Data:
'
+
JSON
.
stringify
(
data
));
console
.
info
(
'
Succeeded in setting
the pixel density of the screen to
320. Data:
'
+
JSON
.
stringify
(
data
));
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
error
(
'
Failed to set
DensityDpi
320. Code:
'
+
JSON
.
stringify
(
err
));
console
.
error
(
'
Failed to set
the pixel density of the screen to
320. Code:
'
+
JSON
.
stringify
(
err
));
});
});
}
catch
(
exception
)
{
}
catch
(
exception
)
{
console
.
error
(
'
Failed to set
DensityDpi
320. Code:
'
+
JSON
.
stringify
(
exception
));
console
.
error
(
'
Failed to set
the pixel density of the screen to
320. Code:
'
+
JSON
.
stringify
(
exception
));
};
};
```
```
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录