提交 364aa5c3 编写于 作者: C cy7717

mod

Signed-off-by: Ncy7717 <chenyu301@huawei.com>
上级 1a5a20f8
...@@ -391,26 +391,9 @@ switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inp ...@@ -391,26 +391,9 @@ switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inp
```js ```js
let im = inputMethod.getCurrentInputMethod(); let im = inputMethod.getCurrentInputMethod();
let inputMethodProperty = {
packageName: im.packageName,
methodId: im.methodId,
name: im.packageName,
id: im.methodId,
extra: {}
}
let imSubType = inputMethod.getCurrentInputMethodSubtype(); let imSubType = inputMethod.getCurrentInputMethodSubtype();
try { try {
inputMethod.switchCurrentInputMethodAndSubtype(inputMethodProperty, { inputMethod.switchCurrentInputMethodAndSubtype(im, imSubType, (err,result) => {
id: "imSubType.id",
label: "",
name: "imSubType.name",
mode: "",
locale: "",
language: "",
icon: "",
iconId: 0,
extra: {}
}, (err,result) => {
if (err !== undefined) { if (err !== undefined) {
console.error('Failed to switchCurrentInputMethodAndSubtype: ' + JSON.stringify(err)); console.error('Failed to switchCurrentInputMethodAndSubtype: ' + JSON.stringify(err));
return; return;
...@@ -462,26 +445,9 @@ switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inp ...@@ -462,26 +445,9 @@ switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inp
```js ```js
let im = inputMethod.getCurrentInputMethod(); let im = inputMethod.getCurrentInputMethod();
let inputMethodProperty = {
packageName: im.packageName,
methodId: im.methodId,
name: im.packageName,
id: im.methodId,
extra: {}
}
let imSubType = inputMethod.getCurrentInputMethodSubtype(); let imSubType = inputMethod.getCurrentInputMethodSubtype();
try { try {
inputMethod.switchCurrentInputMethodAndSubtype(inputMethodProperty, { inputMethod.switchCurrentInputMethodAndSubtype(inputMethodProperty, imSubType).then((result) => {
id: imSubType.id,
label: "",
name: imSubType.name,
mode: "",
locale: "",
language: "",
icon: "",
iconId: 0,
extra: {}
}).then((result) => {
if (result) { if (result) {
console.info('Succeeded in switching currentInputMethodAndSubtype.'); console.info('Succeeded in switching currentInputMethodAndSubtype.');
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册