Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
201ddbe1
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
201ddbe1
编写于
4月 28, 2023
作者:
Z
zhangyushuai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add inputmethodWindManage testcases 002
Signed-off-by:
N
zhangyushuai
<
zhangyushuai1@huawei.com
>
上级
4fdca903
变更
23
展开全部
隐藏空白更改
内联
并排
Showing
23 changed file
with
2870 addition
and
1 deletion
+2870
-1
inputmethod/BUILD.gn
inputmethod/BUILD.gn
+1
-0
inputmethod/InputMethodEngine/AppScope/resources/base/element/string.json
...tMethodEngine/AppScope/resources/base/element/string.json
+1
-1
inputmethod/InputMethodEngine/entry/src/main/ets/InputMethodAbility/KeyboardDelegate.ts
...entry/src/main/ets/InputMethodAbility/KeyboardDelegate.ts
+190
-0
inputmethod/InputMethodEngine/entry/src/main/ets/test/inputMethodAbility.test.ets
...ngine/entry/src/main/ets/test/inputMethodAbility.test.ets
+310
-0
inputmethod/InputMethodWindManage/AppScope/app.json
inputmethod/InputMethodWindManage/AppScope/app.json
+21
-0
inputmethod/InputMethodWindManage/AppScope/resources/base/element/string.json
...hodWindManage/AppScope/resources/base/element/string.json
+8
-0
inputmethod/InputMethodWindManage/AppScope/resources/base/media/app_icon.png
...thodWindManage/AppScope/resources/base/media/app_icon.png
+0
-0
inputmethod/InputMethodWindManage/BUILD.gn
inputmethod/InputMethodWindManage/BUILD.gn
+43
-0
inputmethod/InputMethodWindManage/Test.json
inputmethod/InputMethodWindManage/Test.json
+29
-0
inputmethod/InputMethodWindManage/entry/src/main/ets/Application/AbilityStage.ts
...WindManage/entry/src/main/ets/Application/AbilityStage.ts
+23
-0
inputmethod/InputMethodWindManage/entry/src/main/ets/InputMethodWindManage/InputMethodWindService.ts
.../main/ets/InputMethodWindManage/InputMethodWindService.ts
+31
-0
inputmethod/InputMethodWindManage/entry/src/main/ets/InputMethodWindManage/KeyboardController.ts
.../src/main/ets/InputMethodWindManage/KeyboardController.ts
+836
-0
inputmethod/InputMethodWindManage/entry/src/main/ets/MainAbility/MainAbility.ts
...dWindManage/entry/src/main/ets/MainAbility/MainAbility.ts
+51
-0
inputmethod/InputMethodWindManage/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...ge/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+78
-0
inputmethod/InputMethodWindManage/entry/src/main/ets/pages/index/index.ets
...MethodWindManage/entry/src/main/ets/pages/index/index.ets
+67
-0
inputmethod/InputMethodWindManage/entry/src/main/ets/pages/second/second.ets
...thodWindManage/entry/src/main/ets/pages/second/second.ets
+43
-0
inputmethod/InputMethodWindManage/entry/src/main/ets/test/InputMethodWindManage.test.ets
...ge/entry/src/main/ets/test/InputMethodWindManage.test.ets
+1023
-0
inputmethod/InputMethodWindManage/entry/src/main/ets/test/List.test.ets
...putMethodWindManage/entry/src/main/ets/test/List.test.ets
+19
-0
inputmethod/InputMethodWindManage/entry/src/main/module.json
inputmethod/InputMethodWindManage/entry/src/main/module.json
+54
-0
inputmethod/InputMethodWindManage/entry/src/main/resources/base/element/string.json
...dManage/entry/src/main/resources/base/element/string.json
+36
-0
inputmethod/InputMethodWindManage/entry/src/main/resources/base/media/icon.png
...odWindManage/entry/src/main/resources/base/media/icon.png
+0
-0
inputmethod/InputMethodWindManage/entry/src/main/resources/base/profile/main_pages.json
...age/entry/src/main/resources/base/profile/main_pages.json
+6
-0
inputmethod/InputMethodWindManage/signature/ActsInputMethodWindManageTest.p7b
...hodWindManage/signature/ActsInputMethodWindManageTest.p7b
+0
-0
未找到文件。
inputmethod/BUILD.gn
浏览文件 @
201ddbe1
...
...
@@ -19,5 +19,6 @@ group("inputmethod") {
"InputMethodEngine:ActsInputMethodEngineTest",
"InputMethodTest_Stage:ActsImeAbilityTest",
"InputMethodTest_ets:ActsInputMethodEtsTest",
"InputMethodWindManage:ActsInputMethodWindManageTest",
]
}
inputmethod/InputMethodEngine/AppScope/resources/base/element/string.json
浏览文件 @
201ddbe1
...
...
@@ -2,7 +2,7 @@
"string"
:[
{
"name"
:
"app_name"
,
"value"
:
"
ohosProjec
t"
"value"
:
"
ActsInputMethodEngineTes
t"
}
]
}
\ No newline at end of file
inputmethod/InputMethodEngine/entry/src/main/ets/InputMethodAbility/KeyboardDelegate.ts
浏览文件 @
201ddbe1
...
...
@@ -196,6 +196,22 @@ export class KeyboardDelegate {
console
.
debug
(
TAG
+
'
====>inputMethodAbility_test_0106 event:
'
+
data
.
event
);
that
.
inputMethodAbility_test_106
();
break
;
case
110
:
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_onSelectByRange_0110 event:
'
+
data
.
event
);
that
.
Sub_Misc_inputMethod_onSelectByRange_0110
();
break
;
case
120
:
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_onSelectByMovement_0120 event:
'
+
data
.
event
);
that
.
Sub_Misc_inputMethod_onSelectByMovement_0120
();
break
;
case
130
:
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_offSelectByRange_0130 event:
'
+
data
.
event
);
that
.
Sub_Misc_inputMethod_offSelectByRange_0130
();
break
;
case
140
:
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_offSelectByMovement_0140 event:
'
+
data
.
event
);
that
.
Sub_Misc_inputMethod_offSelectByMovement_0140
();
break
;
}
}
...
...
@@ -1299,4 +1315,178 @@ export class KeyboardDelegate {
}
});
}
private
Sub_Misc_inputMethod_onSelectByRange_0110
():
void
{
let
commonEventPublishData
;
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_onSelectByRange_0110 success
'
);
try
{
inputMethodAbility
.
on
(
'
inputStart
'
,
async
(
KeyboardDelegate
,
InputClient
)
=>
{
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_onSelectByRange_0110 success inputStart
'
);
let
commonEventPublishData
;
let
range
=
{
start
:
0
,
end
:
10
};
inputMethodAbility
.
off
(
'
inputStart
'
);
if
(
InputClient
==
null
)
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_onSelectByRange_0110
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
else
{
commonEventPublishData
=
{
data
:
"
SUCCESS
"
};
try
{
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_onSelectByRange_0110 selectByRange success
'
);
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_onSelectByRange_0110
"
,
commonEventPublishData
,
this
.
publishCallback
);
await
InputClient
.
selectByRange
(
range
);
}
catch
(
err
)
{
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_onSelectByRange_0110 selectByRange catch err:
'
+
JSON
.
stringify
(
err
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_onSelectByRange_0110
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
});
}
catch
(
error
){
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_onSelectByRange_0110 catch error:
'
+
JSON
.
stringify
(
error
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_onSelectByRange_0110
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
private
Sub_Misc_inputMethod_onSelectByMovement_0120
():
void
{
let
commonEventPublishData
;
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_onSelectByMovement_0120 success
'
);
try
{
inputMethodAbility
.
on
(
'
inputStart
'
,
async
(
KeyboardDelegate
,
InputClient
)
=>
{
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_onSelectByMovement_0120 success inputStart
'
);
let
commonEventPublishData
;
let
movement
=
{
direction
:
inputMethodEngine
.
CURSOR_DOWN
};
inputMethodAbility
.
off
(
'
inputStart
'
);
if
(
InputClient
==
null
)
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_onSelectByMovement_0120
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
else
{
commonEventPublishData
=
{
data
:
"
SUCCESS
"
};
try
{
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_onSelectByMovement_0120 onSelectByMovement success
'
);
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_onSelectByMovement_0120
"
,
commonEventPublishData
,
this
.
publishCallback
);
await
InputClient
.
selectByMovement
(
movement
);
}
catch
(
err
)
{
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_onSelectByMovement_0120 onSelectByMovement catch err:
'
+
JSON
.
stringify
(
err
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_onSelectByMovement_0120
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
});
}
catch
(
error
){
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_onSelectByMovement_0120 catch error:
'
+
JSON
.
stringify
(
error
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_onSelectByMovement_0120
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
private
Sub_Misc_inputMethod_offSelectByRange_0130
():
void
{
let
commonEventPublishData
;
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_offSelectByRange_0130 success
'
);
try
{
inputMethodAbility
.
on
(
'
inputStart
'
,
async
(
KeyboardDelegate
,
InputClient
)
=>
{
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_offSelectByRange_0130 success inputStart
'
);
let
commonEventPublishData
;
let
timeCount
=
0
;
let
range
=
{
start
:
0
,
end
:
10
};
inputMethodAbility
.
off
(
'
inputStart
'
);
if
(
InputClient
==
null
)
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_offSelectByRange_0130
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
else
{
commonEventPublishData
=
{
data
:
"
SUCCESS
"
};
try
{
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_offSelectByRange_0130 offSelectByRange in
'
);
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_offSelectByRange_0130
"
,
commonEventPublishData
,
this
.
publishCallback
);
let
t1
=
setInterval
(
async
()
=>
{;
await
InputClient
.
selectByRange
(
range
);
timeCount
+=
1
;
console
.
info
(
TAG
+
'
====>Sub_Misc_inputMethod_offSelectByMovement_0140 this.softKeyboardPanel.hide setInterval timeCount:
'
+
timeCount
);
if
(
timeCount
===
2
){
clearInterval
(
t1
);
}
},
100
);
}
catch
(
err
)
{
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_offSelectByRange_0130 offSelectByRange catch err:
'
+
JSON
.
stringify
(
err
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_offSelectByRange_0130
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
});
}
catch
(
error
){
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_offSelectByRange_0130 catch error:
'
+
JSON
.
stringify
(
error
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_offSelectByRange_0130
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
private
Sub_Misc_inputMethod_offSelectByMovement_0140
():
void
{
let
commonEventPublishData
;
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_offSelectByMovement_0140 success
'
);
try
{
inputMethodAbility
.
on
(
'
inputStart
'
,
async
(
KeyboardDelegate
,
InputClient
)
=>
{
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_offSelectByMovement_0140 success inputStart
'
);
let
commonEventPublishData
;
let
timeCount
=
0
;
let
movement
=
{
direction
:
inputMethodEngine
.
CURSOR_DOWN
};
inputMethodAbility
.
off
(
'
inputStart
'
);
if
(
InputClient
==
null
)
{
commonEventPublishData
=
{
data
:
"
FAILED
"
};
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_offSelectByMovement_0140
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
else
{
commonEventPublishData
=
{
data
:
"
SUCCESS
"
};
try
{
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_offSelectByMovement_0140 offSelectByMovement in
'
);
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_offSelectByMovement_0140
"
,
commonEventPublishData
,
this
.
publishCallback
);
let
t1
=
setInterval
(
async
()
=>
{;
await
InputClient
.
selectByMovement
(
movement
);
timeCount
+=
1
;
console
.
info
(
TAG
+
'
====>Sub_Misc_inputMethod_offSelectByMovement_0140 this.softKeyboardPanel.hide setInterval timeCount:
'
+
timeCount
);
if
(
timeCount
===
2
){
clearInterval
(
t1
);
}
},
100
);
}
catch
(
err
)
{
console
.
debug
(
TAG
+
'
====>Sub_Misc_inputMethod_offSelectByMovement_0140 offSelectByMovement catch err:
'
+
JSON
.
stringify
(
err
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_offSelectByMovement_0140
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
});
}
catch
(
error
){
commonEventPublishData
=
{
data
:
"
FAILED
"
};
console
.
info
(
TAG
+
'
====>receive Sub_Misc_inputMethod_offSelectByMovement_0140 catch error:
'
+
JSON
.
stringify
(
error
));
commoneventmanager
.
publish
(
"
Sub_Misc_inputMethod_offSelectByMovement_0140
"
,
commonEventPublishData
,
this
.
publishCallback
);
}
}
}
\ No newline at end of file
inputmethod/InputMethodEngine/entry/src/main/ets/test/inputMethodAbility.test.ets
浏览文件 @
201ddbe1
...
...
@@ -30,9 +30,18 @@ export default function inputMethodAbility() {
extra
:
{}
}
var
inputServerCopy
=
{
packageName
:
''
,
methodId
:
''
,
name
:
''
,
id
:
''
,
extra
:
{}
}
let
display_info
;
let
getFocusCmd
=
''
;
let
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
let
inputMethodController
=
inputMethod
.
getController
();
async
function
runCmd
(
cmd
){
console
.
debug
(
'====>runCmd info:'
+
cmd
);
await
abilityDelegator
.
executeShellCommand
(
cmd
);
...
...
@@ -67,6 +76,12 @@ export default function inputMethodAbility() {
}
catch
(
err
){
console
.
debug
(
"====>beforeAll inputMethodStageJSUnit switchCurrentInputMethodSubtype failed"
);
}
let
inputCurrent
=
inputMethod
.
getCurrentInputMethod
();
inputServerCopy
.
packageName
=
inputCurrent
.
packageName
;
inputServerCopy
.
methodId
=
inputCurrent
.
methodId
;
inputServerCopy
.
name
=
inputCurrent
.
packageName
;
inputServerCopy
.
id
=
inputCurrent
.
methodId
;
console
.
info
(
"====>Sub_Misc_inputMethod_onImeChange_0010 restore to: "
+
JSON
.
stringify
(
inputServerCopy
));
})
afterAll
(
async
(
done
)
=>
{
...
...
@@ -2208,5 +2223,300 @@ export default function inputMethodAbility() {
}
commonEventManager
.
publish
(
'test'
,
commonEventPublishData
,
publishCallback
);
});
it
(
'Sub_Misc_inputMethod_onSelectByRange_0110'
,
0
,
async
function
(
done
)
{
function
unSubscriberCallback
(
err
){
console
.
info
(
"====>Sub_Misc_inputMethod_onSelectByRange_0110 unSubscriberCallback start"
);
if
(
err
){
console
.
info
(
"====>Sub_Misc_inputMethod_onSelectByRange_0110 unSubscriberCallback failed:"
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_onSelectByRange_0110 unSubscriberCallback finish"
);
}
}
function
subscriberCallback
(
err
,
data
){
console
.
info
(
"====>Sub_Misc_inputMethod_onSelectByRange_0110 subscriberCallback data:"
+
JSON
.
stringify
(
data
));
commonEventManager
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
}
function
publishCallback
(
err
){
console
.
info
(
"====>Sub_Misc_inputMethod_onSelectByRange_0110 publishCallback start"
);
if
(
err
){
console
.
info
(
"====>Sub_Misc_inputMethod_onSelectByRange_0110 publishCallback failed:"
+
JSON
.
stringify
(
err
));
}
else
{
runCmd
(
getFocusCmd
);
}
}
var
commonEventSubscribeInfo
=
{
events
:
[
"Sub_Misc_inputMethod_onSelectByRange_0110"
]
}
var
subscriber
;
commonEventManager
.
createSubscriber
(
commonEventSubscribeInfo
)
.
then
((
data
)
=>
{
subscriber
=
data
;
console
.
info
(
"====>Sub_Misc_inputMethod_onSelectByRange_0110 subscriber data:"
+
JSON
.
stringify
(
data
));
commonEventManager
.
subscribe
(
subscriber
,
subscriberCallback
);
console
.
info
(
"====>Sub_Misc_inputMethod_onSelectByRange_0110 subscriber finish"
)
})
inputMethodController
.
on
(
"selectByRange"
,
async
(
range
)
=>
{
console
.
info
(
'====>Sub_Misc_inputMethod_onSelectByRange_0110 onSelectByRange start'
);
inputMethodController
.
off
(
"selectByRange"
);
try
{
expect
(
range
.
start
)
.
assertEqual
(
0
);
expect
(
range
.
end
)
.
assertEqual
(
10
);
console
.
info
(
'====>Sub_Misc_inputMethod_onSelectByRange_0110 Succeed onSelectByRange: '
+
JSON
.
stringify
(
range
));
done
();
}
catch
(
err
)
{
console
.
info
(
'====>Sub_Misc_inputMethod_onSelectByRange_0110 selectByRange success'
);
done
();
}
});
var
commonEventPublishData
=
{
code
:
110
}
commonEventManager
.
publish
(
'test'
,
commonEventPublishData
,
publishCallback
);
});
it
(
'Sub_Misc_inputMethod_onSelectByMovement_0120'
,
0
,
async
function
(
done
)
{
function
unSubscriberCallback
(
err
){
console
.
info
(
"====>Sub_Misc_inputMethod_onSelectByMovement_0120 unSubscriberCallback start"
);
if
(
err
){
console
.
info
(
"====>Sub_Misc_inputMethod_onSelectByMovement_0120 unSubscriberCallback failed:"
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_onSelectByMovement_0120 unSubscriberCallback finish"
);
}
}
function
subscriberCallback
(
err
,
data
){
console
.
info
(
"====>Sub_Misc_inputMethod_onSelectByMovement_0120 subscriberCallback data:"
+
JSON
.
stringify
(
data
));
commonEventManager
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
}
function
publishCallback
(
err
){
console
.
info
(
"====>Sub_Misc_inputMethod_onSelectByMovement_0120 publishCallback start"
);
if
(
err
){
console
.
info
(
"====>Sub_Misc_inputMethod_onSelectByMovement_0120 publishCallback failed:"
+
JSON
.
stringify
(
err
));
}
else
{
runCmd
(
getFocusCmd
);
}
}
var
commonEventSubscribeInfo
=
{
events
:
[
"Sub_Misc_inputMethod_onSelectByMovement_0120"
]
}
var
subscriber
;
commonEventManager
.
createSubscriber
(
commonEventSubscribeInfo
)
.
then
((
data
)
=>
{
subscriber
=
data
;
console
.
info
(
"====>Sub_Misc_inputMethod_onSelectByMovement_0120 subscriber data:"
+
JSON
.
stringify
(
data
));
commonEventManager
.
subscribe
(
subscriber
,
subscriberCallback
);
console
.
info
(
"====>Sub_Misc_inputMethod_onSelectByMovement_0120 subscriber finish"
)
})
inputMethodController
.
on
(
"selectByMovement"
,
async
(
movement
)
=>
{
console
.
info
(
'====>Sub_Misc_inputMethod_onSelectByMovement_0120 onSelectByMovement start'
);
inputMethodController
.
off
(
"selectByMovement"
);
try
{
expect
(
movement
.
direction
)
.
assertEqual
(
2
);
console
.
info
(
'====>Sub_Misc_inputMethod_onSelectByMovement_0120 Succeed onSelectByMovement: '
+
JSON
.
stringify
(
movement
));
done
();
}
catch
(
err
)
{
console
.
info
(
'====>Sub_Misc_inputMethod_onSelectByMovement_0120 onSelectByMovement catch err: '
+
JSON
.
stringify
(
err
));
done
();
}
});
var
commonEventPublishData
=
{
code
:
120
}
commonEventManager
.
publish
(
'test'
,
commonEventPublishData
,
publishCallback
);
});
it
(
'Sub_Misc_inputMethod_offSelectByRange_0130'
,
0
,
async
function
(
done
)
{
function
unSubscriberCallback
(
err
){
console
.
info
(
"====>Sub_Misc_inputMethod_offSelectByRange_0130 unSubscriberCallback start"
);
if
(
err
){
console
.
info
(
"====>Sub_Misc_inputMethod_offSelectByRange_0130 unSubscriberCallback failed:"
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_offSelectByRange_0130 unSubscriberCallback finish"
);
}
}
function
subscriberCallback
(
err
,
data
){
console
.
info
(
"====>Sub_Misc_inputMethod_offSelectByRange_0130 subscriberCallback data:"
+
JSON
.
stringify
(
data
));
commonEventManager
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
}
function
publishCallback
(
err
){
console
.
info
(
"====>Sub_Misc_inputMethod_offSelectByRange_0130 publishCallback start"
);
if
(
err
){
console
.
info
(
"====>Sub_Misc_inputMethod_offSelectByRange_0130 publishCallback failed:"
+
JSON
.
stringify
(
err
));
}
else
{
runCmd
(
getFocusCmd
);
}
}
var
commonEventSubscribeInfo
=
{
events
:
[
"Sub_Misc_inputMethod_offSelectByRange_0130"
]
}
var
subscriber
;
commonEventManager
.
createSubscriber
(
commonEventSubscribeInfo
)
.
then
((
data
)
=>
{
subscriber
=
data
;
console
.
info
(
"====>Sub_Misc_inputMethod_offSelectByRange_0130 subscriber data:"
+
JSON
.
stringify
(
data
));
commonEventManager
.
subscribe
(
subscriber
,
subscriberCallback
);
console
.
info
(
"====>Sub_Misc_inputMethod_offSelectByRange_0130 subscriber finish"
)
})
let
count
=
0
;
inputMethodController
.
on
(
"selectByRange"
,
async
(
movement
)
=>
{
console
.
info
(
'====>Sub_Misc_inputMethod_offSelectByRange_0130 offSelectByRange start'
);
inputMethodController
.
off
(
"selectByRange"
);
count
+=
1
;
console
.
info
(
'====>Sub_Misc_inputMethod_offSelectByRange_0130 Succeed offSelectByRange: '
+
JSON
.
stringify
(
movement
));
console
.
info
(
'====>Sub_Misc_inputMethod_offSelectByRange_0130 count: '
+
count
);
});
let
t
=
setTimeout
(()
=>
{
try
{
console
.
info
(
'====>Sub_Misc_inputMethod_offSelectByRange_0130 setTimeout count: '
+
count
);
expect
(
count
)
.
assertEqual
(
1
);
clearTimeout
(
t
);
done
();
console
.
info
(
'====>Sub_Misc_inputMethod_offSelectByRange_0130 Succeed offSelectByRange '
);
}
catch
(
err
)
{
console
.
info
(
'====>Sub_Misc_inputMethod_offSelectByRange_0130 offSelectByRange err: '
+
JSON
.
stringify
(
err
));
done
();
}
},
500
);
var
commonEventPublishData
=
{
code
:
130
}
commonEventManager
.
publish
(
'test'
,
commonEventPublishData
,
publishCallback
);
});
it
(
'Sub_Misc_inputMethod_offSelectByMovement_0140'
,
0
,
async
function
(
done
)
{
function
unSubscriberCallback
(
err
){
console
.
info
(
"====>Sub_Misc_inputMethod_offSelectByMovement_0140 unSubscriberCallback start"
);
if
(
err
){
console
.
info
(
"====>Sub_Misc_inputMethod_offSelectByMovement_0140 unSubscriberCallback failed:"
+
JSON
.
stringify
(
err
));
}
else
{
console
.
info
(
"====>Sub_Misc_inputMethod_offSelectByMovement_0140 unSubscriberCallback finish"
);
}
}
function
subscriberCallback
(
err
,
data
){
console
.
info
(
"====>Sub_Misc_inputMethod_offSelectByMovement_0140 subscriberCallback data:"
+
JSON
.
stringify
(
data
));
commonEventManager
.
unsubscribe
(
subscriber
,
unSubscriberCallback
);
}
function
publishCallback
(
err
){
console
.
info
(
"====>Sub_Misc_inputMethod_offSelectByMovement_0140 publishCallback start"
);
if
(
err
){
console
.
info
(
"====>Sub_Misc_inputMethod_offSelectByMovement_0140 publishCallback failed:"
+
JSON
.
stringify
(
err
));
}
else
{
runCmd
(
getFocusCmd
);
}
}
var
commonEventSubscribeInfo
=
{
events
:
[
"Sub_Misc_inputMethod_offSelectByMovement_0140"
]
}
var
subscriber
;
commonEventManager
.
createSubscriber
(
commonEventSubscribeInfo
)
.
then
((
data
)
=>
{
subscriber
=
data
;
console
.
info
(
"====>Sub_Misc_inputMethod_offSelectByMovement_0140 subscriber data:"
+
JSON
.
stringify
(
data
));
commonEventManager
.
subscribe
(
subscriber
,
subscriberCallback
);
console
.
info
(
"====>Sub_Misc_inputMethod_offSelectByMovement_0140 subscriber finish"
)
})
let
count
=
0
;
inputMethodController
.
on
(
"selectByMovement"
,
async
(
movement
)
=>
{
console
.
info
(
'====>Sub_Misc_inputMethod_offSelectByMovement_0140 offSelectByMovement start'
);
inputMethodController
.
off
(
"selectByMovement"
);
count
+=
1
;
console
.
info
(
'====>Sub_Misc_inputMethod_offSelectByMovement_0140 Succeed offSelectByMovement: '
+
JSON
.
stringify
(
movement
));
console
.
info
(
'====>Sub_Misc_inputMethod_offSelectByMovement_0140 count: '
+
count
);
});
let
t
=
setTimeout
(()
=>
{
try
{
console
.
info
(
'====>Sub_Misc_inputMethod_offSelectByMovement_0140 setTimeout count: '
+
count
);
expect
(
count
)
.
assertEqual
(
1
);
clearTimeout
(
t
);
done
();
console
.
info
(
'====>Sub_Misc_inputMethod_offSelectByMovement_0140 Succeed offSelectByMovement '
);
}
catch
(
err
)
{
console
.
info
(
'====>Sub_Misc_inputMethod_offSelectByMovement_0140 offSelectByMovement err: '
+
JSON
.
stringify
(
err
));
done
();
}
},
500
);
var
commonEventPublishData
=
{
code
:
140
}
commonEventManager
.
publish
(
'test'
,
commonEventPublishData
,
publishCallback
);
});
it
(
'Sub_Misc_inputMethod_onImeChange_0150'
,
0
,
async
function
(
done
)
{
let
inputMethodSetting
=
inputMethod
.
getSetting
();
inputMethodSetting
.
on
(
"imeChange"
,
(
inputMethodProperty
,
inputMethodSubtype
)
=>
{
inputMethodSetting
.
off
(
"imeChange"
);
console
.
info
(
"====>Sub_Misc_inputMethod_onImeChange_0150 inputMethodProperty:"
+
JSON
.
stringify
(
inputMethodProperty
));
console
.
info
(
"====>Sub_Misc_inputMethod_onImeChange_0150 inputMethodSubtype:"
+
JSON
.
stringify
(
inputMethodSubtype
));
expect
(
typeof
(
inputMethodProperty
)
!==
null
)
.
assertTrue
();
expect
(
typeof
(
inputMethodSubtype
)
!==
null
)
.
assertTrue
();
done
();
})
try
{
await
inputMethod
.
switchInputMethod
(
inputServer
);
console
.
info
(
"====>Sub_Misc_inputMethod_onImeChange_0150 switchInputMethod success"
+
JSON
.
stringify
(
inputServer
));
await
inputMethod
.
switchInputMethod
(
inputServerCopy
);
}
catch
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_onImeChange_0150 switchInputMethod fail"
+
JSON
.
stringify
(
err
));
}
});
it
(
'Sub_Misc_inputMethod_offImeChange_0160'
,
0
,
async
function
(
done
)
{
let
count
=
0
;
let
inputMethodSetting
=
inputMethod
.
getSetting
();
inputMethodSetting
.
on
(
"imeChange"
,
(
inputMethodProperty
,
inputMethodSubtype
)
=>
{
inputMethodSetting
.
off
(
"imeChange"
);
count
+=
1
;
console
.
info
(
"====>Sub_Misc_inputMethod_offImeChange_0160 count:"
+
count
);
})
try
{
await
inputMethod
.
switchInputMethod
(
inputServer
);
console
.
info
(
'====>Sub_Misc_inputMethod_offImeChange_0160 switchInputMethod'
);
let
t
=
setTimeout
(
async
()
=>
{
clearTimeout
(
t
);
await
inputMethod
.
switchInputMethod
(
inputServerCopy
);
},
100
);
}
catch
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_offImeChange_0160 switchInputMethod fail"
+
JSON
.
stringify
(
err
));
}
let
t
=
setTimeout
(()
=>
{
clearTimeout
(
t
);
try
{
console
.
info
(
'====>Sub_Misc_inputMethod_offImeChange_0160 setTimeout count: '
+
count
);
expect
(
count
===
1
)
.
assertTrue
();
}
catch
(
err
)
{
console
.
info
(
"====>Sub_Misc_inputMethod_offImeChange_0160 switchInputMethod fail"
+
JSON
.
stringify
(
err
));
}
done
();
},
500
);
});
});
};
inputmethod/InputMethodWindManage/AppScope/app.json
0 → 100644
浏览文件 @
201ddbe1
{
"app"
:{
"bundleName"
:
"com.acts.inputmethodwidmanage.test"
,
"vendor"
:
"hw"
,
"versionCode"
:
1000000
,
"versionName"
:
"1.0.0"
,
"debug"
:
false
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:app_name"
,
"description"
:
"$string:description_application"
,
"distributedNotificationEnabled"
:
true
,
"keepAlive"
:
true
,
"singleUser"
:
true
,
"minAPIVersion"
:
8
,
"targetAPIVersion"
:
8
,
"car"
:{
"apiCompatibleVersion"
:
8
,
"singleUser"
:
false
}
}
}
inputmethod/InputMethodWindManage/AppScope/resources/base/element/string.json
0 → 100644
浏览文件 @
201ddbe1
{
"string"
:[
{
"name"
:
"app_name"
,
"value"
:
"ActsInputMethodWindManageTest"
}
]
}
\ No newline at end of file
inputmethod/InputMethodWindManage/AppScope/resources/base/media/app_icon.png
0 → 100644
浏览文件 @
201ddbe1
6.6 KB
inputmethod/InputMethodWindManage/BUILD.gn
0 → 100644
浏览文件 @
201ddbe1
# Copyright (c) 2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsInputMethodWindManageTest") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":IMExtAbility_ets_assets",
":IMExtAbility_resources",
]
ets2abc = true
certificate_profile = "signature/ActsInputMethodWindManageTest.p7b"
hap_name = "ActsInputMethodWindManageTest"
subsystem_name = "inputmethod"
part_name = "imf"
}
ohos_app_scope("IMExtAbility_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("IMExtAbility_ets_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("IMExtAbility_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":IMExtAbility_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
inputmethod/InputMethodWindManage/Test.json
0 → 100644
浏览文件 @
201ddbe1
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"180000"
,
"bundle-name"
:
"com.acts.inputmethodwidmanage.test"
,
"module-name"
:
"phone"
,
"shell-timeout"
:
"600000"
,
"testcase-timeout"
:
15000
},
"kits"
:
[
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"power-shell wakeup"
,
"power-shell setmode 602"
,
"uinput -T -m 300 720 300 360 200"
,
"uinput -T -m 650 2760 650 1380 200"
]
},
{
"test-file-name"
:
[
"ActsInputMethodWindManageTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
inputmethod/InputMethodWindManage/entry/src/main/ets/Application/AbilityStage.ts
0 → 100644
浏览文件 @
201ddbe1
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
AbilityStage
from
"
@ohos.app.ability.AbilityStage
"
;
export
default
class
MyAbilityStage
extends
AbilityStage
{
onCreate
()
{
console
.
log
(
"
MyAbilityStage onCreate
"
);
globalThis
.
stageOnCreateRun
=
1
;
globalThis
.
stageContext
=
this
.
context
;
}
}
inputmethod/InputMethodWindManage/entry/src/main/ets/InputMethodWindManage/InputMethodWindService.ts
0 → 100644
浏览文件 @
201ddbe1
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
InputMethodExtensionAbility
from
'
@ohos.InputMethodExtensionAbility
'
;
import
{
KeyboardController
}
from
'
./KeyboardController
'
;
export
default
class
inputMethodWindService
extends
InputMethodExtensionAbility
{
private
keyboardController
:
KeyboardController
;
onCreate
(
want
)
{
console
.
log
(
"
====>onCreate inputMethodWindService
"
);
this
.
keyboardController
=
new
KeyboardController
(
this
.
context
);
this
.
keyboardController
.
onCreate
();
// 初始化窗口
}
onDestroy
()
{
console
.
log
(
"
onDestroy inputMethodEngine**
"
);
this
.
context
.
destroy
();
}
}
\ No newline at end of file
inputmethod/InputMethodWindManage/entry/src/main/ets/InputMethodWindManage/KeyboardController.ts
0 → 100644
浏览文件 @
201ddbe1
此差异已折叠。
点击以展开。
inputmethod/InputMethodWindManage/entry/src/main/ets/MainAbility/MainAbility.ts
0 → 100644
浏览文件 @
201ddbe1
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
Ability
from
'
@ohos.app.ability.UIAbility
'
;
export
default
class
MainAbility
extends
Ability
{
onCreate
(
want
,
launchParam
){
// Ability is creating, initialize resources for this ability
console
.
info
(
"
ImExtAbility onCreate
"
);
globalThis
.
abilityWant
=
want
;
}
onDestroy
()
{
// Ability is destroying, release resources for this ability
console
.
info
(
"
ImExtAbility onDestroy
"
);
}
onWindowStageCreate
(
windowStage
)
{
// Main window is created, set main page for this ability
console
.
info
(
"
ImExtAbility onWindowStageCreate
"
);
globalThis
.
abilityContext
=
this
.
context
;
windowStage
.
setUIContent
(
this
.
context
,
"
pages/index/index
"
,
null
);
console
.
info
(
"
ImExtAbility onWindowStageCreate finish
"
);
}
onWindowStageDestroy
()
{
// Main window is destroyed, release UI related resources
console
.
info
(
"
ImExtAbility onWindowStageDestroy
"
);
}
onForeground
()
{
// Ability has brought to foreground
console
.
info
(
"
ImExtAbility onForeground
"
);
}
onBackground
()
{
// Ability has back to background
console
.
info
(
"
ImExtAbility onBackground
"
);
}
};
\ No newline at end of file
inputmethod/InputMethodWindManage/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
0 → 100644
浏览文件 @
201ddbe1
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
TestRunner
from
'
@ohos.application.testRunner
'
;
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
;
var
abilityDelegator
=
undefined
;
var
abilityDelegatorArguments
=
undefined
;
function
translateParamsToString
(
parameters
)
{
const
keySet
=
new
Set
([
'
-s class
'
,
'
-s notClass
'
,
'
-s suite
'
,
'
-s it
'
,
'
-s level
'
,
'
-s testType
'
,
'
-s size
'
,
'
-s timeout
'
,
'
-s dryRun
'
]);
let
targetParams
=
''
;
for
(
const
key
in
parameters
)
{
if
(
keySet
.
has
(
key
))
{
targetParams
=
`
${
targetParams
}
${
key
}
${
parameters
[
key
]}
`
;
}
}
return
targetParams
.
trim
();
}
async
function
onAbilityCreateCallback
()
{
console
.
log
(
"
onAbilityCreateCallback
"
);
}
async
function
addAbilityMonitorCallback
(
err
:
any
)
{
console
.
info
(
"
addAbilityMonitorCallback :
"
+
JSON
.
stringify
(
err
));
}
export
default
class
OpenHarmonyTestRunner
implements
TestRunner
{
constructor
()
{
}
onPrepare
()
{
console
.
info
(
"
OpenHarmonyTestRunner OnPrepare
"
);
}
async
onRun
()
{
console
.
log
(
'
OpenHarmonyTestRunner onRun run
'
);
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
();
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
();
var
testAbilityName
=
abilityDelegatorArguments
.
bundleName
+
'
.MainAbility
'
;
let
lMonitor
=
{
abilityName
:
testAbilityName
,
onAbilityCreate
:
onAbilityCreateCallback
,
};
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
);
var
cmd
=
'
aa start -d 0 -a com.acts.inputmethodwidmanage.test.MainAbility
'
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
;
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
);
var
debug
=
abilityDelegatorArguments
.
parameters
[
"
-D
"
];
if
(
debug
===
'
true
'
)
{
cmd
+=
'
-D
'
;
}
console
.
info
(
'
cmd :
'
+
cmd
);
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
:
any
,
d
:
any
)
=>
{
console
.
info
(
'
executeShellCommand : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
stdResult
);
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
exitCode
);
});
console
.
info
(
'
OpenHarmonyTestRunner onRun end
'
);
}
};
\ No newline at end of file
inputmethod/InputMethodWindManage/entry/src/main/ets/pages/index/index.ets
0 → 100644
浏览文件 @
201ddbe1
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../../test/List.test'
@Entry
@Component
struct Index {
@State message: string = 'Hello World';
@State inputValue: string = 'inputMethodEngine1inputMethodEngine2inputMethodEngine3inputMethodEngine' +
'inputMethodEngine4inputMethodEngine5inputMethodEngine6inputMethodEngine7inputMethodEngine8inputMethodEn' +
'gine9inputMethodEngine10inputMethodEngine11inputMethodEngine12inputMethodEngine13inputMethodEngine14inputMet' +
'hodEngine15inputMethodEngine16inputMethodEngine17inputMethodEngine18inputMethodEngine19inputMethodEngine20inputMethodEngine21';
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
.defaultFocus(true)
TextArea({ text: this.inputValue })
.onChange((value: string) => {
this.inputValue = value;
})
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(() => {
})
}
.width('100%')
}
.height('100%')
}
aboutToAppear(){
let abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
let abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
}
\ No newline at end of file
inputmethod/InputMethodWindManage/entry/src/main/ets/pages/second/second.ets
0 → 100644
浏览文件 @
201ddbe1
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import router from '@system.router';
@Entry
@Component
struct Second {
private content: string = "Second Page"
build() {
Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('back to index')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
router.back()
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
inputmethod/InputMethodWindManage/entry/src/main/ets/test/InputMethodWindManage.test.ets
0 → 100644
浏览文件 @
201ddbe1
此差异已折叠。
点击以展开。
inputmethod/InputMethodWindManage/entry/src/main/ets/test/List.test.ets
0 → 100644
浏览文件 @
201ddbe1
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import InputMethodWindManage from './InputMethodWindManage.test'
export default function testsuite() {
InputMethodWindManage();
}
\ No newline at end of file
inputmethod/InputMethodWindManage/entry/src/main/module.json
0 → 100644
浏览文件 @
201ddbe1
{
"module"
:
{
"name"
:
"phone"
,
"type"
:
"entry"
,
"srcEntrance"
:
"./ets/Application/AbilityStage.ts"
,
"description"
:
"$string:phone_entry_dsc"
,
"mainElement"
:
"MainAbility"
,
"deviceTypes"
:
[
"tablet"
,
"default"
],
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"uiSyntax"
:
"ets"
,
"pages"
:
"$profile:main_pages"
,
"abilities"
:
[
{
"name"
:
"com.acts.inputmethodwidmanage.test.MainAbility"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
"description"
:
"$string:phone_entry_main"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:entry_label"
,
"visible"
:
true
,
"orientation"
:
"portrait"
,
"launchType"
:
"singleton"
,
"skills"
:
[
{
"actions"
:
[
"action.system.home"
],
"entities"
:[
"entity.system.home"
]
}
]
}
],
"extensionAbilities"
:
[
{
"description"
:
"inputPanelTest"
,
"icon"
:
"$media:icon"
,
"name"
:
"inputMethodWindService"
,
"srcEntrance"
:
"./ets/InputMethodWindManage/InputMethodWindService.ts"
,
"type"
:
"inputMethod"
,
"visible"
:
true
}
],
"requestPermissions"
:
[
{
"name"
:
"ohos.permission.CONNECT_IME_ABILITY"
}
]
}
}
inputmethod/InputMethodWindManage/entry/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
201ddbe1
{
"string"
:
[
{
"name"
:
"phone_entry_dsc"
,
"value"
:
"i am an entry for phone"
},
{
"name"
:
"phone_entry_main"
,
"value"
:
"the phone entry ability"
},
{
"name"
:
"entry_label"
,
"value"
:
"ActsInputMethodWindManageTest"
},
{
"name"
:
"ime_description"
,
"value"
:
"input method extension ability."
},
{
"name"
:
"ime_label"
,
"value"
:
"inputMethod extension ability services."
},
{
"name"
:
"ime_label_1"
,
"value"
:
"inputMethod extension ability services_1."
},
{
"name"
:
"description_application"
,
"value"
:
"demo for test"
},
{
"name"
:
"app_name"
,
"value"
:
"Demo"
}
]
}
inputmethod/InputMethodWindManage/entry/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
201ddbe1
6.6 KB
inputmethod/InputMethodWindManage/entry/src/main/resources/base/profile/main_pages.json
0 → 100644
浏览文件 @
201ddbe1
{
"src"
:
[
"pages/index/index"
,
"pages/second/second"
]
}
\ No newline at end of file
inputmethod/InputMethodWindManage/signature/ActsInputMethodWindManageTest.p7b
0 → 100644
浏览文件 @
201ddbe1
文件已添加
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录