From 62042f13ed51437ac0af420bfb2877ed4580f4a5 Mon Sep 17 00:00:00 2001 From: Phodal Huang Date: Fri, 23 Feb 2024 16:03:00 +0800 Subject: [PATCH] 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. --- .../actions/AndroidPageToArkUiAction.kt | 17 +++++++++++++++++ .../main/resources/cc.unitmesh.harmonyos.xml | 3 ++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/exts/ext-harmonyos/src/main/kotlin/cc/unitmesh/harmonyos/actions/AndroidPageToArkUiAction.kt b/exts/ext-harmonyos/src/main/kotlin/cc/unitmesh/harmonyos/actions/AndroidPageToArkUiAction.kt index 68250fc5e4..28ec80aca9 100644 --- a/exts/ext-harmonyos/src/main/kotlin/cc/unitmesh/harmonyos/actions/AndroidPageToArkUiAction.kt +++ b/exts/ext-harmonyos/src/main/kotlin/cc/unitmesh/harmonyos/actions/AndroidPageToArkUiAction.kt @@ -38,3 +38,20 @@ class AndroidPageToArkUiAction : ChatBaseIntention() { class AutoArkUi(project: Project, selectedText: @NlsSafe String, editor: Editor) { } + +data class Component(val name: String, val type: String, val example: String) { + fun list() { + val button = Component("Button", "Button", "Button('Ok', { type: ButtonType.Normal, stateEffect: true }) \n" + + " .borderRadius(8) \n" + + " .backgroundColor(0x317aff) \n" + + " .width(90)\n" + + " .height(40)") + + val radio = Component("Radio", "Radio", " Radio({ value: 'Radio1', group: 'radioGroup' })\n" + + " .onChange((isChecked: boolean) => {\n" + + " if(isChecked) {\n" + + " //需要执行的操作\n" + + " }\n" + + " })") + } +} diff --git a/exts/ext-harmonyos/src/main/resources/cc.unitmesh.harmonyos.xml b/exts/ext-harmonyos/src/main/resources/cc.unitmesh.harmonyos.xml index 9de4ba1bfb..a745e2c312 100644 --- a/exts/ext-harmonyos/src/main/resources/cc.unitmesh.harmonyos.xml +++ b/exts/ext-harmonyos/src/main/resources/cc.unitmesh.harmonyos.xml @@ -1,6 +1,7 @@ + @@ -9,5 +10,5 @@ messages.AutoDevBundle intention.category.llm - > +