Skip to content

Commit 62042f1

Browse files
committed
feat(ext-harmonyos): add android plugin dependency and component class
- Add a plugin dependency for org.jetbrains.android in ext-harmonyos.xml - Introduce a new data class Component in AndroidPageToArkUiAction.kt with a list() function.
1 parent 09494cf commit 62042f1

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

exts/ext-harmonyos/src/main/kotlin/cc/unitmesh/harmonyos/actions/AndroidPageToArkUiAction.kt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,20 @@ class AndroidPageToArkUiAction : ChatBaseIntention() {
3838
class AutoArkUi(project: Project, selectedText: @NlsSafe String, editor: Editor) {
3939

4040
}
41+
42+
data class Component(val name: String, val type: String, val example: String) {
43+
fun list() {
44+
val button = Component("Button", "Button", "Button('Ok', { type: ButtonType.Normal, stateEffect: true }) \n" +
45+
" .borderRadius(8) \n" +
46+
" .backgroundColor(0x317aff) \n" +
47+
" .width(90)\n" +
48+
" .height(40)")
49+
50+
val radio = Component("Radio", "Radio", " Radio({ value: 'Radio1', group: 'radioGroup' })\n" +
51+
" .onChange((isChecked: boolean) => {\n" +
52+
" if(isChecked) {\n" +
53+
" //需要执行的操作\n" +
54+
" }\n" +
55+
" })")
56+
}
57+
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<idea-plugin package="cc.unitmesh.harmonyos">
22
<!--suppress PluginXmlValidity -->
33
<dependencies>
4+
<plugin id="org.jetbrains.android"/>
45
</dependencies>
56

67
<extensions defaultExtensionNs="cc.unitmesh">
@@ -9,5 +10,5 @@
910
<bundleName>messages.AutoDevBundle</bundleName>
1011
<categoryKey>intention.category.llm</categoryKey>
1112
</autoDevIntention>
12-
</extensions>>
13+
</extensions>
1314
</idea-plugin>

0 commit comments

Comments
 (0)