提交 71c69589 编写于 作者: C cy7717

修改子类型 id name label的含义赋值

Signed-off-by: Ncy7717 <chenyu301@huawei.com>
上级 6076c518
...@@ -21,7 +21,7 @@ import InputMethodSubtype from '@ohos.InputMethodSubtype'; ...@@ -21,7 +21,7 @@ import InputMethodSubtype from '@ohos.InputMethodSubtype';
| 名称 | 类型 | 可读 | 可写 | 必选 | 说明 | | 名称 | 类型 | 可读 | 可写 | 必选 | 说明 |
| -------- | -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- | -------- |
| label | string | 是 | 否 | 否 | 输入法子类型的标签。 | | label | string | 是 | 否 | 否 | 输入法子类型的标签。 |
| name | string | 是 | 否 | 是 | 输入法子类型的名字。 | | name | string | 是 | 否 | 是 | 输入法内部名称。 |
| id | string | 是 | 否 | 是 | 输入法子类型的id。 | | id | string | 是 | 否 | 是 | 输入法子类型的id。 |
| mode | string | 是 | 否 | 否 | 输入法子类型的模式,包括upper(大写)和lower(小写)。 | | mode | string | 是 | 否 | 否 | 输入法子类型的模式,包括upper(大写)和lower(小写)。 |
| locale | string | 是 | 否 | 是 | 输入法子类型的方言版本。 | | locale | string | 是 | 否 | 是 | 输入法子类型的方言版本。 |
......
...@@ -256,9 +256,9 @@ switchCurrentInputMethodSubtype(target: InputMethodSubtype, callback: AsyncCallb ...@@ -256,9 +256,9 @@ switchCurrentInputMethodSubtype(target: InputMethodSubtype, callback: AsyncCallb
```js ```js
try { try {
inputMethod.switchCurrentInputMethodSubtype({ inputMethod.switchCurrentInputMethodSubtype({
id: "com.example.kikakeyboard", id: "ServiceExtAbility",
label: "ServiceExtAbility", label: "",
name: "", name: "com.example.kikakeyboard",
mode: "upper", mode: "upper",
locale: "", locale: "",
language: "", language: "",
...@@ -317,9 +317,9 @@ switchCurrentInputMethodSubtype(target: InputMethodSubtype): Promise&lt;boolean& ...@@ -317,9 +317,9 @@ switchCurrentInputMethodSubtype(target: InputMethodSubtype): Promise&lt;boolean&
```js ```js
try { try {
inputMethod.switchCurrentInputMethodSubtype({ inputMethod.switchCurrentInputMethodSubtype({
id: "com.example.kikakeyboard", id: "ServiceExtAbility",
label: "ServiceExtAbility", label: "",
name: "", name: "com.example.kikakeyboard",
mode: "upper", mode: "upper",
locale: "", locale: "",
language: "", language: "",
...@@ -391,25 +391,9 @@ switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inp ...@@ -391,25 +391,9 @@ switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inp
```js ```js
let im = inputMethod.getCurrentInputMethod(); let im = inputMethod.getCurrentInputMethod();
let inputMethodProperty = { let imSubType = inputMethod.getCurrentInputMethodSubtype();
packageName: im.packageName,
methodId: im.methodId,
name: im.packageName,
id: im.methodId,
extra: {}
}
try { try {
inputMethod.switchCurrentInputMethodAndSubtype(inputMethodProperty, { inputMethod.switchCurrentInputMethodAndSubtype(im, imSubType, (err,result) => {
id: "com.example.kikakeyboard",
label: "ServiceExtAbility",
name: "",
mode: "upper",
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;
...@@ -461,25 +445,9 @@ switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inp ...@@ -461,25 +445,9 @@ switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inp
```js ```js
let im = inputMethod.getCurrentInputMethod(); let im = inputMethod.getCurrentInputMethod();
let inputMethodProperty = { let imSubType = inputMethod.getCurrentInputMethodSubtype();
packageName: im.packageName,
methodId: im.methodId,
name: im.packageName,
id: im.methodId,
extra: {}
}
try { try {
inputMethod.switchCurrentInputMethodAndSubtype(inputMethodProperty, { inputMethod.switchCurrentInputMethodAndSubtype(im, imSubType).then((result) => {
id: im.packageName,
label: im.methodId,
name: "",
mode: "upper",
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.
先完成此消息的编辑!
想要评论请 注册