mirror of
https://gitee.com/openharmony/applications_app_samples
synced 2024-11-24 00:50:03 +00:00
del notes
Signed-off-by: zhaojunxia <zhaojunxia@kaihong.com>
This commit is contained in:
parent
99c0a68948
commit
cffc871587
@ -16,18 +16,6 @@
|
||||
{
|
||||
"app": {
|
||||
"signingConfigs": [
|
||||
{
|
||||
"name": "default",
|
||||
"material": {
|
||||
"certpath": "C:/Users/Administrator/.ohos/config/openharmony/default_KikaInputMethod_U54bIzNDY6IJlZxbuwlUMxs0q-DQZ3MmwDCiK9XWifM=.cer",
|
||||
"storePassword": "0000001A443F30EB5BD1003CA9676C30DE76C8DFBEA1B71710237B0C04C60F6512301D797C3B7C2F452D",
|
||||
"keyAlias": "debugKey",
|
||||
"keyPassword": "0000001A1B32A39E9EF5C2A494BA924624E6AA61F5565D2021E9F652560C8DA011A92BBA94E5EA8BA761",
|
||||
"profile": "C:/Users/Administrator/.ohos/config/openharmony/default_KikaInputMethod_U54bIzNDY6IJlZxbuwlUMxs0q-DQZ3MmwDCiK9XWifM=.p7b",
|
||||
"signAlg": "SHA256withECDSA",
|
||||
"storeFile": "C:/Users/Administrator/.ohos/config/openharmony/default_KikaInputMethod_U54bIzNDY6IJlZxbuwlUMxs0q-DQZ3MmwDCiK9XWifM=.p12"
|
||||
}
|
||||
}
|
||||
],
|
||||
"products": [
|
||||
{
|
||||
|
@ -12,11 +12,11 @@ export default class EntryAbility extends UIAbility {
|
||||
onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {
|
||||
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate');
|
||||
// inputMethod.getSetting().showOptionalInputMethods();
|
||||
try {
|
||||
this.getPermission();
|
||||
} catch (err) {
|
||||
hilog.info(0x0000, 'testTag', '%{public}s', 'err is ' + err);
|
||||
}
|
||||
// try {
|
||||
// this.getPermission();
|
||||
// } catch (err) {
|
||||
// hilog.info(0x0000, 'testTag', '%{public}s', 'err is ' + err);
|
||||
// }
|
||||
}
|
||||
|
||||
onDestroy(): void {
|
||||
|
@ -95,7 +95,6 @@ export class InputHandler {
|
||||
this.mEditorAttribute = res;
|
||||
AppStorage.setOrCreate('enterKeyType', res.enterKeyType);
|
||||
AppStorage.setOrCreate('inputPattern', res.inputPattern);
|
||||
// AppStorage.setOrCreate('isTextPreviewSupported', res.isTextPreviewSupported);
|
||||
|
||||
this.setInputInfo('EditorInfo:enterKeyType = ' + this.mEditorAttribute.enterKeyType + ';inputPattern = ' + this.mEditorAttribute.inputPattern +
|
||||
'; isTextPreviewSupported = ' + this.mEditorAttribute.isTextPreviewSupported);
|
||||
@ -188,8 +187,6 @@ export class InputHandler {
|
||||
if (textPre == "hel") {
|
||||
this.addLog('insertText hel');
|
||||
try {
|
||||
// let indexCursor: number = 0;
|
||||
// indexCursor = this.mTextInputClient.getTextIndexAtCursorSync();
|
||||
let endRange: number = indexCursor + 1; //把当前字符计算在内
|
||||
this.addLog('insertText start ' + (indexCursor - length).toString());
|
||||
this.addLog('insertText end ' + (indexCursor).toString());
|
||||
@ -204,13 +201,8 @@ export class InputHandler {
|
||||
}
|
||||
}
|
||||
else if (this.intputText.length > length + 1){
|
||||
this.addLog('insertText indexSubStrStart else ');
|
||||
this.addLog('insertText this.intputText ' + this.intputText);
|
||||
|
||||
// if (textPre.length > length + 1) {
|
||||
//
|
||||
// }
|
||||
|
||||
let indexSubStrStart: number = this.intputText.lastIndexOf("hel");
|
||||
this.addLog('insertText indexSubStrStart ' + indexSubStrStart.toString());
|
||||
|
||||
@ -231,49 +223,6 @@ export class InputHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//发送私有数据到文本编辑框
|
||||
// 首先,判断当前输入的前三个字符是否为177
|
||||
// let length = 3;
|
||||
// let textPrivate: string = this.mTextInputClient.getForwardSync(length);
|
||||
// this.addLog('insertText textPrivate :' + textPrivate);
|
||||
// if (textPrivate == "177") {
|
||||
// // 然后,发送私有数据到文本框
|
||||
//
|
||||
// }
|
||||
// try {
|
||||
// this.mTextInputClient.getForward(length).then((text: string) => {
|
||||
// console.log('Succeeded in getting forward, text: ' + text);
|
||||
// if (text == "177") {
|
||||
// // 然后,发送私有数据到文本框
|
||||
// try {
|
||||
// this.addLog(`onInputStart sendPrivateCommand begin`);
|
||||
// let record: Record<string, inputMethodEngine.CommandDataType> = {
|
||||
// "valueString1": "17712346543",
|
||||
// }
|
||||
// this.mTextInputClient.sendPrivateCommand(record).then((err) => {
|
||||
// this.addLog(`onInputStart sendPrivateCommand success`);
|
||||
// }).catch((err:BusinessError) => {
|
||||
// if (err !== undefined) {
|
||||
// let error = err as BusinessError;
|
||||
// this.addLog(`onInputStart sendPrivateCommand catch error: ${error.code} ${error.message}`);
|
||||
// }
|
||||
// });
|
||||
// } catch (err) {
|
||||
// let error = err as BusinessError;
|
||||
// this.addLog(`onInputStart sendPrivateCommand catch error: ${error.code} ${error.message}`);
|
||||
// }
|
||||
// }
|
||||
// }).catch((err: BusinessError) => {
|
||||
// console.error(`Failed to getForward: ${JSON.stringify(err)}`);
|
||||
// });
|
||||
// } catch (err) {
|
||||
// console.error(`Failed to getForward: ${JSON.stringify(err)}`);
|
||||
// }
|
||||
|
||||
|
||||
// old code
|
||||
} else {
|
||||
this.addLog('insertText this.mTextInputClient is undefined');
|
||||
}
|
||||
|
@ -3,10 +3,7 @@ import inputMethodEngine from '@ohos.inputMethodEngine';
|
||||
import Log from '../model/Log';
|
||||
import { BusinessError } from '@ohos.base';
|
||||
|
||||
// import { privatePreviewController } from '../model/PrivatePreviewController';
|
||||
|
||||
const TAG: string = 'PrivatePreview->';
|
||||
const InputMethodEngine: inputMethodEngine.InputMethodAbility = inputMethodEngine.getInputMethodAbility();
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
@ -28,32 +25,7 @@ struct PrivatePreview {
|
||||
}
|
||||
|
||||
onPageShow() {
|
||||
this.addLog(`private command onPageShow begin!`);
|
||||
// try {
|
||||
// let defaultIme = inputMethod.getDefaultInputMethod();
|
||||
// } catch(err) {
|
||||
// console.error(`Failed to getDefaultInputMethod: ${JSON.stringify(err)}`);
|
||||
// }
|
||||
// inputMethod.getSetting().showOptionalInputMethods();
|
||||
|
||||
// privatePreviewController.onCreate(this.context);
|
||||
|
||||
// inputMethod.getSetting().showOptionalInputMethods().then((data: boolean) => {
|
||||
// console.log('onPageShow Succeeded in showing optionalInputMethods.');
|
||||
// }).catch((err: BusinessError) => {
|
||||
// console.error(`onPageShow Failed to showOptionalInputMethods: ${JSON.stringify(err)}`);
|
||||
// })
|
||||
|
||||
// try {// getInputMethodEngine getInputMethodAbility
|
||||
// inputMethodEngine.getInputMethodAbility().on('inputStart', (kbController: inputMethodEngine.KeyboardController, textInputClient: inputMethodEngine.InputClient) => {
|
||||
// this.addLog('onPageShow keyboard inputStart');
|
||||
// // this.inputHandle.onInputStart(kbController, textInputClient);
|
||||
// let inputClient = textInputClient;
|
||||
// })
|
||||
// } catch (err) {
|
||||
// let error = err as BusinessError;
|
||||
// this.addLog(`onPageShow keyboard inputStart command error: ${error.code} ${error.message}`);
|
||||
// }
|
||||
this.addLog(`private command onPageShow!`);
|
||||
}
|
||||
|
||||
addLog(message: string): void {
|
||||
@ -62,13 +34,9 @@ struct PrivatePreview {
|
||||
|
||||
build() {
|
||||
Column() {
|
||||
// Text(this.message)
|
||||
// .fontSize(50)
|
||||
// .fontWeight(FontWeight.Bold)
|
||||
|
||||
Text($r('app.string.Preview_Text'))
|
||||
.width("100%")
|
||||
.height(56)// .position({ x: "7%", y: "0vp" })
|
||||
.height(56)
|
||||
.fontFamily("HarmonyHeiTi-Medium")
|
||||
.fontSize("16fp")
|
||||
.fontColor("#182431")
|
||||
@ -77,7 +45,7 @@ struct PrivatePreview {
|
||||
|
||||
TextInput({
|
||||
text: this.preViewText,
|
||||
placeholder: $r('app.string.Preview_tip'), //'The text area can hold an unlimited amount of text. input your word...'
|
||||
placeholder: $r('app.string.Preview_tip'),
|
||||
controller: this.controllerPreview
|
||||
})
|
||||
.placeholderFont({ size: 16, weight: 400 })
|
||||
@ -90,11 +58,10 @@ struct PrivatePreview {
|
||||
.border({ width: 1, color: Color.Gray, radius: 18 })
|
||||
.maxLength(50)
|
||||
.onChange((value: string) => {
|
||||
// this.preViewText = value
|
||||
this.addLog('preViewText onChange begin.');
|
||||
this.addLog('preViewText onChange.');
|
||||
})
|
||||
.onSubmit(() => {
|
||||
this.addLog('preViewText onSubmit begin.');
|
||||
this.addLog('preViewText onSubmit.');
|
||||
})
|
||||
}
|
||||
.width('100%')
|
||||
|
@ -1,50 +1,18 @@
|
||||
///*
|
||||
// * Copyright (c) 2023 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.
|
||||
// */
|
||||
//
|
||||
//{
|
||||
// "module": {
|
||||
// "name": "entry",
|
||||
// "type": "entry",
|
||||
// "srcEntry": "./ets/Application/AbilityStage.ets",
|
||||
// "description": "$string:entry_desc",
|
||||
// "mainElement": "MainAbility",
|
||||
// "deviceTypes": [
|
||||
// "default",
|
||||
// "tablet"
|
||||
// ],
|
||||
// "deliveryWithInstall": true,
|
||||
// "installationFree": false,
|
||||
// "pages": "$profile:main_pages",
|
||||
// "metadata": [
|
||||
// {
|
||||
// "name": "ArkTSPartialUpdate",
|
||||
// "value": "true"
|
||||
// }
|
||||
// ],
|
||||
// "extensionAbilities": [
|
||||
// {
|
||||
// "srcEntry": "./ets/ServiceExtAbility/ServiceExtAbility.ets",
|
||||
// "name": "ServiceExtAbility",
|
||||
// "label": "$string:MainAbility_label",
|
||||
// "description": "$string:extension_ability_descripter",
|
||||
// "type": "inputMethod",
|
||||
// "exported": true
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
//}
|
||||
/*
|
||||
* Copyright (c) 2023 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.
|
||||
*/
|
||||
|
||||
{
|
||||
"module": {
|
||||
"name": "entry",
|
||||
@ -96,28 +64,6 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"requestPermissions":[
|
||||
// {
|
||||
// "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED",
|
||||
// //"reason": "$string:read_permission",
|
||||
// "usedScene": {
|
||||
// "abilities": [
|
||||
// "EntryAbility"
|
||||
// ],
|
||||
// "when": "always"
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// "name": "ohos.permission.START_ABILITIES_FROM_BACKGROUND",
|
||||
// //"reason": "$string:read_permission",
|
||||
// "usedScene": {
|
||||
// "abilities": [
|
||||
// "EntryAbility"
|
||||
// ],
|
||||
// "when": "always"
|
||||
// }
|
||||
// }
|
||||
]
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user