From 87f6b0ab20674549129ebbc5a986d4e0b7ebed0f Mon Sep 17 00:00:00 2001 From: zhouyongfei Date: Fri, 11 Feb 2022 19:03:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=85=A5=E8=BE=93=E5=85=A5=E6=B3=95?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=AF=B9=E8=AF=9D=E6=A1=86=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhouyongfei --- services/BUILD.gn | 2 + services/dialog/js/BUILD.gn | 25 +++++++++ services/dialog/js/common/.gitkeep | 0 services/dialog/js/i18n/en-US.json | 6 ++ services/dialog/js/i18n/zh-CN.json | 6 ++ services/dialog/js/pages/index/index.css | 71 ++++++++++++++++++++++++ services/dialog/js/pages/index/index.hml | 19 +++++++ services/dialog/js/pages/index/index.js | 19 +++++++ 8 files changed, 148 insertions(+) create mode 100644 services/dialog/js/BUILD.gn create mode 100644 services/dialog/js/common/.gitkeep create mode 100644 services/dialog/js/i18n/en-US.json create mode 100644 services/dialog/js/i18n/zh-CN.json create mode 100644 services/dialog/js/pages/index/index.css create mode 100644 services/dialog/js/pages/index/index.hml create mode 100644 services/dialog/js/pages/index/index.js diff --git a/services/BUILD.gn b/services/BUILD.gn index 675ba62..3c8095a 100644 --- a/services/BUILD.gn +++ b/services/BUILD.gn @@ -73,6 +73,8 @@ ohos_shared_library("inputmethod_service") { "//utils/native/base:utils", ] + deps += [ "//base/miscservices/inputmethod/services/dialog/js:dialog_ime_js_files_etc" ] + external_deps = [ "hiviewdfx_hilog_native:libhilog" ] subsystem_name = "miscservices" diff --git a/services/dialog/js/BUILD.gn b/services/dialog/js/BUILD.gn new file mode 100644 index 0000000..469d1ad --- /dev/null +++ b/services/dialog/js/BUILD.gn @@ -0,0 +1,25 @@ +# 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("//foundation/ace/ace_engine/build/ace_gen_sa_dialog_js.gni") + +gen_sa_dialog_js("dialog_ime_js_files_etc") { + project_path = "//base/miscservices/inputmethod/services/dialog/js/" + i18n_files = [ + "i18n/en-US.json", + "i18n/zh-CN.json", + ] + common_files = [] + dialog_name = "input_method_choose_dialog" + part_name = "inputmethod_native" + subsystem_name = "miscservices" +} diff --git a/services/dialog/js/common/.gitkeep b/services/dialog/js/common/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/services/dialog/js/i18n/en-US.json b/services/dialog/js/i18n/en-US.json new file mode 100644 index 0000000..e42008d --- /dev/null +++ b/services/dialog/js/i18n/en-US.json @@ -0,0 +1,6 @@ +{ + "strings": { + "setIme": "Set Default Ime", + "dialogTitle": "Select Ime" + } +} diff --git a/services/dialog/js/i18n/zh-CN.json b/services/dialog/js/i18n/zh-CN.json new file mode 100644 index 0000000..329de4e --- /dev/null +++ b/services/dialog/js/i18n/zh-CN.json @@ -0,0 +1,6 @@ +{ + "strings": { + "setIme": "配置默认输入法", + "dialogTitle": "选择输入法" + } +} diff --git a/services/dialog/js/pages/index/index.css b/services/dialog/js/pages/index/index.css new file mode 100644 index 0000000..d9cd6c1 --- /dev/null +++ b/services/dialog/js/pages/index/index.css @@ -0,0 +1,71 @@ +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + left: 0fp; + top: 0fp; + width: 100%; + height: 100%; +} + +.title { + font-size: 20fp; + text-align: start; + width: 100%; + height: 28fp; + margin-top: 12fp; + margin-left: 23fp; + margin-right: 25fp; + color:#000000; +} + +.btn { + width: 50%; + height: 100fp; + font-size: 40fp; +} + +.list { + width: 100%; + height: 100%; + margin-top: 22fp; +} + +.listItem { + width: 100%; + height: 42fp; + margin-top: 12fp; + margin-bottom: 12fp; +} + +.imeName { + width: 100%; + height: 22fp; + font-size: 16fp; + weight:medium; + color:#000000; +} + +.imeDecription { + width: 100%; + height: 22fp; + font-size: 13fp; + weight:medium; + margin-top: 2fp; + color:#66000000; +} + +.imeMessage { + width: 100%; + height: 100%; + flex-direction: column; + margin-left: 23fp; +} + +.circle { + width: 24fp; + height: 24fp; + margin-left: 12fp; + margin-right: 24fp; +} \ No newline at end of file diff --git a/services/dialog/js/pages/index/index.hml b/services/dialog/js/pages/index/index.hml new file mode 100644 index 0000000..1b3c834 --- /dev/null +++ b/services/dialog/js/pages/index/index.hml @@ -0,0 +1,19 @@ +
+ + {{ dialogTitle }} + + + +
+ {{ $item.name }} + {{ $item.discription }} +
+ + + +
+
+
diff --git a/services/dialog/js/pages/index/index.js b/services/dialog/js/pages/index/index.js new file mode 100644 index 0000000..312ed05 --- /dev/null +++ b/services/dialog/js/pages/index/index.js @@ -0,0 +1,19 @@ +import router from '@ohos.router' + +export default { + data: { + imeList: router.getParams().imeList, + }, + onInit() { + this.dialogTitle = this.$t('strings.dialogTitle'); + this.setIme = this.$t('strings.setIme'); + }, + changeDefaultIme(ime) { + console.info('ImsaKit-dialog changeDefaultIme: ' + ime); + callNativeHandler("EVENT_CHANGE_IME", ime); + }, + startImeSetting() { + console.info('ImsaKit-dialog startImeSetting'); + callNativeHandler("EVENT_START_IME_SETTING", ""); + } +}